This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Deal with get ecs->stop_func_end fail
- From: Michael Snyder <msnyder at vmware dot com>
- To: teawater <teawater at gmail dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 23 Oct 2008 18:18:23 -0700
- Subject: Re: [RFA] Deal with get ecs->stop_func_end fail
- References: <daef60380810200216x35852677ybd8ba0167e038dfd@mail.gmail.com>
teawater wrote:
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.
Aha. This is because we have stepped backward into
a shared-library trampoline. You understand trampoline?
It means that this was the first time the program calls
"printf", which is in a shared library, so the program
jumps into a jump table which causes the dymanic runtime
resolver (ld-linux.so) to be called.
We actually succeeded in "nexting" backward through printf,
and then we succeeded in "nexting" backward thru _dl_runtime_resolver,
but we failed when we hit the trampoline (backward).
Give me some time, I need to figure out how to handle
trampolines backward! ;-)
Meanwhile, this is obviously a problem in infrun, so
it does not need to affect your work on record/replay.
Leave this to me. ;-)