<div dir="ltr">Hi Jim,<div><br></div><div>Unfortunately, it still has the issue:</div><div><br></div><div>For example, for <a href="https://github.com/c0deforfun/LLL/blob/master/sample/main/main.c">https://github.com/c0deforfun/LLL/blob/master/sample/main/main.c</a>:</div><div>I set bp at line 37 :</div><div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre"> i = </span><span class="" style="color:rgb(0,134,179);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">foo</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">(argc,</span><span class="" style="color:rgb(0,134,179);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">2</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">); </span></div><div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.7999992370605px;white-space:pre">(foo is in another CU, so won't be inlined)</span></div><div><font color="#333333" face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;line-height:16.7999992370605px;white-space:pre">However, GetAddress().GetSymbolContext(lldb.eSymbolContextEverything).GetLineEntry()) shows it's at line 38.</span></font></div><div><font color="#333333" face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;line-height:16.7999992370605px;white-space:pre"><br></span></font></div><div><font color="#333333" face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;line-height:16.7999992370605px;white-space:pre">commandline has the same issue:</span></font></div><div><font color="#333333" face="Consolas, Liberation Mono, Menlo, Courier, monospace"><div style><span style="font-size:12px;line-height:16.7999992370605px;white-space:pre">(lldb) b main.c:37</span></div><div style><span style="font-size:12px;line-height:16.7999992370605px;white-space:pre">Breakpoint 1: where = test`main + 192 at main.c:38, address = 0x0000000000400677</span></div><div style="font-size:12px;line-height:16.7999992370605px;white-space:pre"><br></div><div style="font-size:12px;line-height:16.7999992370605px;white-space:pre">In commandline script:</div><div style><span style="font-size:12px;line-height:16.7999992370605px;white-space:pre">>>> ss=lldb.SBStream()
>>> lldb.target.FindBreakpointByID(1).GetDescription(ss)
>>> print(ss.GetData())
SBBreakpoint: id = 1, file = 'main.c', line = 37, locations = 1
<br></span></div><div style><span style="font-size:12px;line-height:16.7999992370605px;white-space:pre">>>> print(lldb.target.FindBreakpointByID(1).GetLocationAtIndex(0).GetAddress().GetSymbolContext(lldb.eSymbolContextEverything).GetLineEntry())
/home/media/Shared/LLL/sample/main/main.c:38
</span></div><div><br></div><div>I expect a consistent user experience: wherever users clicks a line for bp, a dot will been shown at that line.</div><div><br></div><div>Thanks</div></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 17, 2015 at 9:20 PM, zephyr zhao <span dir="ltr"><<a href="mailto:zephyr.git@gmail.com" target="_blank">zephyr.git@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Jim,<div><br></div><div>Cool! Thanks a lot! </div><div>Your analysis is correct.</div><div>Let me try you solution!</div><div><br></div><div>Thanks</div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 17, 2015 at 11:29 AM, <span dir="ltr"><<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br>
> On Feb 16, 2015, at 11:01 PM, zephyr zhao <<a href="mailto:zephyr.git@gmail.com" target="_blank">zephyr.git@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I'm working on a GUI frontend of LLDB which is based on Python 2.7 and Qt 4:<br>
> <a href="https://github.com/c0deforfun/LLL" target="_blank">https://github.com/c0deforfun/LLL</a><br>
><br>
> Screenshot of current status:<br>
> <a href="https://raw.githubusercontent.com/c0deforfun/LLL/master/docs/screenshot.png" target="_blank">https://raw.githubusercontent.com/c0deforfun/LLL/master/docs/screenshot.png</a><br>
><br>
> There're still a lot of works to do. It would be really helpful if someone could join the project.<br>
> Any suggestions or comments will be appreciated too!<br>
><br>
> Btw, I have a question:<br>
> when users set a breakpoint at some line, SBBreakpointLocation may return a different line No. My current workaround is grep it from SBBreakpoint.GetDescription()<br>
<br>
</div></div>This can happen when a breakpoint is set on a line that doesn't generate any code. Then the breakpoint will be moved to the nearest line afterwards that does generate code. For instance, setting a breakpoint on some code that is in a:<br>
<br>
#if 0<br>
<br>
#endif<br>
<br>
block will cause it to be moved to the line after the #if 0'ed code. If it is happening for you in code that looks like it is actually getting executed however, then that's a bug (most likely a bug in the line table information, but it could be an lldb bug as well.)<br>
<br>
You don't need to grep GetDescription for the line number, however. Just get the Location's SBAddress, (SBBreakpointLocation::GetAddress(), then get the SBSymbolContext from the address (SBAddress::GetSymbolContext(lldb.eSymbolContextEverything)). The symbol context has a SBLineEntry (SBSymbolContext::GetLineEntry()) and that has the file spec & line number.<br>
<br>
Jim<br>
<div><div><br>
<br>
><br>
> Thanks,<br>
> C0deforfun<br>
><br>
><br>
> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>