aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch_components.py
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbarch_components.py')
-rw-r--r--gdb/gdbarch_components.py99
1 files changed, 66 insertions, 33 deletions
diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py
index 91c867e..3820ae3 100644
--- a/gdb/gdbarch_components.py
+++ b/gdb/gdbarch_components.py
@@ -1395,7 +1395,7 @@ the condition is true, so that we ensure forward progress when stepping
past a conditional branch to self.
""",
type="std::vector<CORE_ADDR>",
- name="software_single_step",
+ name="get_next_pcs",
params=[("struct regcache *", "regcache")],
predicate=True,
)
@@ -1435,7 +1435,7 @@ Function(
comment="Return a newly-allocated solib_ops object capable of providing the solibs for this architecture.",
type="solib_ops_up",
name="make_solib_ops",
- params=[],
+ params=[("program_space *", "pspace")],
predefault="make_target_solib_ops",
invalid=False,
)
@@ -1738,7 +1738,12 @@ failed, otherwise, return the red length of READBUF.
""",
type="ULONGEST",
name="core_xfer_shared_libraries",
- params=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
+ params=[
+ ("struct bfd &", "cbfd"),
+ ("gdb_byte *", "readbuf"),
+ ("ULONGEST", "offset"),
+ ("ULONGEST", "len"),
+ ],
predicate=True,
)
@@ -1750,7 +1755,12 @@ Return the number of bytes read (zero indicates failure).
""",
type="ULONGEST",
name="core_xfer_shared_libraries_aix",
- params=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
+ params=[
+ ("struct bfd &", "cbfd"),
+ ("gdb_byte *", "readbuf"),
+ ("ULONGEST", "offset"),
+ ("ULONGEST", "len"),
+ ],
predicate=True,
)
@@ -1766,34 +1776,39 @@ How the core target converts a PTID from a core file to a string.
Method(
comment="""
-How the core target extracts the name of a thread from a core file.
+How the core target extracts the name of a thread from core file CBFD.
""",
type="const char *",
name="core_thread_name",
- params=[("struct thread_info *", "thr")],
+ params=[("struct bfd &", "cbfd"), ("struct thread_info *", "thr")],
predicate=True,
)
Method(
comment="""
Read offset OFFSET of TARGET_OBJECT_SIGNAL_INFO signal information
-from core file into buffer READBUF with length LEN. Return the number
+from core file CBFD into buffer READBUF with length LEN. Return the number
of bytes read (zero indicates EOF, a negative value indicates failure).
""",
type="LONGEST",
name="core_xfer_siginfo",
- params=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
+ params=[
+ ("struct bfd &", "cbfd"),
+ ("gdb_byte *", "readbuf"),
+ ("ULONGEST", "offset"),
+ ("ULONGEST", "len"),
+ ],
predicate=True,
)
Method(
comment="""
-Read x86 XSAVE layout information from core file into XSAVE_LAYOUT.
+Read x86 XSAVE layout information from core file CBFD into XSAVE_LAYOUT.
Returns true if the layout was read successfully.
""",
type="bool",
name="core_read_x86_xsave_layout",
- params=[("x86_xsave_layout &", "xsave_layout")],
+ params=[("struct bfd &", "cbfd"), ("x86_xsave_layout &", "xsave_layout")],
predicate=True,
)
@@ -1891,7 +1906,7 @@ receive control again (e.g. by placing a software breakpoint instruction into
the displaced instruction buffer).
The default implementation returns false on all targets that provide a
-gdbarch_software_single_step routine, and true otherwise.
+gdbarch_get_next_pcs routine, and true otherwise.
""",
type="bool",
name="displaced_step_hw_singlestep",
@@ -2554,33 +2569,16 @@ Method(
comment="""
Implement the "info proc" command for core files. Note that there
are two "info_proc"-like methods on gdbarch -- one for core files,
-one for live targets.
+one for live targets. CBFD is the core file being read from.
""",
type="void",
name="core_info_proc",
- params=[("const char *", "args"), ("enum info_proc_what", "what")],
- predicate=True,
-)
-
-Method(
- comment="""
-Iterate over all objfiles in the order that makes the most sense
-for the architecture to make global symbol searches.
-
-CB is a callback function passed an objfile to be searched. The iteration stops
-if this function returns nonzero.
-
-If not NULL, CURRENT_OBJFILE corresponds to the objfile being
-inspected when the symbol search was requested.
-""",
- type="void",
- name="iterate_over_objfiles_in_search_order",
params=[
- ("iterate_over_objfiles_in_search_order_cb_ftype", "cb"),
- ("struct objfile *", "current_objfile"),
+ ("struct bfd *", "cbfd"),
+ ("const char *", "args"),
+ ("enum info_proc_what", "what"),
],
- predefault="default_iterate_over_objfiles_in_search_order",
- invalid=False,
+ predicate=True,
)
Value(
@@ -2848,3 +2846,38 @@ which all assume current_inferior() is the one to read from.
predefault="default_core_parse_exec_context",
invalid=False,
)
+
+Method(
+ comment="""
+Some targets support special hardware-assisted control-flow protection
+technologies. For example, the Intel Control-Flow Enforcement Technology
+(Intel CET) on x86 provides a shadow stack and indirect branch tracking.
+To enable shadow stack support for inferior calls the shadow_stack_push
+gdbarch hook has to be provided. The get_shadow_stack_pointer gdbarch
+hook has to be provided to enable displaced stepping.
+
+Push NEW_ADDR to the shadow stack and update the shadow stack pointer.
+""",
+ type="void",
+ name="shadow_stack_push",
+ params=[("CORE_ADDR", "new_addr"), ("regcache *", "regcache")],
+ predicate=True,
+)
+
+Method(
+ comment="""
+If possible, return the shadow stack pointer. If the shadow stack
+feature is enabled then set SHADOW_STACK_ENABLED to true, otherwise
+set SHADOW_STACK_ENABLED to false. This hook has to be provided to enable
+displaced stepping for shadow stack enabled programs.
+On some architectures, the shadow stack pointer is available even if the
+feature is disabled. So dependent on the target, an implementation of
+this function may return a valid shadow stack pointer, but set
+SHADOW_STACK_ENABLED to false.
+""",
+ type="std::optional<CORE_ADDR>",
+ name="get_shadow_stack_pointer",
+ params=[("regcache *", "regcache"), ("bool &", "shadow_stack_enabled")],
+ predefault="default_get_shadow_stack_pointer",
+ invalid=False,
+)