#320 gdb: strange backtrace

open
nobody
None
5
2012-09-26
2012-09-26
Rion
No

example:

test.cpp
#include <iostream>

using namespace std;

void b()
{
cout << "b\n"; // line 7
}

void a()
{
cout << "a\n";
b();
}

int main()
{
a();
return 0;
}

[D:\projects]g++ -g -O0 test.cpp

[D:\projects]gdb a.exe
GNU gdb (rubenvb-4.7.2-release) 7.5.50.20120920-cvs
Copyright (C) 2012 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 "i686-w64-mingw32".
For bug reporting instructions, please see:
<mingw-w64-public@lists.sourceforge.net>...
Reading symbols from D:\projects\a.exe...done.
(gdb) break test.cpp:7
Breakpoint 1 at 0x401948: file test.cpp, line 7.
(gdb) start
Temporary breakpoint 2 at 0x40198a: file test.cpp, line 18.
Starting program: D:\projects\a.exe
[New Thread 124.0x188]

Temporary breakpoint 2, main () at test.cpp:18
18 a();
(gdb) continue
Continuing.
a

Breakpoint 1, b () at test.cpp:7
7 cout << "b\n";
(gdb) bt
#0 b () at test.cpp:7
#1 0x0040197d in _fu1___ZSt4cout () at test.cpp:13
#2 0x0040198f in main () at test.cpp:18
(gdb)

so what is _fu1___ZSt4cout? yes its function 'a'. but why so strange name?
no such problem on linux and I guess with old mingw everything is fine too.

moreover sometimes there is no backtrace at all when it should be.
usually in more complex programs.
but gdb still works (stops on breakpoints and able to step by step debug)
example:
Breakpoint 2, SkyDNS::Private::BackendImpl::adaptersChanged (this=0x43fa070)
at ..\..\skydns-agent\service\core\private\backend_winndis.cpp:57
57 adaptersCache.clear();
(gdb) bt
#0 SkyDNS::Private::BackendImpl::adaptersChanged (
this=0x43fa070)
at ..\..\skydns-agent\service\core\private\backend_winndis.cpp:57
#1 0x0000000000000000 in ?? ()
(gdb)

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks