[Lldb-commits] [PATCH] Implemented "thread jump" built-in command.
jingham at apple.com
jingham at apple.com
Thu Aug 29 15:52:39 PDT 2013
This looks great. One quibble and a suggestion.
The quibble: since the meaning of "force" is very specific, namely "don't leave the current function" it would be clearer to use that wording for the command line option. I know I suggested the "force" but since you came up with a better name, we should use it for the command option.
The suggestion: the FindAddressesForLine function is more broadly useful than just for this jump feature. For instance, another thing we haven't added to lldb yet is the "source info" command, which would be equivalent to gdb's "info line". You should be able to say:
(lldb) info source -f foo.c -l 12 -s MyProject.dylib
(lldb) info source -f bar.h -l 13 --function MyFunction
and get the address ranges for that line in the given shared library or function or in the whole binary, something like:
Debug Info path:
The last part of this output, and the general search mechanism, would use pretty much your function FindAddressesForLine. So it shouldn't be a static helper function in this file. The highest level entity that it depends on is the Target, but we tend to put lookup functions that only need the ModuleList directly in the module list (e.g. FindFunctions). If that seems right to you, can you move that function there? And for extra credit is should take an input ModuleList * that you would just stuff directly into the GetSearchFilterForModuleList call. It doesn't need to be exactly as we would use it for "source info"; if it is living in the right place, then we can fix it up when we get around to implementing that command. But if it's a static function off somewhere, then we'll write another copy which is not so good.
On Aug 28, 2013, at 8:51 PM, Richard Mitton <richard at codersnotes.com> wrote:
> Update the patch to address the following issues:
> Fixed some of the command-line parser to check arguments more carefully.
> Added a 'force' command to prevent unintentionally jumping out of the current function.
> Moved the core jump logic into Thread::JumpToLine, and changed the command code to call that.
> Added a Python API version too.
> CHANGE SINCE LAST DIFF
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
More information about the lldb-commits