Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tea <teawater@gmail.com>
To: gdb-patches@sourceware.org
Subject: GDB record patch 0.1.1 for GDB-6.6 release (It make I386 and MIPS GDB support Reversible Debugging)
Date: Thu, 22 Nov 2007 09:13:00 -0000	[thread overview]
Message-ID: <daef60380711220113p4c8de466j1beff41472932786@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3617 bytes --]

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 #2: gdb-6.6-record-0.1.1.patch.bz2 --]
[-- Type: application/x-bzip2, Size: 12283 bytes --]

             reply	other threads:[~2007-11-22  9:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-22  9:13 Tea [this message]
2007-11-26 19:24 ` Michael Snyder

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=daef60380711220113p4c8de466j1beff41472932786@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=gdb-patches@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