[RFA] Deal with get ecs->stop_func_end fail
teawater
teawater@gmail.com
Mon Oct 20 09:17:00 GMT 2008
Hi Michael,
I try a program and got:
(gdb) start
Temporary breakpoint 1 at 0x80483c1: file 1.c, line 20.
Starting program: /media/disk/a.out
Temporary breakpoint 1, main () at 1.c:20
20 int b = 0;
(gdb) rec
(gdb) n
21 int c = 1;
(gdb)
24 printf ("a = %d b = %d c = %d\n", a, b, c);
(gdb)
a = 0 b = 0 c = 1
25 b = cool ();
(gdb) rn
No more reverse-execution history.
main () at 1.c:20
20 int b = 0;
It's clear that "rn" got error.
This is because:
find_pc_partial_function (stop_pc, &ecs->stop_func_name,
&ecs->stop_func_start, &ecs->stop_func_end);
This part get ecs->stop_func_end is 0.
Then:
sr_sal.pc = ecs->stop_func_start;
insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id);
Insert breakpoint to 0 address and continue execute. So...
So I add some code deal with it. Maybe you remember, I send some
patch for it in before.
But I got random_signal, cause I let this part step.
So I add other code deal with that.
2008-10-20 Hui Zhu <teawater@gmail.com>
Deal with get ecs->stop_func_end fail.
* infrun.c (reverse_need_step): New variable. Set to 1 if next
reverse execute need step.
(handle_inferior_event): Save the prev value of
reverse_need_step to reverse_need_step_prev.
If reverse_need_step_prev is 1 and stop_signal is
TARGET_SIGNAL_TRAP, not set this is not random_signal.
If find_pc_partial_function get ecs->stop_func_name and
ecs->stop_func_end are 0 and this is reverse execute, set
reverse_need_step to 1.
(currently_stepping): Return 1 if reverse_need_step is 1.
(insert_step_resume_breakpoint_at_sal): If reverse_need_step
is 1 and sr_sal.pc is 0, not insert breakpoint.
(stop_stepping): Reset reverse_need_step to 1 when this
execute command complete.
This patch is both for branch and main tree.
Thanks,
Hui
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: deal_stop_func_end_zero.txt
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20081020/b1a97394/attachment.txt>
More information about the Gdb-patches
mailing list