Page MenuHomePhabricator

[lldb/Commands] Fix outdated `breakpoint command add` help string
ClosedPublic

Authored by kastiglione on Wed, Sep 16, 4:45 PM.

Details

Summary

Update the some examples in the help string for breakpoint command add.

Python breakpoint commands have different output than what's shown in the help string.

Notes:

  • Removed an example containing an inner function, as it seems more about a Python technique than about command script add
  • Updated print x to print(x) to be python 2/3 agnostic

Diff Detail

Event Timeline

kastiglione created this revision.Wed, Sep 16, 4:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Sep 16, 4:45 PM
kastiglione requested review of this revision.Wed, Sep 16, 4:45 PM
kastiglione added inline comments.Wed, Sep 16, 4:45 PM
lldb/source/Commands/CommandObjectBreakpointCommand.cpp
174–181

Does anyone think this should be kept?

LGTM, if you want to remove the last example, I say go ahead. If you want to dig in more, then we should go through another review for the useful example.

lldb/source/Commands/CommandObjectBreakpointCommand.cpp
174–181

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.

kastiglione added inline comments.Wed, Sep 16, 7:30 PM
lldb/source/Commands/CommandObjectBreakpointCommand.cpp
174–181

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.

This revision was not accepted when it landed; it landed in state Needs Review.Mon, Sep 21, 10:15 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.