Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-23 Thread Ismail Bennani via lldb-dev
> On Aug 22, 2019, at 11:00 PM, Pavel Labath 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 wrote: >>> >>> Another possibility is to have the IDE insert NOP opcodes for you when you >>>

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-22 Thread Pavel Labath via lldb-dev
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 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. S

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-22 Thread Pedro Alves via lldb-dev
If you can rely on the IDE & compile&debug, you might as well made the IDE&compiler bake in the breakpoint condition and trompoline into the code without having to have the debugger build the trampoline afterwards. Thanks, Pedro Alves On 8/22/19 11:35 PM, Greg Clayton wrote: > Another possibili

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-22 Thread Jason Molenda via lldb-dev
> On Aug 22, 2019, at 3:58 PM, Ismail Bennani via lldb-dev > wrote: > > Hi Greg, > > Thanks for your suggestion! > >> On Aug 22, 2019, at 3:35 PM, Greg Clayton wrote: >> >> Another possibility is to have the IDE insert NOP opcodes for you when you >> write a breakpoint with a condition an

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-22 Thread Ismail Bennani via lldb-dev
Hi Greg, Thanks for your suggestion! > On Aug 22, 2019, at 3:35 PM, Greg Clayton 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 > -

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-22 Thread Greg Clayton via lldb-dev
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 p

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-22 Thread Pedro Alves via lldb-dev
On 8/22/19 12:36 AM, Ismail Bennani via lldb-dev wrote: >> On Aug 21, 2019, at 3:48 PM, Pedro Alves wrote: >> Say, you're using a 5 bytes jmp instruction to jump to the >> trampoline, so you need to replace 5 bytes at the breakpoint address. >> But the instruction at the breakpoint address is sho

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-21 Thread Ismail Bennani via lldb-dev
Hi Pedro, > On Aug 21, 2019, at 3:48 PM, Pedro Alves wrote: > > Hi, > > Very interesting. > > One comment below, about something that jumped at me when > I skimmed the proposal. > > On 8/14/19 9:52 PM, Ismail Bennani via lldb-dev wrote: >> >> Since the x86_64 ISA has variable instruction siz

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-21 Thread Pedro Alves via lldb-dev
Hi, Very interesting. One comment below, about something that jumped at me when I skimmed the proposal. On 8/14/19 9:52 PM, Ismail Bennani via lldb-dev wrote: > > Since the x86_64 ISA has variable instruction size, LLDB moves enough > instructions in the trampoline to be able to overwrite them

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-20 Thread Jim Ingham via lldb-dev
> On Aug 20, 2019, at 3:30 AM, Tamas Berghammer via lldb-dev > wrote: > > It is great that you are looking at supporting these fast breakpoints > but I am concerned about the instruction moving code along the same > lines Pavel mentioned. Copying instructions from 1 location to another > is fa

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-20 Thread Tamas Berghammer via lldb-dev
It is great that you are looking at supporting these fast breakpoints but I am concerned about the instruction moving code along the same lines Pavel mentioned. Copying instructions from 1 location to another is fairly complicated even without considering the issue of jump targets and jump target d

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-20 Thread Pavel Labath via lldb-dev
On 20/08/2019 00:11, Ismail Bennani wrote: On Aug 19, 2019, at 2:30 PM, Frédéric Riss wrote: On Aug 16, 2019, at 11:13 AM, Ismail Bennani via lldb-dev wrote: Hi Pavel, Thanks for all your feedbacks. I’ve been following the discussion closely and find your approach quite interesting. A

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-19 Thread Ismail Bennani via lldb-dev
> On Aug 19, 2019, at 2:30 PM, Frédéric Riss wrote: > > > >> On Aug 16, 2019, at 11:13 AM, Ismail Bennani via lldb-dev >> wrote: >> >> Hi Pavel, >> >> Thanks for all your feedbacks. >> >> I’ve been following the discussion closely and find your approach quite >> interesting. >> >> As Jim

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-19 Thread Frédéric Riss via lldb-dev
> On Aug 16, 2019, at 11:13 AM, Ismail Bennani via lldb-dev > wrote: > > Hi Pavel, > > Thanks for all your feedbacks. > > I’ve been following the discussion closely and find your approach quite > interesting. > > As Jim explained, I’m also trying to have a conditional breakpoint, that is

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-16 Thread Ismail Bennani via lldb-dev
Hi Pavel, Thanks for all your feedbacks. I’ve been following the discussion closely and find your approach quite interesting. As Jim explained, I’m also trying to have a conditional breakpoint, that is able to stop a specific thread (name or id) when the condition expression evaluates to true

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-16 Thread Finkel, Hal J. via lldb-dev
On 8/16/19 10:27 AM, Adrian Prantl wrote: > >> On Aug 15, 2019, at 2:03 PM, Ismail Bennani via lldb-dev >> wrote: >> >> I built Clang (and LLVM) in Release Mode with Debug Info (-O2), >> and got these results: >> >> | Dwarf Occurences |Occurences | >> |--|---

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-16 Thread Adrian Prantl via lldb-dev
> On Aug 15, 2019, at 2:03 PM, Ismail Bennani via lldb-dev > wrote: > > I built Clang (and LLVM) in Release Mode with Debug Info (-O2), > and got these results: > > | Dwarf Occurences |Occurences | > |--|-| > | DW\_OP\_deref|1,570

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-15 Thread Ismail Bennani via lldb-dev
I built Clang (and LLVM) in Release Mode with Debug Info (-O2), and got these results: | Dwarf Occurences |Occurences | |--|-| | DW\_OP\_deref|1,570| | DW\_OP\_const|3,791| | DW\_OP\_addr |9,528

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-15 Thread Jim Ingham via lldb-dev
> On Aug 15, 2019, at 11:55 AM, Pavel Labath wrote: > > On 15/08/2019 20:15, Jim Ingham wrote: >> Thanks for your great comments. A few replies... >>> On Aug 15, 2019, at 10:10 AM, Pavel Labath via lldb-dev >>> wrote: >>> I am wondering whether we really need to involve the memory allocation

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-15 Thread Pavel Labath via lldb-dev
On 15/08/2019 20:15, Jim Ingham wrote: Thanks for your great comments. A few replies... On Aug 15, 2019, at 10:10 AM, Pavel Labath via lldb-dev wrote: I am wondering whether we really need to involve the memory allocation functions here. What's the size of this address structure? I would ex

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-15 Thread Jim Ingham via lldb-dev
Thanks for your great comments. A few replies... > On Aug 15, 2019, at 10:10 AM, Pavel Labath via lldb-dev > wrote: > > Hello Ismail, and wellcome to LLDB. You have a very interesting (and not > entirely trivial) project, and I wish you the best of luck in your work. I > think this will be a

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-15 Thread Pavel Labath via lldb-dev
Hello Ismail, and wellcome to LLDB. You have a very interesting (and not entirely trivial) project, and I wish you the best of luck in your work. I think this will be a very useful addition to lldb. It sounds like you have researched the problem very well, and the overall direction looks good

Re: [lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-14 Thread Finkel, Hal J. via lldb-dev
On 8/14/19 3:52 PM, Ismail Bennani via lldb-dev wrote: > Hi everyone, > > I’m Ismail, a compiler engineer intern at Apple. As a part of my internship, > I'm adding Fast Conditional Breakpoints to LLDB, using code patching. > > ... > > Since all the registers are already mapped to a structure, I sh

[lldb-dev] [RFC] Fast Conditional Breakpoints (FCB)

2019-08-14 Thread Ismail Bennani via lldb-dev
Hi everyone, I’m Ismail, a compiler engineer intern at Apple. As a part of my internship, I'm adding Fast Conditional Breakpoints to LLDB, using code patching. Currently, the expressions that power conditional breakpoints are lowered to LLVM IR and LLDB knows how to interpret a subset of it. If t