[Haifux] Multi-thread debugging for C++ on Linux

Yotam Medini יותם מדיני yotam.medini at gmail.com
Sat Nov 29 12:45:21 MSK 2008


where 1

for example:

yotam at durini:C:1075> cat hell.cc; g++ -g -o hell hell.cc
#include <iostream>
int main(int, char**) {
   std::cout << "hell" << std::endl;
   return 0;
}
yotam at durini:C:1076> gdb hell
GNU gdb 6.8-debian
Copyright (C) 2008 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 "i486-linux-gnu"...
(gdb) where 1
No stack.
(gdb) break main
Breakpoint 1 at 0x80486c5: file hell.cc, line 3.
(gdb) run
Starting program: /home/yotam/C/hell 

Breakpoint 1, main () at hell.cc:3
3	   std::cout << "hell" << std::endl;
(gdb) where 1
#0  main () at hell.cc:3
(gdb) 


-- yotam


On Sat, 29 Nov 2008 11:29:07 +0200
"Ohad Lutzky" <ohad at lutzky.net> wrote:

> I thought tracking source code was gdb's job... (Hitting l? And does
> anyone know, off the top of their heads, how to get it to show the
> current line number and file?)



More information about the Haifux mailing list