[lldb-dev] Question about -break-insert in lldb-mi

Pierson Lee (PIE) via lldb-dev lldb-dev at lists.llvm.org
Mon Jul 11 11:32:58 PDT 2016


If I don't specify the -f flag (with some random parameter), then a pending breakpoint is not created and the initial binding fails. But if I specify the -f with the random parameter, then it will bind when the library is loaded. This is the behavior I see on gdb also, but sans the random parameter. I looked at the source code and can't figure out what it expects the parameter to be and what it does with the value. 

-----Original Message-----
From: jingham at apple.com [mailto:jingham at apple.com] 
Sent: Friday, July 8, 2016 7:03 PM
To: Pierson Lee (PIE) <Pierson.Lee at microsoft.com>
Cc: lldb-dev at lists.llvm.org
Subject: Re: [lldb-dev] Question about -break-insert in lldb-mi


gdb used to try to find a symbol matching the breakpoint specification and if it didn't find one immediately, it would raise an error.  If you didn't want this behavior (in a world with many shared libraries you seldom did) then you could set a "future-break" which is what the -f flag turns on.  This was better though a bit bogus, because it would set the breakpoint the FIRST time it took, then never look again.

But this was quite a while ago, and I think gdb's gotten better about organizing breakpoints.  But I haven't used a modern gdb for a while, so I'm not sure how it works now-a-days.

Anyway, lldb's breakpoints don't work that way.  They stay active till you delete them, and keep searching for new matches every time a shared library is loaded.  You could make them emulate the gdb behavior by judiciously deleting & duplicating breakpoints from the original specification, but there's no way to get the native lldb breakpoints to do so (nor should there be IMHO...)

So if you are using the lldb-mi, there's no reason to bother with the -f flag.  But also lldb-mi should probably just ignore this flag.

Jim
 

> On Jul 8, 2016, at 5:58 PM, Pierson Lee (PIE) via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> 
> Hi,
>  
> I’m trying to use -break-insert and the -f flag for it. 
>  
> I noticed in MICmdCmdBreak.cpp , in CmICmdCmdBreakInsert::ParseArgs() that the -f has a required parameter.
>  
>     m_setCmdArgs.Add(new CMICmdArgValOptionShort(m_constStrArgNamedPendinfBrkPt, false, true,
>                                                    CMICmdArgValListBase::eArgValType_StringQuotedNumberPath, 1));
>  
>  
> Based on the GDB MI documentation (at https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fsourceware.org%2fgdb%2fonlinedocs%2fgdb%2fGDB_002fMI-Breakpoint-Commands.html%23GDB_002fMI-Breakpoint-Commands&data=01%7c01%7cPierson.Lee%40microsoft.com%7c2f7fe625424341c8101908d3a79d5c33%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=vA0kav9epp3zRa4QivQ9wmimjEHYiJ0AiQfJcGKdzEs%3d) for -break-insert shows:
>  
> ‘-f’
> If location cannot be parsed (for example if it refers to unknown files or functions), create a pending breakpoint. Without this flag, gdb will report an error, and won't create a breakpoint, if location cannot be parsed. 
>  
> Is there a reason why it requires a parameter and what should this parameter be ?
>  
> Thanks
> Pierson
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2flists.llvm.org%2fcgi-bin%2fmailman%2flistinfo%2flldb-dev&data=01%7c01%7cPierson.Lee%40microsoft.com%7c2f7fe625424341c8101908d3a79d5c33%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=mCckfTlDjZ8w%2fTvABG6OSj8kZIpC8VeHtjQqHYS8uAk%3d



More information about the lldb-dev mailing list