@@ -67,21 +67,27 @@ class CommandObjectThreadBacktrace : public CommandObjectIterateOverThreads {
67
67
if (option_arg.getAsInteger (0 , m_count)) {
68
68
m_count = UINT32_MAX;
69
69
error.SetErrorStringWithFormat (
70
- " invalid integer value for option '%c'" , short_option);
70
+ " invalid integer value for option '%c': %s" , short_option,
71
+ option_arg.data ());
71
72
}
73
+ // A count of 0 means all frames.
74
+ if (m_count == 0 )
75
+ m_count = UINT32_MAX;
72
76
break ;
73
77
case ' s' :
74
78
if (option_arg.getAsInteger (0 , m_start))
75
79
error.SetErrorStringWithFormat (
76
- " invalid integer value for option '%c'" , short_option);
80
+ " invalid integer value for option '%c': %s" , short_option,
81
+ option_arg.data ());
77
82
break ;
78
83
case ' e' : {
79
84
bool success;
80
85
m_extended_backtrace =
81
86
OptionArgParser::ToBoolean (option_arg, false , &success);
82
87
if (!success)
83
88
error.SetErrorStringWithFormat (
84
- " invalid boolean value for option '%c'" , short_option);
89
+ " invalid boolean value for option '%c': %s" , short_option,
90
+ option_arg.data ());
85
91
} break ;
86
92
default :
87
93
llvm_unreachable (" Unimplemented option" );
@@ -228,9 +234,9 @@ class CommandObjectThreadBacktrace : public CommandObjectIterateOverThreads {
228
234
thread->GetIndexID ());
229
235
return false ;
230
236
}
231
- if (m_options.m_extended_backtrace ) {
232
- if (!INTERRUPT_REQUESTED (GetDebugger (),
233
- " Interrupt skipped extended backtrace" )) {
237
+ if (m_options.m_extended_backtrace ) {
238
+ if (!INTERRUPT_REQUESTED (GetDebugger (),
239
+ " Interrupt skipped extended backtrace" )) {
234
240
DoExtendedBacktrace (thread, result);
235
241
}
236
242
}
@@ -272,8 +278,9 @@ class ThreadStepScopeOptionGroup : public OptionGroup {
272
278
bool avoid_no_debug =
273
279
OptionArgParser::ToBoolean (option_arg, true , &success);
274
280
if (!success)
275
- error.SetErrorStringWithFormat (" invalid boolean value for option '%c'" ,
276
- short_option);
281
+ error.SetErrorStringWithFormat (
282
+ " invalid boolean value for option '%c': %s" , short_option,
283
+ option_arg);
277
284
else {
278
285
m_step_in_avoid_no_debug = avoid_no_debug ? eLazyBoolYes : eLazyBoolNo;
279
286
}
@@ -284,17 +291,19 @@ class ThreadStepScopeOptionGroup : public OptionGroup {
284
291
bool avoid_no_debug =
285
292
OptionArgParser::ToBoolean (option_arg, true , &success);
286
293
if (!success)
287
- error.SetErrorStringWithFormat (" invalid boolean value for option '%c'" ,
288
- short_option);
294
+ error.SetErrorStringWithFormat (
295
+ " invalid boolean value for option '%c': %s" , short_option,
296
+ option_arg);
289
297
else {
290
298
m_step_out_avoid_no_debug = avoid_no_debug ? eLazyBoolYes : eLazyBoolNo;
291
299
}
292
300
} break ;
293
301
294
302
case ' c' :
295
303
if (option_arg.getAsInteger (0 , m_step_count))
296
- error.SetErrorStringWithFormat (" invalid step count '%s'" ,
297
- option_arg.str ().c_str ());
304
+ error.SetErrorStringWithFormat (
305
+ " invalid integer value for option '%c': %s" , short_option,
306
+ option_arg.data ());
298
307
break ;
299
308
300
309
case ' m' : {
0 commit comments