[Bug tui/25126] New: GDB uses the staled (cached?) source file

hjl.tools at gmail dot com sourceware-bugzilla@sourceware.org
Tue Oct 22 23:16:00 GMT 2019


https://sourceware.org/bugzilla/show_bug.cgi?id=25126

            Bug ID: 25126
           Summary: GDB uses the staled (cached?) source file
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tui
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

I started with

---
#include <stdio.h>

void
foo (void)
{
  printf ("hello\n");
}

int
main ()
{
  foo (); 
  return 0;
}
~              
---

I compiled it with -g and set break point at line 6.  I got

(gdb) r
Starting program:
/export/build/gnu/tools-build/gdb/build-x86_64-linux/gdb/a.out 
Missing separate debuginfos, use: dnf debuginfo-install
glibc-2.29-23.0.fc30.x86_64

Breakpoint 1, foo () at /tmp/foo.c:6
6         printf ("hello\n");
(gdb)

Then I added a line:

---
#include <stdio.h>

void
foo (void)
{
  printf ("foo\n");
  printf ("hello\n");
}

int
main ()
{
  foo ();
  return 0;
}
---

I recompiled and restarted gdb.  I got

(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
`/export/build/gnu/tools-build/gdb/build-x86_64-linux/gdb/a.out' has changed;
re-reading symbols.
Starting program:
/export/build/gnu/tools-build/gdb/build-x86_64-linux/gdb/a.out 
Missing separate debuginfos, use: dnf debuginfo-install
glibc-2.29-23.0.fc30.x86_64

Breakpoint 1, foo () at /tmp/foo.c:6
6         printf ("hello\n");
(gdb) list
1       #include <stdio.h>
2       
3       void
4       foo (void)
5       {
6         printf ("hello\n");
7       }
8       
9       int
10      main ()
(gdb)  

Somehow gdb displayed the staled source.

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


More information about the Gdb-prs mailing list