summaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectBreakpoint.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-11-19 20:06:13 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-11-19 20:06:13 +0000
commitc0981da47d5696fe36474fcf86b4ce03ae3ff818 (patch)
treef42add1021b9f2ac6a69ac7cf6c4499962739a45 /lldb/source/Commands/CommandObjectBreakpoint.cpp
parent344a3780b2e33f6ca763666c380202b18aab72a3 (diff)
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 722d5c4d8f47..3f88a2fa6378 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -110,7 +110,19 @@ public:
case 't': {
lldb::tid_t thread_id = LLDB_INVALID_THREAD_ID;
if (option_arg[0] != '\0') {
- if (option_arg.getAsInteger(0, thread_id))
+ if (option_arg == "current") {
+ if (!execution_context) {
+ error.SetErrorStringWithFormat("No context to determine current "
+ "thread");
+ } else {
+ ThreadSP ctx_thread_sp = execution_context->GetThreadSP();
+ if (!ctx_thread_sp || !ctx_thread_sp->IsValid()) {
+ error.SetErrorStringWithFormat("No currently selected thread");
+ } else {
+ thread_id = ctx_thread_sp->GetID();
+ }
+ }
+ } else if (option_arg.getAsInteger(0, thread_id))
error.SetErrorStringWithFormat("invalid thread id string '%s'",
option_arg.str().c_str());
}