Skip to content

Commit c60695a

Browse files
committed
Fix the "target stop-hook add" input reader so that it won't say the stop hook was added if the input was interrupted.
llvm-svn: 130907
1 parent 330a5b4 commit c60695a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lldb/source/Commands/CommandObjectTarget.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3077,6 +3077,7 @@ class CommandObjectTargetStopHookAdd : public CommandObject
30773077
{
30783078
File &out_file = reader.GetDebugger().GetOutputFile();
30793079
Target::StopHook *new_stop_hook = ((Target::StopHook *) baton);
3080+
static bool got_interrupted;
30803081

30813082
switch (notification)
30823083
{
@@ -3085,6 +3086,7 @@ class CommandObjectTargetStopHookAdd : public CommandObject
30853086
if (reader.GetPrompt())
30863087
out_file.Printf ("%s", reader.GetPrompt());
30873088
out_file.Flush();
3089+
got_interrupted = false;
30883090
break;
30893091

30903092
case eInputReaderDeactivate:
@@ -3096,6 +3098,7 @@ class CommandObjectTargetStopHookAdd : public CommandObject
30963098
out_file.Printf ("%s", reader.GetPrompt());
30973099
out_file.Flush();
30983100
}
3101+
got_interrupted = false;
30993102
break;
31003103

31013104
case eInputReaderAsynchronousOutputWritten:
@@ -3125,14 +3128,16 @@ class CommandObjectTargetStopHookAdd : public CommandObject
31253128

31263129
reader.SetIsDone (true);
31273130
}
3131+
got_interrupted = true;
31283132
break;
31293133

31303134
case eInputReaderEndOfFile:
31313135
reader.SetIsDone (true);
31323136
break;
31333137

31343138
case eInputReaderDone:
3135-
out_file.Printf ("Stop hook #%d added.\n", new_stop_hook->GetID());
3139+
if (!got_interrupted)
3140+
out_file.Printf ("Stop hook #%d added.\n", new_stop_hook->GetID());
31363141
break;
31373142
}
31383143

0 commit comments

Comments
 (0)