Added 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)

llvm-svn: 190572
This commit is contained in:
Richard Mitton
2013-09-12 02:20:34 +00:00
parent 50c003b577
commit f86248d9ba
19 changed files with 579 additions and 9 deletions

View File

@@ -909,6 +909,31 @@ SBThread::StepOverUntil (lldb::SBFrame &sb_frame,
return sb_error;
}
SBError
SBThread::JumpToLine (lldb::SBFileSpec &file_spec, uint32_t line)
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
SBError sb_error;
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
if (log)
log->Printf ("SBThread(%p)::JumpToLine (file+line = %s:%u)", exe_ctx.GetThreadPtr(), file_spec->GetPath().c_str(), line);
if (!exe_ctx.HasThreadScope())
{
sb_error.SetErrorString("this SBThread object is invalid");
return sb_error;
}
Thread *thread = exe_ctx.GetThreadPtr();
Error err = thread->JumpToLine (file_spec.get(), line, true);
sb_error.SetError (err);
return sb_error;
}
SBError
SBThread::ReturnFromFrame (SBFrame &frame, SBValue &return_value)
{