diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2010-08-06 19:02:15 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2010-08-06 19:02:15 +0000 |
commit | 8da614df6415a7aa01ba8ebf74acef32183266c4 (patch) | |
tree | 6c5f8af1dba8a1c5ff38c566d6bbc5e9aa80a260 /gdb/gdbarch.h | |
parent | 2210942396dab942a86cb6777c705554b84ebb0e (diff) | |
download | gdb-8da614df6415a7aa01ba8ebf74acef32183266c4.zip gdb-8da614df6415a7aa01ba8ebf74acef32183266c4.tar.gz gdb-8da614df6415a7aa01ba8ebf74acef32183266c4.tar.bz2 |
* 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.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index d2b0e5a..f6c7ce8 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); |