[lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)
Ismail Bennani via lldb-dev
lldb-dev at lists.llvm.org
Fri Aug 23 12:31:08 PDT 2019
> On Aug 22, 2019, at 11:00 PM, Pavel Labath <pavel at labath.sk> wrote:
>
> On 23/08/2019 00:58, Ismail Bennani via lldb-dev wrote:
>> Hi Greg,
>> Thanks for your suggestion!
>>> On Aug 22, 2019, at 3:35 PM, Greg Clayton <clayborg at gmail.com> wrote:
>>>
>>> Another possibility is to have the IDE insert NOP opcodes for you when you write a breakpoint with a condition and compile NOPs into your program.
>>>
>>> So the flow is:
>>> - set a breakpoint in IDE
>>> - modify breakpoint to add a condition
>>> - compile and debug, the IDE inserts NOP instructions at the right places
>> We’re trying to avoid rebuilding every time we want to debug, but I’ll keep
>> this in mind as an eventual fallback.
>
> A slight variation on that feature would be to just have the compiler guarantee that there will always be enough space between two jump targets for us to insert a trampoline jump. One way to guarantee that would be to align all jump targets to 16-byte boundaries (on x86 anyway).
One of my next task is to add some instrumentation that will tell if it’s safe to
set the fast conditional breakpoint at the desired location.
I already thought of some scenarios in the RFC, where we’ll need to do some extra
work to be able to insert a FCB.
>
> I say this because I have a vague recollection that some of the more exotic llvm backends (webassembly?) may already have such a requirement, albeit for different reasons (to do with being able to statically analyze control flow), so the code for doing this might already be there, and maybe all it would take is a little tinkering with the codegen options to enable it.
I’ll take a closer look at those.
>
> Unfortunately, I don't remember the details of this, but someone on this list might…
>
> pl
Thanks,
Ismail.
More information about the lldb-dev
mailing list