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.py114
1 files changed, 92 insertions, 22 deletions
diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py
index 4006380..91c867e 100644
--- a/gdb/gdbarch_components.py
+++ b/gdb/gdbarch_components.py
@@ -1,6 +1,6 @@
# Dynamic architecture support for GDB, the GNU debugger.
-# Copyright (C) 1998-2024 Free Software Foundation, Inc.
+# Copyright (C) 1998-2025 Free Software Foundation, Inc.
# This file is part of GDB.
@@ -830,6 +830,19 @@ allocate and return a struct value with all value attributes
)
Method(
+ comment="""
+For a DW_OP_piece located in a register, but not occupying the
+entire register, return the placement of the piece within that
+register as defined by the ABI.
+""",
+ type="ULONGEST",
+ name="dwarf2_reg_piece_offset",
+ params=[("int", "regnum"), ("ULONGEST", "size")],
+ predefault="default_dwarf2_reg_piece_offset",
+ invalid=False,
+)
+
+Method(
type="CORE_ADDR",
name="pointer_to_address",
params=[("struct type *", "type"), ("const gdb_byte *", "buf")],
@@ -1232,18 +1245,55 @@ possible it should be in TARGET_READ_PC instead).
Method(
comment="""
On some architectures, not all bits of a pointer are significant.
-On AArch64, for example, the top bits of a pointer may carry a "tag", which
-can be ignored by the kernel and the hardware. The "tag" can be regarded as
-additional data associated with the pointer, but it is not part of the address.
+On AArch64 and amd64, for example, the top bits of a pointer may carry a
+"tag", which can be ignored by the kernel and the hardware. The "tag" can be
+regarded as additional data associated with the pointer, but it is not part
+of the address.
+
+Given a pointer for the architecture, this hook removes all the
+non-significant bits and sign-extends things as needed. It gets used to
+remove non-address bits from pointers used for watchpoints.
+""",
+ type="CORE_ADDR",
+ name="remove_non_address_bits_watchpoint",
+ params=[("CORE_ADDR", "pointer")],
+ predefault="default_remove_non_address_bits",
+ invalid=False,
+)
+
+Method(
+ comment="""
+On some architectures, not all bits of a pointer are significant.
+On AArch64 and amd64, for example, the top bits of a pointer may carry a
+"tag", which can be ignored by the kernel and the hardware. The "tag" can be
+regarded as additional data associated with the pointer, but it is not part
+of the address.
+
+Given a pointer for the architecture, this hook removes all the
+non-significant bits and sign-extends things as needed. It gets used to
+remove non-address bits from pointers used for breakpoints.
+""",
+ type="CORE_ADDR",
+ name="remove_non_address_bits_breakpoint",
+ params=[("CORE_ADDR", "pointer")],
+ predefault="default_remove_non_address_bits",
+ invalid=False,
+)
+
+Method(
+ comment="""
+On some architectures, not all bits of a pointer are significant.
+On AArch64 and amd64, for example, the top bits of a pointer may carry a
+"tag", which can be ignored by the kernel and the hardware. The "tag" can be
+regarded as additional data associated with the pointer, but it is not part
+of the address.
Given a pointer for the architecture, this hook removes all the
-non-significant bits and sign-extends things as needed. It gets used to remove
-non-address bits from data pointers (for example, removing the AArch64 MTE tag
-bits from a pointer) and from code pointers (removing the AArch64 PAC signature
-from a pointer containing the return address).
+non-significant bits and sign-extends things as needed. It gets used to
+remove non-address bits from any pointer used to access memory.
""",
type="CORE_ADDR",
- name="remove_non_address_bits",
+ name="remove_non_address_bits_memory",
params=[("CORE_ADDR", "pointer")],
predefault="default_remove_non_address_bits",
invalid=False,
@@ -1381,12 +1431,12 @@ Function(
invalid=False,
)
-Value(
- comment="Vtable of solib operations functions.",
- type="const solib_ops *",
- name="so_ops",
- predefault="&solib_target_so_ops",
- printer="host_address_to_string (gdbarch->so_ops)",
+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=[],
+ predefault="make_target_solib_ops",
invalid=False,
)
@@ -1448,7 +1498,7 @@ Function(
comment="""
Process an ELF symbol in the minimal symbol table in a backend-specific
way. Normally this hook is supposed to do nothing, however if required,
-then this hook can be used to apply tranformations to symbols that are
+then this hook can be used to apply transformations to symbols that are
considered special in some way. For example the MIPS backend uses it
to interpret `st_other' information to mark compressed code symbols so
that they can be treated in the appropriate manner in the processing of
@@ -1456,7 +1506,7 @@ the main symbol table and DWARF-2 records.
""",
type="void",
name="elf_make_msymbol_special",
- params=[("asymbol *", "sym"), ("struct minimal_symbol *", "msym")],
+ params=[("const asymbol *", "sym"), ("struct minimal_symbol *", "msym")],
predicate=True,
)
@@ -1472,7 +1522,7 @@ Function(
comment="""
Process a symbol in the main symbol table in a backend-specific way.
Normally this hook is supposed to do nothing, however if required,
-then this hook can be used to apply tranformations to symbols that
+then this hook can be used to apply transformations to symbols that
are considered special in some way. This is currently used by the
MIPS backend to make sure compressed code symbols have the ISA bit
set. This in turn is needed for symbol values seen in GDB to match
@@ -2076,7 +2126,7 @@ Record architecture-specific information from the symbol table.
""",
type="void",
name="record_special_symbol",
- params=[("struct objfile *", "objfile"), ("asymbol *", "sym")],
+ params=[("struct objfile *", "objfile"), ("const asymbol *", "sym")],
predicate=True,
)
@@ -2174,7 +2224,7 @@ For example, on x86 the register indirection is written as:
(%eax) ;; indirecting eax
-in this case, this prefix would be the charater `('.
+in this case, this prefix would be the character `('.
Please note that we use the indirection prefix also for register
displacement, e.g., `4(%eax)' on x86.
@@ -2193,7 +2243,7 @@ For example, on x86 the register indirection is written as:
(%eax) ;; indirecting eax
-in this case, this prefix would be the charater `)'.
+in this case, this prefix would be the character `)'.
Please note that we use the indirection suffix also for register
displacement, e.g., `4(%eax)' on x86.
@@ -2502,7 +2552,7 @@ Implement the "info proc" command.
Method(
comment="""
-Implement the "info proc" command for core files. Noe that there
+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.
""",
@@ -2778,3 +2828,23 @@ The corefile's bfd is passed through COREFILE_BFD.
predefault="default_use_target_description_from_corefile_notes",
invalid=False,
)
+
+Method(
+ comment="""
+Examine the core file bfd object CBFD and try to extract the name of
+the current executable and the argument list, which are return in a
+core_file_exec_context object.
+
+If for any reason the details can't be extracted from CBFD then an
+empty context is returned.
+
+It is required that the current inferior be the one associated with
+CBFD, strings are read from the current inferior using target methods
+which all assume current_inferior() is the one to read from.
+""",
+ type="core_file_exec_context",
+ name="core_parse_exec_context",
+ params=[("bfd *", "cbfd")],
+ predefault="default_core_parse_exec_context",
+ invalid=False,
+)