This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: [PATCH RFC] DWARF2 CFI exploitation for Linux on S/390


Gerhard Tonn wrote:
1) The sequence and number of DWARF2 registers are different from the gdb
registers on s390 for some reason.
2) The DWARF2 CFA value is different from the frame_base value.

In order to adapt the code to the first item, I have introduced #defines
for DWARF2 registers and a REGNUM_TO_DWARF2_REG macro and its
implementation. See the attached patch for details.
It makes sense. This wasn't yet noticed because the numbering of most dwarf2 and x86-64 registres is intentionally the same.

The following code fragment in dwarf2cfi.c around line 1316 seems to be
intel specific, at least on s390 it doesn't make sense. Should I move it to
a gdbarch function?

if (i == SP_REGNUM)
     {
        context->reg[i].how = REG_CTX_VALUE;
        context->reg[i].loc.addr = cfa;
      }
Not only Intel specific. Also AMD specific ;-)

Finally I am interested in how signal frame and dummy frame handling is
supposed to work with DWARF2 CFI support. Does anybody have done already
work in this area?
That's the question I'm solving too. The first approach (for x86-64) is here: http://sources.redhat.com/ml/gdb-patches/2002-09/msg00384.html
Basically I don't set_gdbarch_*() directly to cfi_*() functions but instead to corresponding x86_64_*() functions, that eventually call cfi_*() themselves. For sighandler caller frames I'm afraid I'll have to manually fill appropriate structures in struct context (probably in those x86_64_*() functions).

Michal Ludvig
--
* SuSE CR, s.r.o * mludvig@suse.cz
* (+420) 296.545.373 * http://www.suse.cz


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