public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/26243] New: Handle line number 0 in line table produced by clang
@ 2020-07-15 13:11 vries at gcc dot gnu.org
  2020-07-15 14:31 ` [Bug symtab/26243] " vries at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: vries at gcc dot gnu.org @ 2020-07-15 13:11 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26243
           Summary: Handle line number 0 in line table produced by clang
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Created attachment 12701
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12701&action=edit
test.cpp

Consider attached test-case test.cpp, compiled like this:
...
$ clang++ --version
clang version 10.0.0 
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ clang++ -g -O0 test.cpp 
...

[ FTR, it executes like this:
...
$ ./a.out
20 23 25 26 28 30 35 60 64 65 68 70 
... ]

The following debug session derails after line 53:
...
$ gdb a.out
Reading symbols from a.out...
(gdb) b inorder
Breakpoint 1 at 0x400c40: file test.cpp, line 44.
(gdb) r
Starting program: a.out 

Breakpoint 1, inorder (root=0x6031f0 <node_array>) at test.cpp:44
44        std::vector<node *> todo;
(gdb) n
45        todo.push_back(root);
(gdb) 
46        while (!todo.empty()){
(gdb) 
47          node *curr = todo.back();
(gdb) 
48          todo.pop_back();
(gdb) 
49          if (curr->visited) {
(gdb) 
52            curr->visited = true;
(gdb) 
53            if (curr->right) { todo.push_back(curr->right); }
(gdb) 
0x0000000000400d1d in inorder (root=0x6031f0 <node_array>)
(gdb) 
Single stepping until exit from function _Z7inorderP4node,
which has no line number information.
main (argc=1, argv=0x7fffffffdce8) at test.cpp:77
77        std::cout <<  "\n";
...

In contrast, with gdb 8.3.1, we have:
...
$ gdb a.out
Reading symbols from a.out...
(gdb) b inorder
Breakpoint 1 at 0x400c40: file test.cpp, line 44.
(gdb) r
Starting program: a.out 

Breakpoint 1, inorder (root=0x6031f0 <node_array>) at test.cpp:44
44        std::vector<node *> todo;
(gdb) n
45        todo.push_back(root);
(gdb) 
46        while (!todo.empty()){
(gdb) 
47          node *curr = todo.back();
(gdb) 
48          todo.pop_back();
(gdb) 
49          if (curr->visited) {
(gdb) 
52            curr->visited = true;
(gdb) 
53            if (curr->right) { todo.push_back(curr->right); }
(gdb) 
54            todo.push_back(curr);
(gdb) 
55            if (curr->left) { todo.push_back(curr->left); }
(gdb) 
46        while (!todo.empty()){
(gdb) 
47          node *curr = todo.back();
...

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-09-03  5:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15 13:11 [Bug symtab/26243] New: Handle line number 0 in line table produced by clang vries at gcc dot gnu.org
2020-07-15 14:31 ` [Bug symtab/26243] " vries at gcc dot gnu.org
2020-07-15 14:36 ` vries at gcc dot gnu.org
2020-07-15 15:09 ` vries at gcc dot gnu.org
2020-07-15 15:20 ` andrew.burgess at embecosm dot com
2020-07-15 15:47 ` vries at gcc dot gnu.org
2020-07-15 22:05 ` vries at gcc dot gnu.org
2020-07-16 17:59 ` vries at gcc dot gnu.org
2020-07-16 19:18 ` simark at simark dot ca
2020-07-16 20:46 ` palves at redhat dot com
2020-07-16 20:51 ` palves at redhat dot com
2020-07-16 21:18 ` palves at redhat dot com
2020-07-16 22:22 ` palves at redhat dot com
2020-07-17 15:00 ` vries at gcc dot gnu.org
2020-07-20 13:00 ` andrew.burgess at embecosm dot com
2020-07-20 13:15 ` palves at redhat dot com
2020-07-24 22:23 ` cvs-commit at gcc dot gnu.org
2020-07-24 22:33 ` vries at gcc dot gnu.org
2020-09-03  5:19 ` jaydeepchauhan1494 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).