Operating System - HP-UX
1753697 Members
5026 Online
108799 Solutions
New Discussion юеВ

Breakpoint deferred and never reached in debugger

 
SOLVED
Go to solution
Adarsh Thampan
Advisor

Breakpoint deferred and never reached in debugger

Hi ,

I am trying to set up a breakpoint in one of the source files . When I set the breakpoint it says "Breakpoint deferred until a shared library containing ":646" is loaded.

When i try and run the program the breakpoint is never reached in the debugger.

So i tried using printf and I put a printf statement in the same file at the same line number and re-compiled the binaries . Now I can see the printf statements being displayed on the console, but the breakpoint is still never achieved by the debugger.

Please advise.

Thanks,
Adarsh.
12 REPLIES 12
Dennis Handly
Acclaimed Contributor

Re: Breakpoint deferred and never reached in debugger

I suggest you set breakpoints on the function when when hit, set it on the line.
Or use absolute addresses "b * address".
Dennis Handly
Acclaimed Contributor

Re: Breakpoint deferred and never reached in debugger

You can also ask your wdb questions here: wdb-help@cup.hp.com
nitinjain
Occasional Advisor
Solution

Re: Breakpoint deferred and never reached in debugger

Adarsh,
As per my understanding it is a shared library code where you are trying to put the breakpoint . This library loads and executes but the breakpoint stays deferred and so is not hit.
Let me know if I am wrong somewhere.

As Dennis suggested you can try different ways of putting the breakpoint. Try list command to display the these source lines during the debugger session.
Try setting catch point "catch load " at the starting of the session so as to know when that particular library is getting loaded. Once this catch point is hit gdb will stop and you can try and put your breakpoint now it should no more be deferred.
If nothing works send us the session o/p with all the details and if possible a test-case so that we can reproduce it at our end. Send us at wdb-help@cup.hp.com
Adarsh Thampan
Advisor

Re: Breakpoint deferred and never reached in debugger

I think I know the problem now , when i load the exe in the debugger , there seesm to be a fork happening and maybe the file that I want to debug is getting loaded in the other process .

Anyways to debug multiprocessed applications.


Thanks,
Adarsh.
Dennis Handly
Acclaimed Contributor

Re: Breakpoint deferred and never reached in debugger

>there seems to be a fork happening

You can try the "set follow-fork-mode" option.
nitinjain
Occasional Advisor

Re: Breakpoint deferred and never reached in debugger

WDB can debug only one process at a time either child or parent. So "set follow-fork-mode" as suggested by Dennis is to set the behavior of WDB after the application forks a new process.
Adarsh Thampan
Advisor

Re: Breakpoint deferred and never reached in debugger

Also Can it be a problem with my .gdbinit file. How can I verify this ? where can i find this gdbinit file?
Dennis Handly
Acclaimed Contributor

Re: Breakpoint deferred and never reached in debugger

>Can it be a problem with my .gdbinit file?

Which? The fork or the not hitting the breakpoint?

>where can I find this .gdbinit file?

In the current directory or in ~/.gdbinit.
Adarsh Thampan
Advisor

Re: Breakpoint deferred and never reached in debugger

I could not find it in the home or current directory. Does it get created by default or do I have to create one explicitly ?