Skip to content

Commit 65045f2

Browse files
author
Johnny Chen
committed
o TestStdCXXDisassembly.py:
Update the expected match string. o lldbtest.py: Indicate when a command fails, even if there is nothing in the error stream. o TestHelp.py: Add a regression test case for 'help image dump symtab'. o CommandObjectHelp.cpp: Some of the logic branches with successful help command results were not tagged with a Success Status. They are fixed now. This is important for Python interaction. llvm-svn: 116062
1 parent dd1c289 commit 65045f2

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

lldb/source/Commands/CommandObjectHelp.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ CommandObjectHelp::Execute (Args& command, CommandReturnObject &result)
121121
if ((long_help != NULL)
122122
&& (strlen (long_help) > 0))
123123
output_strm.Printf ("\n%s", long_help);
124+
// Mark this help command with a success status.
125+
result.SetStatus (eReturnStatusSuccessFinishNoResult);
124126
}
125127
else if (sub_cmd_obj->IsMultiwordObject())
126128
{
@@ -149,6 +151,8 @@ CommandObjectHelp::Execute (Args& command, CommandReturnObject &result)
149151
else
150152
m_interpreter.OutputFormattedHelpText (output_strm, "", "", sub_cmd_obj->GetHelp(), 1);
151153
output_strm.Printf ("\nSyntax: %s\n", sub_cmd_obj->GetSyntax());
154+
// Mark this help command with a success status.
155+
result.SetStatus (eReturnStatusSuccessFinishNoResult);
152156
}
153157
}
154158
}

lldb/test/help/TestHelp.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Test lldb help command.
2+
Test some lldb help commands.
33
44
See also CommandInterpreter::OutputFormattedHelpText().
55
"""
@@ -24,6 +24,12 @@ def test_help_should_not_hang_emacsshell(self):
2424
self.expect("help",
2525
startstr = 'The following is a list of built-in, permanent debugger commands')
2626

27+
def test_help_image_dump_symtab_should_not_crash(self):
28+
"""Command 'help image dump symtab' should not crash lldb."""
29+
self.expect("help image dump symtab",
30+
substrs = ['image dump symtab',
31+
'sort-order'])
32+
2733

2834
if __name__ == '__main__':
2935
import atexit

lldb/test/lldbtest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ def runCmd(self, cmd, msg=None, check=True, trace=False, setCookie=True):
392392
if self.res.Succeeded():
393393
print >> sys.stderr, "output:", self.res.GetOutput()
394394
else:
395+
print >> sys.stderr, "runCmd failed!"
395396
print >> sys.stderr, self.res.GetError()
396397

397398
if running:

lldb/test/stl/TestStdCXXDisassembly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_stdcxx_disasm(self):
3333
# The process should be in a 'Stopped' state.
3434
self.expect(repr(process), STOPPED_DUE_TO_BREAKPOINT, exe=False,
3535
substrs = ["a.out",
36-
"state: Stopped"])
36+
"Stopped"])
3737

3838
# Disassemble the functions on the call stack.
3939
self.runCmd("thread backtrace")

0 commit comments

Comments
 (0)