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

[Bug gdb/15562] New: record: lowest instr# is 0, not 1


http://sourceware.org/bugzilla/show_bug.cgi?id=15562

            Bug ID: 15562
           Summary: record: lowest instr# is 0, not 1
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: jan.kratochvil at redhat dot com
            Target: x86_64-unknown-linux-gnu

In the sample output below is:
  Lowest recorded instruction number is 1.
but there should be:
  Lowest recorded instruction number is 0.

This patch is looks like working but it is not right:
record_full_info:
   /* Find entry for first actual instruction in the log.  */
-  for (p = record_full_first.next;
+  for (p = &record_full_first;

IMO the static record record_full_first should not exist, all records should be
dynamically allocated with only pointers to them.

This bug is there at least already in gdb-7.2.


(gdb) x/3i $pc
=> 0x48ed37 <main+15>:    lea    -0x20(%rbp),%rax
   0x48ed3b <main+19>:    mov    $0x20,%edx
   0x48ed40 <main+24>:    mov    $0x0,%esi
(gdb) record 
(gdb) stepi
0x000000000048ed3b    29      memset (&args, 0, sizeof args);
(gdb) stepi
0x000000000048ed40    29      memset (&args, 0, sizeof args);
(gdb) info record 
Active record target: record-full
Record mode:
Lowest recorded instruction number is 1.
Highest recorded instruction number is 2.
Log contains 2 instructions.
Max logged instructions is 10000000.
(gdb) record goto 1
Go backward to insn number 1
#0  0x000000000048ed3b in main (argc=1, argv=0x7fffffffdb08) at gdb.c:29
29      memset (&args, 0, sizeof args);
(gdb) x/i $pc
=> 0x48ed3b <main+19>:    mov    $0x20,%edx
(gdb) record goto 0
Go backward to insn number 0
#0  main (argc=1, argv=0x7fffffffdb08) at gdb.c:29
29      memset (&args, 0, sizeof args);
(gdb) x/i $pc
=> 0x48ed37 <main+15>:    lea    -0x20(%rbp),%rax

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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