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

Re: Support Dwarf3 DW_CFA_val_* expressions


On Sat, Mar 04, 2006 at 09:01:43AM -0300, Alexandre Oliva wrote:
> > It's also good to have a few testcases,
> > but I don't completely understand the testcases :(
> 
> You're not alone in that feeling, I assure you :-)

Like Mark, I am happier with the code than the testcases.  In fact,
I'd rather not have the tests at all than have something quite
so overkill.  And you're not correct that older GCCs could run them
far enough to test; they'll fail to build because of the use of
__attribute__((cleanup)) (and the fact that dejagnu treats warnings
as fatal).

You ought to be able to test this much more simply, if you wire it
up to the bits in gdb.asm.  I'm thinking something like this:

gdbasm_declare foo
gdbasm_enter
gdbasm_call bar
.cfi_startproc
.cfi_return_column 0
.cfi_undefined 0
gdbasm_leave
.cfi_endproc
gdbasm_end foo

You ought to be able to backtrace from the call statement, without
unwind info, and you ought to be unable to backtrace from the epilogue,
where the dwarf2 unwinder will kick in and say you've hit the end of
the stack.  Whether bar has a signal augmentation or not will determine
whether you can backtrace from it to foo's caller or not.

Unfortunately if you want to put the signal augmentation on bar you'll
also need unwind info for it; I guess that would require an addition
to the gdb.asm bits.  Then, just refuse to test if the testcase doesn't
assemble.

I'm sure it won't work for some platforms, and we'll have to add some
skips in the .exp file, but it ought to get enough of the current
ELF/dwarf platforms to be interesting, don't you think?

-- 
Daniel Jacobowitz
CodeSourcery


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