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: [RFA/testsuite] check bt problem after 2 steps is gone


> > 2006-04-28  Joel Brobecker  <brobecker@adacore.com>
> > 
> >         * gdb.base/step-bt.c: New file.
> >         * gdb.base/step-bt.exp: New testcase.
> > 
> > Tested on i686-pc-cygwin. on XFAIL on the last test with the current
> > sources, all PASSes once the patch in the message mentioned above is
> > applied.
> > 
> > OK to apply?
> 
> When the patch goes in, this is fine.  Thanks for the test.

Ok, will do.


> > gdb_test "stepi 2" \
> >          "" \
> >          "step 2 instructions"
> > 
> > gdb_test "bt" \
> >          "#0 +0x\[0-9a-z\]+ in hello .*#1 +0x\[0-9a-z\]* in main.*" \
> >          "backtrace after two instruction steps"
> 
> Would it work to test backtrace after each of two stepi's?  That might
> turn up interesting similar problems on more platforms.
> 

Yes it would. The semi-tricky part is to determine the number of stepi's
we can do before we end up inside printf, regardless of the architecture.
On sparc, for instance, seting up the frame can be done in one
instruction, thanks to the register rotation during calls.

I actually tried it on sparc-solaris, and indeed, the call to printf
is located at the 4th instruction.

My guess is that we should be able to add an extra "stepi 2; bt"
and that should work for all other architectures.

Another more refined approach would be to conditionalize the extra
stepis to the architecture. 

-- 
Joel


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