This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Changes required for x86 address spaces


Hi!

Here are some notes regarding gdb changes required in order to support

  https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01972.html

In my opinion, DW_AT_address_class is best when the alternate address space is truely disjoint, or has a different pointer width. That certainly matches up with the language in the dwarf4 doc, and existing usage in the embedded targets.

Thus I've arranged for these x86 address spaces to use DW_AT_segment, a dwarf location containing an offset from the flat address space. For the purposes of the debug info, I map __seg_tls to __seg_fs or __seg_gs.

The x86-64 abi already has dwarf register numbers allocated for fs_base and gs_base. Thus the location is simply the trivial DW_OP_regx 58 or 59 respectively. The i386 abi does not yet have the same register number pre-allocated; the latest version I see in HJL's github document has dwarf registers 58-59 within a block of reserved values, so for now I'm using the same values for both x86-64 and i386.

One of these days, the various operating systems may enable the fsgsbase ISA extension present in Haswell cpus, so making these values visible within the debugger now is a nice side effect.

What isn't present in gdb at present is any support for DW_AT_segment, and I'm not familiar enough with the internals to work out how to enable that.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]