This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug breakpoints/21358] New: Can't list or set breakpoints in current source file if it is a symlink
- From: "jwakely.gcc at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Fri, 07 Apr 2017 10:07:52 +0000
- Subject: [Bug breakpoints/21358] New: Can't list or set breakpoints in current source file if it is a symlink
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=21358
Bug ID: 21358
Summary: Can't list or set breakpoints in current source file
if it is a symlink
Product: gdb
Version: 7.11.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: breakpoints
Assignee: unassigned at sourceware dot org
Reporter: jwakely.gcc at gmail dot com
Target Milestone: ---
~$ cd /tmp
tmp$ cat > test.cc
#include <stdio.h>
void f()
{
puts("printy printy printy");
}
int main()
{
f();
}
tmp$ ln -s test.cc link.cc
tmp$ g++ -g link.cc
tmp$ /home/jwakely/gcc/gdb/7.12.1/bin/gdb -nx -ex start -ex "br 5" a.out
GNU gdb (GDB) 7.12.1
Copyright (C) 2017 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 "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...done.
Temporary breakpoint 1 at 0x4005fb: file link.cc, line 10.
Starting program: /tmp/a.out
Temporary breakpoint 1, main () at link.cc:10
10 f();
No line 5 in the current file.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) br 5
No line 5 in the current file.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) step
f () at link.cc:5
5 puts("printy printy printy");
(gdb) bt
#0 f () at link.cc:5
#1 0x0000000000400600 in main () at link.cc:10
(gdb) br
Breakpoint 2 at 0x4005ea: file link.cc, line 5.
(gdb) l 5
No line 5 in the current file.
(gdb) l link.cc:5
1 #include <stdio.h>
2
3 void f()
4 {
5 puts("printy printy printy");
6 }
7
8 int main()
9 {
10 f();
(gdb) l test.cc:5
No source file named test.cc.
(gdb)
The backtrace shows the "correct" filename (i.e. the symlink) and setting a
breakpoint on the current line shows "file link.cc, line 5", and setting a
breakpoint at "link.cc:5" works. But "br 5" and "list 5" don't.
(gdb) maint info line-table
objfile: /tmp/a.out ((struct objfile *) 0x2606bb0)
compunit_symtab: ((struct compunit_symtab *) 0x2611c40)
symtab: /tmp/test.cc ((struct symtab *) 0x2611cc0)
linetable: ((struct linetable *) 0x265f140):
INDEX LINE ADDRESS
0 4 0x00000000004005e6
1 5 0x00000000004005ea
2 6 0x00000000004005f4
3 9 0x00000000004005f7
4 10 0x00000000004005fb
5 11 0x0000000000400600
6 0 0x0000000000400607
objfile: /tmp/a.out ((struct objfile *) 0x2606bb0)
compunit_symtab: ((struct compunit_symtab *) 0x2611c40)
symtab: /usr/lib/gcc/x86_64-redhat-linux/6.3.1/include/stddef.h ((struct symtab
*) 0x2611d00)
linetable: ((struct linetable *) 0x0):
No line table.
objfile: /tmp/a.out ((struct objfile *) 0x2606bb0)
compunit_symtab: ((struct compunit_symtab *) 0x2611c40)
symtab: /usr/include/bits/types.h ((struct symtab *) 0x2611d40)
linetable: ((struct linetable *) 0x0):
No line table.
objfile: /tmp/a.out ((struct objfile *) 0x2606bb0)
compunit_symtab: ((struct compunit_symtab *) 0x2611c40)
symtab: /usr/include/libio.h ((struct symtab *) 0x2611d80)
linetable: ((struct linetable *) 0x0):
No line table.
objfile: /tmp/a.out ((struct objfile *) 0x2606bb0)
compunit_symtab: ((struct compunit_symtab *) 0x2611c40)
symtab: /usr/include/stdio.h ((struct symtab *) 0x2611dc0)
linetable: ((struct linetable *) 0x0):
No line table.
objfile: /tmp/a.out ((struct objfile *) 0x2606bb0)
compunit_symtab: ((struct compunit_symtab *) 0x2611c40)
symtab: /usr/include/bits/sys_errlist.h ((struct symtab *) 0x2611e00)
linetable: ((struct linetable *) 0x0):
No line table.
--
You are receiving this mail because:
You are on the CC list for the bug.