[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] debugger virker ikke, meget simpelt program



Jeg havde ingen problemer med at debugge fra gdb:

robert-desktop:~/code/test $ gdb ./test
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) list main
18      return (m_a==b.m_a);
19    }
20   
21    Test a,b;
22   
23    int main(int argc, char *argv[])
24    {
25      ifstream i;
26      cout << "Hello, world!" << endl;
27      cout << "Next line" << endl;
(gdb) break 25
Breakpoint 1 at 0x8048956: file test.cpp, line 25.
(gdb) run
Starting program: /var/code/test/test

Breakpoint 1, main (argc=1, argv=0xbffc3cf4) at test.cpp:25
25      ifstream i;
(gdb) next
26      cout << "Hello, world!" << endl;
(gdb) next
Hello, world!
27      cout << "Next line" << endl;
(gdb) next
Next line
28      assert(a==b);
(gdb) next
29      return 0;
(gdb) next
30    }
(gdb) cont
Continuing.

Program exited normally.
(gdb) quit
robert-desktop:~/code/test $


Prøv at compile med '-ggdb':
robert-desktop:~/code/test $ g++ -o test -ggdb test.cpp


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2009-02-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *