The r117616 check in broken these two test cases:

1. FoundationDisassembleTestCase.test_simple_disasm_with_dsym; and
2. FoundationDisassembleTestCase.test_simple_disasm_with_dwarf

the reason being the test was issuing 'disassemble' command to disassemble the current
frame function when stopped.  The 'disassemble' command worked previously but it was a
result of bad option specification.

Fix the disassemble command so that it will require 'disassemble -f' for disassembly of
the current frame function.

llvm-svn: 117688
This commit is contained in:
Johnny Chen 2010-10-29 19:33:40 +00:00
parent 6ae3fba7c8
commit 8ceb8ba2fb
2 changed files with 11 additions and 5 deletions

View File

@ -90,6 +90,11 @@ CommandObjectDisassemble::CommandOptions::SetOptionValue (int option_idx, const
raw = true;
break;
case 'f':
// The default action is to disassemble the function for the current frame.
// There's no need to set any flag.
break;
default:
error.SetErrorStringWithFormat("Unrecognized short option '%c'.\n", short_option);
break;
@ -130,7 +135,7 @@ CommandObjectDisassemble::CommandOptions::g_option_table[] =
{ LLDB_OPT_SET_2, true, "name", 'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName, "Disassemble entire contents of the given function name."},
//{ LLDB_OPT_SET_3, false, "current-frame", 'f', no_argument, NULL, 0, eArgTypeNone, "Disassemble entire contents of the current frame's function."},
{ LLDB_OPT_SET_3, true, "current-frame", 'f', no_argument, NULL, 0, eArgTypeNone, "Disassemble entire contents of the current frame's function."},
{ 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
};
@ -244,6 +249,7 @@ CommandObjectDisassemble::Execute
}
else
{
// The default action is to disassemble the current frame function.
if (exe_ctx.frame)
{
SymbolContext sc(exe_ctx.frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextSymbol));

View File

@ -92,7 +92,7 @@ class FoundationDisassembleTestCase(TestBase):
substrs = ["Foundation`+[NSString stringWithFormat:]"])
# Do the disassemble for the currently stopped function.
self.runCmd("disassemble")
self.runCmd("disassemble -f")
self.runCmd("process continue")
@ -101,7 +101,7 @@ class FoundationDisassembleTestCase(TestBase):
substrs = ["a.out`-[MyString initWithNSString:]"])
# Do the disassemble for the currently stopped function.
self.runCmd("disassemble")
self.runCmd("disassemble -f")
self.runCmd("process continue")
@ -110,7 +110,7 @@ class FoundationDisassembleTestCase(TestBase):
substrs = ["a.out`-[MyString description]"])
# Do the disassemble for the currently stopped function.
self.runCmd("disassemble")
self.runCmd("disassemble -f")
self.runCmd("process continue")
@ -119,7 +119,7 @@ class FoundationDisassembleTestCase(TestBase):
substrs = ["Foundation`-[NSAutoreleasePool release]"])
# Do the disassemble for the currently stopped function.
self.runCmd("disassemble")
self.runCmd("disassemble -f")
if __name__ == '__main__':