[Lldb-commits] [PATCH] D87807: [lldb/Commands] Fix outdated `breakpoint command add` help string

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 16 19:30:12 PDT 2020


kastiglione added inline comments.


================
Comment at: lldb/source/Commands/CommandObjectBreakpointCommand.cpp:174-181
-(lldb) breakpoint command add -s python 1
-Enter your Python command(s). Type 'DONE' to end.
-> def breakpoint_output (bp_no):
->     out_string = "Hit breakpoint number " + repr (bp_no)
->     print out_string
->     return True
-> breakpoint_output (1)
----------------
jingham wrote:
> kastiglione wrote:
> > Does anyone think this should be kept?
> It is potentially interesting that you can put other code in this definition, so long as there's only one function defined.  Maybe you could use that to initialize something you were planning to log to (open a file or something?)  But if that's what we are showing people, we should actually describe what it's legit to do other than define a function in this input editor.  
> 
> As it is, it's overly mysterious and not very helpful.  And the example is unmotivated so it's just confusing...  
> 
> If you feel like digging into what else can go here, and come up with a motivated example that's actually useful, I think that would be handy.  But otherwise, I'm fine with deleting the last example.
I see, yes, though I don't have any such examples ready and waiting. I haven't found myself turning to multiline python expressions that contain functions. Can you check my understanding, in this example `breakpoint_output` is a named lambda, and you're saying it would be nice to have an example that uses a named lambda? If so, I don't think I have a good example.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87807/new/

https://reviews.llvm.org/D87807



More information about the lldb-commits mailing list