<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
While experimenting with my new lldb plugin, I placed a breakpoint inside a shared object (using file:line / name ) which is loaded via 'dlopen'</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
<br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">My stratey so far for breakpoints was:</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br>
</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">- Create debugger</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">- Create the target</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
- Launch target with the flag 'lldb::eLaunchFlagStopAtEntry' </div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">- When stopped on first entry, all breakpoints are being applied using m_target.BreakpointCreateByName / BreakpointCreateByLocation</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">- The plugin then queries lldb to get a complete list of breakpoints andupdate the UI (some breakpoint are resolved to multiple locations, moved if they were placed on a comment etc) like this:</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style><font face="courier new, monospace">int num = m_target.GetNumBreakpoints();<br></font></div><div class="gmail_default" style>
<div class="gmail_default"><font face="courier new, monospace">for(int i=0; i<num; ++i) {</font></div><div class="gmail_default"><font face="courier new, monospace"> lldb::SBBreakpoint bp = m_target.GetBreakpointAtIndex(i);</font></div>
<div class="gmail_default"><font face="courier new, monospace">...</font></div><div class="gmail_default"><font face="courier new, monospace">}</font></div><div class="gmail_default"><font face="courier new, monospace"><br>
</font></div><div class="gmail_default"><font face="verdana, sans-serif">At this point, I can see that the breakpoints I have applied in the shared libraries were not applied. So my question is:</font></div><div class="gmail_default">
<font face="verdana, sans-serif">Who should be responsible for the "pending" breakpoints? Is it done automatically by lldb? or should I keep a list of un-applied breakpoints and try to re-apply them later on?</font></div>
<div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif">If the later is the case, can the plugin be notified when a shared library is loaded? (this seems like a good candidate for trying to re-apply pending breakpoints)</font></div>
<div class="gmail_default"><br></div><div class="gmail_default">Thanks,</div></div><div><br></div>-- <br><div dir="ltr">Eran Ifrah<br>Author of codelite, a cross platform open source C/C++ IDE: <a href="http://www.codelite.org" target="_blank">http://www.codelite.org</a><br>
<div>wxCrafter, a wxWidgets RAD: http://<a href="http://wxcrafter.codelite.org" target="_blank">wxcrafter.codelite.org</a></div></div>
</div>