This is an archive of the discontinued LLVM Phabricator instance.

Implemented "thread jump" built-in command.
ClosedPublic

Authored by richard.mitton on Aug 20 2013, 2:11 PM.

Details

Reviewers
richard.mitton
Summary

This patch adds a 'jump' command, similar to GDBs.

This allows the PC to be directly changed to a different line.
It's similar to the example python script in examples/python/jump.py, except implemented as a builtin.

Also this version will track the current function correctly even if the target line resolves to multiple addresses. (e.g. debugging a templated function)

Diff Detail

Event Timeline

<ping/>

So, I just wanted to check here; the LLVM developer policy says I'm
expected to get every patch reviewed before submission. In general, for
lack of any feedback, is it OK to just submit stuff like this without
approval?

Richard Mitton
richard@codersnotes.com

richard.mitton updated this revision to Unknown Object (????).Aug 28 2013, 8:51 PM

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.

richard.mitton updated this revision to Unknown Object (????).Sep 3 2013, 12:24 PM

Moved the FindAddressesForLine function up into ModuleList, so other code can make use of it.

I'm not sure I agree that there's a better name than just 'force' for the command line. Right now the only reason the jump would refuse is because it won't jump to different functions, but perhaps in future there might be other reasons. Also other command-line options use 'force', and it makes sense to try and keep things consistent across commands.

richard.mitton updated this revision to Unknown Object (????).Sep 3 2013, 12:31 PM

(accidentally submitted patch with tabs instead of spaces, fixed)

richard.mitton accepted this revision.Sep 11 2013, 7:31 PM
richard.mitton closed this revision.