binutils-gdb/gdb/tui
Simon Marchi 0c1bcd2327 gdb: convert obj_section macros to methods
Convert these three macros to methods of obj_section.  The problem fixed
by the following patch is caused by an out of bound access of the
objfile::section_offsets vector.  Since this is deep in macros, we don't
get a clear backtrace and it's difficult to debug.  Changing that to
methods means we can step in them and break on them.

Because their implementation requires knowing about struct objfile, move
struct obj_section below struct objfile in objfiles.h.

The obj_section_offset was used in one place as an lvalue to set
offsets, in machoread.c.  Replace that with a set_offset method.

Add the objfile::section_offset and objfile::set_section_offset methods
to improve encapsulation (reduce other objects poking into struct
objfile's internals).

gdb/ChangeLog:

	* objfiles.h (struct obj_section): Move down.
	<offset, set_offset, addr, endaddr>: New.
	(obj_section_offset, obj_section_addr, obj_section_endaddr),
	replace all users to use obj_section methods.
	(struct objfile) <section_offset, set_section_offset>: New.

Change-Id: I97e8fcae93ab2353fbdadcb4a5ec10d7949a7334
2021-06-28 15:28:26 -04:00
..
ChangeLog-1998-2003
tui-command.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-command.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-data.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-data.h Initial TUI mouse support 2021-06-04 16:15:01 +02:00
tui-disasm.c gdb: convert obj_section macros to methods 2021-06-28 15:28:26 -04:00
tui-disasm.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-file.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-file.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-hooks.c gdbsupport, gdb: give names to observers 2021-04-24 19:26:41 -04:00
tui-hooks.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-interp.c gdbsupport, gdb: give names to observers 2021-04-24 19:26:41 -04:00
tui-io.c Make the TUI command window support the mouse 2021-06-17 11:57:56 +01:00
tui-io.h gdb/tui: fix issue with handling the return character 2021-02-08 09:51:46 +00:00
tui-layout.c gdb: add context getter/setter to cmd_list_element 2021-06-25 21:35:40 -04:00
tui-layout.h gdb/tui: don't add windows to global list from tui_layout🪟:apply 2021-02-08 11:18:33 +00:00
tui-location.c gdb/tui: remove special handling of locator/status window 2021-01-28 17:00:30 +00:00
tui-location.h gdb/tui: remove special handling of locator/status window 2021-01-28 17:00:30 +00:00
tui-out.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-out.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-regs.c Don't draw register sub windows outside the visible area 2021-02-07 19:13:45 +01:00
tui-regs.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-source.c gdb/tui: remove special handling of locator/status window 2021-01-28 17:00:30 +00:00
tui-source.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-stack.c gdb: move all "current target" wrapper implementations to target.c 2021-03-24 18:07:30 -04:00
tui-stack.h gdb/tui: remove special handling of locator/status window 2021-01-28 17:00:30 +00:00
tui-win.c Make the TUI command window support the mouse 2021-06-17 11:57:56 +01:00
tui-win.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-wingeneral.c gdb/tui: remove special handling of locator/status window 2021-01-28 17:00:30 +00:00
tui-wingeneral.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui-winsource.c gdb: remove iterate_over_breakpoints function 2021-05-27 14:58:37 -04:00
tui-winsource.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
tui.c Make the TUI command window support the mouse 2021-06-17 11:57:56 +01:00
tui.h gdb/tui: remove special handling of locator/status window 2021-01-28 17:00:30 +00:00