Documentation fix - explain how to unset conditions. Also fix unsetting -x and -t so they work.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120851 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectBreakpoint.cpp b/source/Commands/CommandObjectBreakpoint.cpp
index 1217164..35d8cfd 100644
--- a/source/Commands/CommandObjectBreakpoint.cpp
+++ b/source/Commands/CommandObjectBreakpoint.cpp
@@ -1358,7 +1358,9 @@
Options (),
m_ignore_count (0),
m_thread_id(LLDB_INVALID_THREAD_ID),
+ m_thread_id_passed(false),
m_thread_index (UINT32_MAX),
+ m_thread_index_passed(false),
m_thread_name(),
m_queue_name(),
m_condition (),
@@ -1426,9 +1428,19 @@
break;
case 't' :
{
- m_thread_id = Args::StringToUInt64(optarg, LLDB_INVALID_THREAD_ID, 0);
- if (m_thread_id == LLDB_INVALID_THREAD_ID)
- error.SetErrorStringWithFormat ("Invalid thread id string '%s'.\n", optarg);
+ if (optarg[0] == '\0')
+ {
+ m_thread_id = LLDB_INVALID_THREAD_ID;
+ m_thread_id_passed = true;
+ }
+ else
+ {
+ m_thread_id = Args::StringToUInt64(optarg, LLDB_INVALID_THREAD_ID, 0);
+ if (m_thread_id == LLDB_INVALID_THREAD_ID)
+ error.SetErrorStringWithFormat ("Invalid thread id string '%s'.\n", optarg);
+ else
+ m_thread_id_passed = true;
+ }
}
break;
case 'T':
@@ -1447,10 +1459,19 @@
break;
case 'x':
{
- m_thread_index = Args::StringToUInt32 (optarg, UINT32_MAX, 0);
- if (m_thread_id == UINT32_MAX)
- error.SetErrorStringWithFormat ("Invalid thread index string '%s'.\n", optarg);
-
+ if (optarg[0] == '\n')
+ {
+ m_thread_index = UINT32_MAX;
+ m_thread_index_passed = true;
+ }
+ else
+ {
+ m_thread_index = Args::StringToUInt32 (optarg, UINT32_MAX, 0);
+ if (m_thread_id == UINT32_MAX)
+ error.SetErrorStringWithFormat ("Invalid thread index string '%s'.\n", optarg);
+ else
+ m_thread_index_passed = true;
+ }
}
break;
default:
@@ -1468,7 +1489,9 @@
m_ignore_count = 0;
m_thread_id = LLDB_INVALID_THREAD_ID;
+ m_thread_id_passed = false;
m_thread_index = UINT32_MAX;
+ m_thread_index_passed = false;
m_thread_name.clear();
m_queue_name.clear();
m_condition.clear();
@@ -1487,7 +1510,8 @@
CommandObject (interpreter,
"breakpoint modify",
"Modify the options on a breakpoint or set of breakpoints in the executable. "
- "If no breakpoint is specified, acts on the last created breakpoint.",
+ "If no breakpoint is specified, acts on the last created breakpoint. "
+ "With the exception of -e, -d and -i, passing an empty argument clears the modification.",
NULL)
{
CommandArgumentEntry arg;
@@ -1558,10 +1582,10 @@
BreakpointLocation *location = bp->FindLocationByID (cur_bp_id.GetLocationID()).get();
if (location)
{
- if (m_options.m_thread_id != LLDB_INVALID_THREAD_ID)
+ if (m_options.m_thread_id_passed)
location->SetThreadID (m_options.m_thread_id);
- if (m_options.m_thread_index != UINT32_MAX)
+ if (m_options.m_thread_index_passed)
location->GetLocationOptions()->GetThreadSpec()->SetIndex(m_options.m_thread_index);
if (m_options.m_name_passed)
@@ -1582,10 +1606,10 @@
}
else
{
- if (m_options.m_thread_id != LLDB_INVALID_THREAD_ID)
+ if (m_options.m_thread_id_passed)
bp->SetThreadID (m_options.m_thread_id);
- if (m_options.m_thread_index != UINT32_MAX)
+ if (m_options.m_thread_index_passed)
bp->GetOptions()->GetThreadSpec()->SetIndex(m_options.m_thread_index);
if (m_options.m_name_passed)