From: jian shen <vicshen@gmail.com>
To: gdb@sourceware.org
Subject: gdb cannot call help function in replay mode
Date: Tue, 25 Jun 2013 04:11:00 -0000 [thread overview]
Message-ID: <CAC5CAUrgKcRcm_WnJigB5UNrDFqnpQhqmh_b+hUj3t-sz1pqGw@mail.gmail.com> (raw)
In below example, when I try to call function getA1() in replay mode, gdb give
warning that it will write memory and make the execution log unusable, although
this function does not write memory, only read memory. (here, read the global
variable "_a1")
In real project, I have some helper function to dump what a handle is. But in
replay mode, I could not call such functions. This limitation makes the replay
mode almost unusable to me. Any suggestion?
----- a.c -----
1 int _a1;
2 int getA1()
3 {
4 return _a1;
5 }
6
7 int main()
8 {
9 _a1 = 3;
10 _a1 ++;
11 _a1 ++;
12 return 0;
13 }
14
----- a.c end -----
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/jianshen/t1/t1...done.
(gdb) b main
Breakpoint 1 at 0x80483f9: file a.c, line 9.
(gdb) r
Starting program: /home/jianshen/t1/t1
Breakpoint 1, main () at a.c:9
9 _a1 = 3;
(gdb) record
(gdb) n
10 _a1 ++;
(gdb) n
11 _a1 ++;
(gdb) rn
10 _a1 ++;
(gdb) p getA1()
Because GDB is in replay mode, writing to memory will make the
execution log unusable from this point onward. Write memory at
address 0xbffff64f?(y or n) y
$1 = 3
(gdb) rs
10 _a1 ++;
(gdb) rs
10 _a1 ++;
(gdb) rs
10 _a1 ++;
(gdb) rs
10 _a1 ++;
(gdb) rs
getA1 () at a.c:5
5 }
Thanks,
Jian
next reply other threads:[~2013-06-25 4:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 4:11 jian shen [this message]
2013-06-26 18:45 ` Jan Kratochvil
2013-06-27 1:48 ` jian shen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAC5CAUrgKcRcm_WnJigB5UNrDFqnpQhqmh_b+hUj3t-sz1pqGw@mail.gmail.com \
--to=vicshen@gmail.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox