This is an archive of the discontinued LLVM Phabricator instance.

Add functionality to trace a function within lldb
AbandonedPublic

Authored by hiraditya on Feb 6 2019, 11:05 AM.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

hiraditya created this revision.Feb 6 2019, 11:05 AM
Herald added a project: Restricted Project. · View Herald Transcript

LGTM with respect to Python 2/3 compat, can't tell for the functionality though.

clayborg requested changes to this revision.May 28 2019, 8:15 AM

For this to actually work we need to:

  • Disable skipping function prologues using "settings set target.skip-prologue false", set a breakpoint at the function we want to trace and store breakpoint in "trace_breakpoint", restore skipping function prologues
  • make a local variable "tracing_function = False"
  • when we stop, detect if the "trace_breakpoint" was hit and set "tracing_function = True" if it was. Calculate the the return address using the thread's backtrace and set a breakpoint there, store breakpoint in local variable "trace_return_breakpoint"
  • when we continue check "tracing_function" and step if it is true, and continue it not
  • When we stop check if "trace_return_breakpoint" was hit and if so, set "tracing_function = False"
This revision now requires changes to proceed.May 28 2019, 8:15 AM
hiraditya abandoned this revision.Jul 3 2020, 2:52 PM