Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gdb cannot call help function in replay mode
@ 2013-06-25  4:11 jian shen
  2013-06-26 18:45 ` Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: jian shen @ 2013-06-25  4:11 UTC (permalink / raw)
  To: gdb

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-27  1:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-25  4:11 gdb cannot call help function in replay mode jian shen
2013-06-26 18:45 ` Jan Kratochvil
2013-06-27  1:48   ` jian shen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox