[commit] [PATCH 4/6] infcall: stop_registers -> register_dummy_frame_dtor
Jan Kratochvil
jan.kratochvil@redhat.com
Wed May 13 18:54:00 GMT 2015
On Wed, 13 May 2015 15:28:40 +0200, Pedro Alves wrote:
> On 05/08/2015 09:21 PM, Jan Kratochvil wrote:
> > I am not completely sure what is right for bpfinishpy_pre_stop_hook but the
> > testsuite passes. I can think more about it if it gets otherwise approved.
>
> Yeah, if the Python API around that gives access the return value,
> then something needs to be done there, otherwise, probably nothing else
> is needed.
It does not, see bottom of the mail, so I have just put there:
/* bpfinishpy_init cannot finish into DUMMY_FRAME (throws an error
in such case) so it is OK to always pass CTX_SAVER as NULL. */
struct value *ret = get_return_value (function, value_type, NULL);
> > +/* Destructor for associated dummy_frame. */
> > +
> > +static dummy_frame_dtor_ftype call_function_by_hand_dtor;
>
> This forward declaration is not really necessary, right?
> A wrong prototype mismismatch would be caught here:
Yes, it would. I think it could be there but I have removed it.
> How about we rename things,
I have renamed it by your patch, I agree the new naming is better.
Checked in:
8a6c40311297f60ad13827650fdde13da301b505
Thanks,
Jan
------------------------------------------------------------------------------
(gdb) l
1 long f(void) { return 1234567890123456789; }
2 int main(void) { return 0; }
(gdb) start
(gdb) b f
Breakpoint 2 at 0x4004fa: file 1.c, line 1.
(gdb) bt
#0 main () at 1.c:2
(gdb) p f()
Breakpoint 2, f () at 1.c:1
1 long f(void) { return 1234567890123456789; }
The program being debugged stopped while in a function called from GDB.
Evaluation of the expression containing the function
(f) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb) bt
#0 f () at 1.c:1
#1 <function called from gdb>
#2 main () at 1.c:2
(gdb) fini
Run till exit from #0 f () at 1.c:1
Value returned is $1 = 1234567890123456789
(gdb) bt
#0 main () at 1.c:2
(gdb) p f()
Breakpoint 2, f () at 1.c:1
1 long f(void) { return 1234567890123456789; }
The program being debugged stopped while in a function called from GDB.
Evaluation of the expression containing the function
(f) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb) bt
#0 f () at 1.c:1
#1 <function called from gdb>
#2 main () at 1.c:2
(gdb) python gdb.FinishBreakpoint()
Traceback (most recent call last):
File "<string>", line 1, in <module>
ValueError: "FinishBreakpoint" cannot be set on a dummy frame.
Error while executing Python code.
(gdb) _
More information about the Gdb-patches
mailing list