Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Improve SBThread's stepping API using SBError parameter.
Browse files Browse the repository at this point in the history
Summary: The new methods will allow to get error messages from stepping API.

Reviewers: aprantl, clayborg, labath, jingham

Reviewed By: aprantl, clayborg, jingham

Subscribers: apolyakov, labath, jingham, clayborg, lemo, lldb-commits

Differential Revision: https://reviews.llvm.org/D47991

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@335180 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
apolyakov committed Jun 20, 2018
1 parent 23c3f8d commit 9aad861
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 98 deletions.
16 changes: 15 additions & 1 deletion include/lldb/API/SBThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class LLDB_API SBThread {

void StepOver(lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);

void StepOver(lldb::RunMode stop_other_threads, SBError &error);

void StepInto(lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);

void StepInto(const char *target_name,
Expand All @@ -103,10 +105,16 @@ class LLDB_API SBThread {

void StepOut();

void StepOutOfFrame(lldb::SBFrame &frame);
void StepOut(SBError &error);

void StepOutOfFrame(SBFrame &frame);

void StepOutOfFrame(SBFrame &frame, SBError &error);

void StepInstruction(bool step_over);

void StepInstruction(bool step_over, SBError &error);

SBError StepOverUntil(lldb::SBFrame &frame, lldb::SBFileSpec &file_spec,
uint32_t line);

Expand All @@ -119,6 +127,8 @@ class LLDB_API SBThread {

void RunToAddress(lldb::addr_t addr);

void RunToAddress(lldb::addr_t addr, SBError &error);

SBError ReturnFromFrame(SBFrame &frame, SBValue &return_value);

SBError UnwindInnermostExpression();
Expand Down Expand Up @@ -146,8 +156,12 @@ class LLDB_API SBThread {
//--------------------------------------------------------------------------
bool Suspend();

bool Suspend(SBError &error);

bool Resume();

bool Resume(SBError &error);

bool IsSuspended();

bool IsStopped();
Expand Down
34 changes: 32 additions & 2 deletions scripts/interface/SBThread.i
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,19 @@ public:
void
StepOver (lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);

%feature("autodoc",
"Do a source level single step over in the currently selected thread.") StepOver;
void
StepOver (lldb::RunMode stop_other_threads, SBError &error);

void
StepInto (lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);

void
StepInto (const char *target_name, lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);

%feature("autodoc", "
Step the current thread from the current source line to the line given by end_line, stopping if
Step the current thread from the current source line to the line given by end_line, stopping if
the thread steps into the function given by target_name. If target_name is None, then stepping will stop
in any of the places we would normally stop.
") StepInto;
Expand All @@ -231,12 +236,28 @@ public:
void
StepOut ();

%feature("autodoc",
"Step out of the currently selected thread.") StepOut;
void
StepOut (SBError &error);

void
StepOutOfFrame (lldb::SBFrame &frame);
StepOutOfFrame (SBFrame &frame);

%feature("autodoc",
"Step out of the specified frame.") StepOutOfFrame;
void
StepOutOfFrame (SBFrame &frame, SBError &error);

void
StepInstruction(bool step_over);

%feature("autodoc",
"Do an instruction level single step in the currently selected thread.
") StepInstruction;
void
StepInstruction(bool step_over, SBError &error);

SBError
StepOverUntil (lldb::SBFrame &frame,
lldb::SBFileSpec &file_spec,
Expand All @@ -254,6 +275,9 @@ public:
void
RunToAddress (lldb::addr_t addr);

void
RunToAddress (lldb::addr_t addr, SBError &error);

%feature("autodoc", "
Force a return from the frame passed in (and any frames younger than it)
without executing any more code in those frames. If return_value contains
Expand Down Expand Up @@ -297,9 +321,15 @@ public:
") Suspend;
bool
Suspend();

bool
Suspend(SBError &error);

bool
Resume ();

bool
Resume (SBError &error);

bool
IsSuspended();
Expand Down
Loading

0 comments on commit 9aad861

Please sign in to comment.