summaryrefslogtreecommitdiff
path: root/gdb/gdbarch.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-08-06 19:02:12 +0000
committerCorinna Vinschen <corinna@vinschen.de>2010-08-06 19:02:12 +0000
commit7177c3777ad365ae9072c2d609c34034fad52620 (patch)
tree1e666d8cb8bd93ff403c6eb83d561ddca2dc735b /gdb/gdbarch.h
parent6eee9f41a7a082b8ac53c0f85167e3a67d5c1556 (diff)
downloadgdb-7177c3777ad365ae9072c2d609c34034fad52620.tar.gz
* dwarf2-frame.c (struct dwarf2_cie): Add ptr_size member.
Throughout, call read_encoded_value with ptr_size rather than addr_size. (decode_frame_entry_1): Remove redundant setting of addr_size. Call gdbarch_dwarf2_addr_size rather than gdbarch_ptr_bit to determine addr_size in Dwarf versions < 4. Set ptr_size dependent on examined frame section. Add comment to explain why. * gdbarch.sh (dwarf2_addr_size): Define as variable. Add lengthy comment to explain usage. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * xstormy16-tdep.c (xstormy16_gdbarch_init): Set dwarf2_addr_size to 4.
Diffstat (limited to 'gdb/gdbarch.h')
-rw-r--r--gdb/gdbarch.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index d2b0e5afec8..f6c7ce81aef 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -154,8 +154,8 @@ extern void set_gdbarch_long_double_format (struct gdbarch *gdbarch, const struc
/ addr_bit will be set from it.
If gdbarch_ptr_bit and gdbarch_addr_bit are different, you'll probably
- also need to set gdbarch_pointer_to_address and gdbarch_address_to_pointer
- as well.
+ also need to set gdbarch_dwarf2_addr_size, gdbarch_pointer_to_address and
+ gdbarch_address_to_pointer as well.
ptr_bit is the size of a pointer on the target */
@@ -167,6 +167,23 @@ extern void set_gdbarch_ptr_bit (struct gdbarch *gdbarch, int ptr_bit);
extern int gdbarch_addr_bit (struct gdbarch *gdbarch);
extern void set_gdbarch_addr_bit (struct gdbarch *gdbarch, int addr_bit);
+/* dwarf2_addr_size is the target address size as used in the Dwarf debug
+ info. For .debug_frame FDEs, this is supposed to be the target address
+ size from the associated CU header, and which is equivalent to the
+ DWARF2_ADDR_SIZE as defined by the target specific GCC back-end.
+ Unfortunately there is no good way to determine this value. Therefore
+ dwarf2_addr_size simply defaults to the target pointer size.
+
+ dwarf2_addr_size is not used for .eh_frame FDEs, which are generally
+ defined using the target's pointer size so far.
+
+ Note that dwarf2_addr_size only needs to be redefined by a target if the
+ GCC back-end defines a DWARF2_ADDR_SIZE other than the target pointer size,
+ and if Dwarf versions < 4 need to be supported. */
+
+extern int gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch);
+extern void set_gdbarch_dwarf2_addr_size (struct gdbarch *gdbarch, int dwarf2_addr_size);
+
/* One if `char' acts like `signed char', zero if `unsigned char'. */
extern int gdbarch_char_signed (struct gdbarch *gdbarch);