This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/1642: mandrake 10.0, gcc-3.4.0, c++, breakpoint problem
- From: dmsk at pobox dot sk
- To: gdb-gnats at sources dot redhat dot com
- Date: 12 May 2004 07:45:27 -0000
- Subject: gdb/1642: mandrake 10.0, gcc-3.4.0, c++, breakpoint problem
- Reply-to: dmsk at pobox dot sk
>Number: 1642
>Category: gdb
>Synopsis: mandrake 10.0, gcc-3.4.0, c++, breakpoint problem
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Wed May 12 07:48:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Dusan Zatkovsky
>Release: GNU gdb 6.1
>Organization:
>Environment:
Linux localhost 2.6.3-7mdk #1 Wed Mar 17 15:56:42 CET 2004 i686 unknown unknown GNU/Linux
gcc version 3.4.0 (Mandrake Linux 10.0 3.4.0-0.4mdk)
gcc version 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".
>Description:
I have problem setting breakpoints at code compiled by gcc3, but gcc-2.96 works.
Problem is, that kdevelop3, which I am using, sets breakpoint by my opinion as 'file.cpp:line' (but I am not sure) and it doesn't work. Next problem is, that I can't set breakpoint to some line in constructor and it may be distress.
With code compiled with gcc-2.96 it works fine.
How to solve this problem?
>How-To-Repeat:
cat file.cpp
#include <iostream>
using namespace std;
class C {
public:
C();
~C();
};
C::C() { /*line 10*/
cout << "constructor\n"; /*line 11*/
}
C::~ C() {
cout << "destructor\n";
}
int main() { /*line 18*/
C c;
return 0;
}
//compile
gcc-3.4.0 -O0 -g3 -lstdc++ file.cpp
//run gdb
gdb a.out
//set breakpoint to line 10 in file.cpp
(gdb) break file.cpp:10
Breakpoint 1 at 0x8048e90: file file.cpp, line 10.
//start
(gdb) run
Starting program: /home/msk/tmp/gdb/a.out
// DOESN'T STOP !!
constructor
destructor
Program exited normally.
quit
//but this works fine:
//run again
gdb a.out
//set breakpoint to constructor by name, NOT line number
(gdb) break C::C()
Breakpoint 1 at 0x8048eb4: file file.cpp, line 10.
//start
(gdb) run
Starting program: /home/msk/tmp/gdb/a.out
//stops OK
Breakpoint 1, C (this=0xbffff5d0) at file.cpp:11
11 cout << "constructor\n";
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: