This is the mail archive of the gdb@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]

GDB record patch 0.1.1 for GDB-6.6 release (It make I386 and MIPS GDB support Reversible Debugging)


Hi everybody,

GDB record patch disassemble the instruction that will be executed to
get which memory and register will be changed and record them to
record all the program running message.
The main change of this version record patch is support the I386
instructions(System call, floating-point instructions and SSE
instructions are still not support).
The work of next stage is make GDB record patch support I386-Linux system call.
Please give me your thought about the "record" and help me test it.
Thanks a lot.
BTW, I am sorry I compress the patch because it is too big to send to
the maillist.

To make and install the GDB record patch 0.1.1 with GDB-6.6:
tar vxjf gdb-6.6.tar.bz2
bunzip2 gdb-6.6-record-0.1.1.patch.bz2
patch -p0 < gdb-6.6-record-0.1.1.patch
mkdir bgdb
cd bgdb
../gdb-6.6/configure
make
make install

The following is how to use the record:
cat 1.c
int     a = 0;
int
cool ()
{
        a += 3;

        return (a);
}
int
main()
{
        int     b = 0;
        int     c = 1;

        b = cool ();

        c += 1;
        a -= 2;

        return (0);
}
gcc -g 1.c
gdb a.out
GNU gdb 6.6
Record 0.1.1
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Using host libthread_db library "/lib/tls/libthread_db.so.1".
Setting up the environment for debugging gdb.
Function "internal_error" not defined.
Make breakpoint pending on future shared library load? (y or [n])
[answered N; input not from terminal]
Function "info_command" not defined.
Make breakpoint pending on future shared library load? (y or [n])
[answered N; input not from terminal]
/home/xxx/rec/bgdb/gdb/.gdbinit:8: Error in sourced command file:
No breakpoint number 0.
(gdb) b main
Breakpoint 1 at 0x8048331: file 1.c, line 12.
(gdb) r
Starting program: /home/xxx/rec/bgdb/gdb/a.out

Breakpoint 1, main () at 1.c:12
12              int     b = 0;
(gdb) p a
$1 = 0
(gdb) p b
During symbol reading, incomplete CFI data; unspecified registers
(e.g., eax) at 0x8048324.
$2 = 134513500
(gdb) p c
$3 = 7610400
(gdb) rec
record: record and reverse function is started.
(gdb) n
13              int     c = 1;
(gdb)
15              b = cool ();
(gdb)
17              c += 1;
(gdb) p a
$4 = 3
(gdb) p b
$5 = 3
(gdb) p c
$6 = 1
(gdb) n
18              a -= 2;
(gdb)
20              return (0);
(gdb) p a
$7 = 1
(gdb) p b
$8 = 3
(gdb) p c
$9 = 2
(gdb) rev
record: GDB is set to reverse debug mode.
(gdb) s
18              a -= 2;
(gdb)
0x0804834a      17              c += 1;
(gdb) p a
$10 = 3
(gdb) p b
$11 = 3
(gdb) p c
$12 = 1
(gdb) s
0x08048344      15              b = cool ();
(gdb) s
cool () at 1.c:5
5               a += 3;
(gdb) p a
$13 = 0
(gdb) s
0x08048311      4       {
(gdb)
main () at 1.c:15
15              b = cool ();
(gdb)
13              int     c = 1;
(gdb) p a
$14 = 0
(gdb) p b
$15 = 0
(gdb) p c
$16 = 7610400
(gdb) rev
record: GDB is set to normal debug mode.
(gdb) n
15              b = cool ();
(gdb)
17              c += 1;
(gdb) n
18              a -= 2;
(gdb) p a
$4 = 3
(gdb) p b
$5 = 3
(gdb) p c
$6 = 2
(gdb) quit
The program is running.  Exit anyway? (y or n) y
record: record and reverse function is stopped.
You can find out the change of the values of "a", "b" and "c" when the
GDB normal debug and reverse debug.

Thanks,
teawater


Signed-Off-By: Teawater Zhu <teawater@gmail.com>

Attachment: gdb-6.6-record-0.1.1.patch.bz2
Description: BZip2 compressed data


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