This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix problems with finishing a dummy function call on simulators.
- From: Luis Machado <lgustavo at codesourcery dot com>
- To: Pedro Alves <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Mon, 6 Jul 2015 13:18:14 -0300
- Subject: Re: [PATCH] Fix problems with finishing a dummy function call on simulators.
- Authentication-results: sourceware.org; auth=none
- References: <1433862056-18237-1-git-send-email-lgustavo at codesourcery dot com> <55772797 dot 802 at redhat dot com> <55805F52 dot 20805 at codesourcery dot com> <55816AD5 dot 6020605 at redhat dot com> <55817569 dot 7060704 at codesourcery dot com> <5581798B dot 5080207 at redhat dot com> <5581D5A9 dot 3070706 at codesourcery dot com> <559A998E dot 6010500 at redhat dot com> <559A9FCE dot 5070908 at codesourcery dot com> <559AA992 dot 2020004 at redhat dot com>
- Reply-to: Luis Machado <lgustavo at codesourcery dot com>
On 07/06/2015 01:15 PM, Pedro Alves wrote:
On 07/06/2015 04:33 PM, Luis Machado wrote:
I'll take a look at it. I suppose this will block the branching?
I think so, or at least the release. Broken infcalls seems
pretty nasty.
Indeed.
Then again, simply reverting this will still have bad results with some
simulators.
True. Might be the fix is simple though. I'm seeing this:
(gdb) PASS: gdb.base/shlib-call.exp: step out of shr2 to main (stopped in shr2 epilogue)
step
main () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.base/shmain.c:37
37 g = mainshr1(g);
(gdb) PASS: gdb.base/shlib-call.exp: step out of shr2 epilogue to main
print mainshr1(1)
Program received signal SIGSEGV, Segmentation fault.
mainshr1 (g=1) at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.base/shmain.c:29
29 }
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on".
Evaluation of the expression containing the function
(mainshr1) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb) FAIL: gdb.base/shlib-call.exp: print mainshr1(1)
step
That's what i see too.
The SIGSEGV look scary until one remembers that the dummy breakpoints
are placed on the stack, which is non-executable. gdb translates those
SIGSEGVs back to SIGTRAPs, provided it knows there's a breakpoint at that
address.
Looking a bit at breakpoint.c, I notice that a few ->permanent
checks seem to have been left behind, and as result we don't actually
remove from the target the breakpoints that were placed on top of the
permanent breakpoints?
This seems to fix the FAILs here, but I didn't run full regression
testing. Could you take this, test it on qemu, and and finish it off?
Yes, of course. Thanks for having a go at it.
Luis