Bug: setting breakpoints in DLLs/Shared Objects
- kspes
- CodeLite Enthusiast
- Posts: 41
- Joined: Sat Jan 30, 2010 2:18 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Bug: setting breakpoints in DLLs/Shared Objects
I've noticed a small bug in CodeLite (observed in Windows and Linux) and it's quite irritating:
1) set a breakpoint in a cpp file that belongs to a dll or .so of a library the main target is using
2) when launching the app, codelite fails in setting the breakpoint
however, if you break on main(), run the debugger and then set the breakpoint in the dll, everything works fine!
This does not occur with static libs
1) set a breakpoint in a cpp file that belongs to a dll or .so of a library the main target is using
2) when launching the app, codelite fails in setting the breakpoint
however, if you break on main(), run the debugger and then set the breakpoint in the dll, everything works fine!
This does not occur with static libs
- kspes
- CodeLite Enthusiast
- Posts: 41
- Joined: Sat Jan 30, 2010 2:18 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Bug: setting breakpoints in DLLs/Shared Objects
oh, and some more info that might help:
1) using codlelite 2.3 (also occured on 2.2)
2) Windows and Linux
3) stock mingw (4.4.0) and Ubuntu's g++/gdb on Linux
1) using codlelite 2.3 (also occured on 2.2)
2) Windows and Linux
3) stock mingw (4.4.0) and Ubuntu's g++/gdb on Linux
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Bug: setting breakpoints in DLLs/Shared Objects
This is how gdb behaves - you can turn on the debugger log and see it for your self
Note that once codelite fails to set a breakpoint, there is a new button in the 'Debugger' tab with the label "Set Pending" - you can let the debugger continue until your program is loaded and once loaded, hit that button and codelite will re-apply the failed breakpoints.
Another options, is make sure that pending breakpoints option is enabled (settings -> debugger settings )
Eran
Note that once codelite fails to set a breakpoint, there is a new button in the 'Debugger' tab with the label "Set Pending" - you can let the debugger continue until your program is loaded and once loaded, hit that button and codelite will re-apply the failed breakpoints.
Another options, is make sure that pending breakpoints option is enabled (settings -> debugger settings )
Eran
Make sure you have read the HOW TO POST thread
- kspes
- CodeLite Enthusiast
- Posts: 41
- Joined: Sat Jan 30, 2010 2:18 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Bug: setting breakpoints in DLLs/Shared Objects
I have enabled pending breakpoints and the problem still occurs (btw, why would anyone want to turn this feature off?)
here's the debug output on Linux:
here's the debug output on Linux:
and on Windows:DEBUG>>00000004^error,msg="No source file named /home/kreso/projects/brawe/april/rendersystems/OpenGL/RenderSystem_GL.cpp."
Breakpoint creation unsuccessful
ERROR: failed to place breakpoint: "^error,msg="No source file named /home/kreso/projects/brawe/april/rendersystems/OpenGL/RenderSystem_GL.cpp.""
No source file named /home/kreso/projects/brawe/april/rendersystems/OpenGL/RenderSystem_GL.cpp.
once the program is loaded, setting the breakpoint gives this output:DEBUG>>00000537^error,msg="No source file named C:/projects/brawe/april/rendersystems/OpenGL/RenderSystem_GL.cpp."
Breakpoint creation unsuccessful
ERROR: failed to place breakpoint: "^error,msg="No source file named C:/projects/brawe/april/rendersystems/OpenGL/RenderSystem_GL.cpp.""
No source file named C:/projects/brawe/april/rendersystems/OpenGL/RenderSystem_GL.cpp.
[Switching to Thread 1516.0x904]
DEBUG>>*stopped,reason="signal-received",signal-name="SIGTRAP",signal-meaning="Trace/breakpoint trap",frame={addr="0x7c901231",func="ntdll!DbgUiConnectToDbg",args=[],from="C:\\WINDOWS\\system32\\ntdll.dll"},thread-id="2",stopped-threads="all"
Program Received signal SIGTRAP
DEBUG>>00000542-var-create - * "dynamic"
DEBUG>>00000540^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x65241f9b",func="April::GLRenderSystem::loadTexture(std::string, bool)",file="C:/projects/brawe/april/rendersystems/OpenGL/RenderSystem_GL.cpp",fullname="C:/projects/brawe/april/rendersystems/OpenGL/RenderSystem_GL.cpp",line="210",times="0",original-location="\"C:/projects/brawe/april/rendersystems/OpenGL/RenderSystem_GL.cpp:210"}
Found the breakpoint ID!
Storing debugger breakpoint Id=1
Successfully set breakpoint 1 at: C:\projects\brawe\april\rendersystems\OpenGL\RenderSystem_GL.cpp:210
DEBUG>>00000541^running
Continuing...
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Bug: setting breakpoints in DLLs/Shared Objects
Try to modify your breakpoint to function:kspes wrote:once the program is loaded, setting the breakpoint gives this output:
Right click the breakpoint marker, and change it to be 'Function' maybe this will work better
Eran
Make sure you have read the HOW TO POST thread
- kspes
- CodeLite Enthusiast
- Posts: 41
- Joined: Sat Jan 30, 2010 2:18 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Bug: setting breakpoints in DLLs/Shared Objects
I set a breakpoint, right click -> edit: set the function name (tried with and without namespace markers), but the breakpoint just dissapeared and ofcourse, the program didn't break when debugged.
-
- CodeLite Plugin
- Posts: 819
- Joined: Wed Sep 03, 2008 7:26 pm
- Contact:
Re: Bug: setting breakpoints in DLLs/Shared Objects
Hi,
Did you look for the 'Set Pending' button on the Breakpoints tab? This situation is what it was created for. If it doesn't appear, then there is indeed a bug.
Regards,
David
gdb's 'Enable pending breakpoints' just doesn't seem to work on Linuxhere's the debug output on Linux:
Did you look for the 'Set Pending' button on the Breakpoints tab? This situation is what it was created for. If it doesn't appear, then there is indeed a bug.
Regards,
David
- kspes
- CodeLite Enthusiast
- Posts: 41
- Joined: Sat Jan 30, 2010 2:18 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Bug: setting breakpoints in DLLs/Shared Objects
I don't think the pending button is shown. here's a screenshot from my linux box.
IMHO, wouldn't it be better to set all the breakpoints when the program fully launches? eg, break at main, set all the breakpoints , remove main breakpoint and continue?
IMHO, wouldn't it be better to set all the breakpoints when the program fully launches? eg, break at main, set all the breakpoints , remove main breakpoint and continue?
You do not have the required permissions to view the files attached to this post.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Bug: setting breakpoints in DLLs/Shared Objects
The button should appear in the 'Breakpoints' tab (which you are not showing in the screenshot)kspes wrote:I don't think the pending button is shown. here's a screenshot from my linux box.
IMHO, wouldn't it be better to set all the breakpoints when the program fully launches? eg, break at main, set all the breakpoints , remove main breakpoint and continue?
It could be a good idea to place them after main starts - you could open a feature request for this, or send me a patch
Eran
Make sure you have read the HOW TO POST thread
- kspes
- CodeLite Enthusiast
- Posts: 41
- Joined: Sat Jan 30, 2010 2:18 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Bug: setting breakpoints in DLLs/Shared Objects
I've added a feature request: https://sourceforge.net/tracker/?func=d ... tid=979963