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]

[RFA] Deal with get ecs->stop_func_end fail


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

Attachment: deal_stop_func_end_zero.txt
Description: Text document


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