summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectDisassemble.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-12-06 22:49:16 +0000
committerGreg Clayton <gclayton@apple.com>2012-12-06 22:49:16 +0000
commitb9d5df58d4312bb7d9602b870df13a0713509f94 (patch)
tree5fd570e84261278d1173cf0358f84581b14854a9 /lldb/source/Commands/CommandObjectDisassemble.cpp
parent39dd38c06185542e44e82f938824e041685b95c6 (diff)
downloadbcm5719-llvm-b9d5df58d4312bb7d9602b870df13a0713509f94.tar.gz
bcm5719-llvm-b9d5df58d4312bb7d9602b870df13a0713509f94.zip
<rdar://problem/12820334>
I modified the "Args::StringtoAddress(...)" function to be able to evaluate address expressions. This is now used for any command line arguments or options that takes addresses like: memory read <addr> [<end-addr>] memory write <addr> breakpoint set --address <addr> disassemble --start-address <addr> --end-address <addr> It calls the expression parser to evaluate the address expression and will also work around the issue where the compiler doesn't like to add offsets to function pointers (which is what happens when you try to evaluate "main + 12"). So there is a temp fix in the Args::StringtoAddress() to work around this until we can get special compiler support for debug expressions with function pointers. llvm-svn: 169556
Diffstat (limited to 'lldb/source/Commands/CommandObjectDisassemble.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectDisassemble.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp
index 84172dc87ed..291b527ae4a 100644
--- a/lldb/source/Commands/CommandObjectDisassemble.cpp
+++ b/lldb/source/Commands/CommandObjectDisassemble.cpp
@@ -88,23 +88,21 @@ CommandObjectDisassemble::CommandOptions::SetOptionValue (uint32_t option_idx, c
break;
case 's':
- start_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 0);
- if (start_addr == LLDB_INVALID_ADDRESS)
- start_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 16);
-
- if (start_addr == LLDB_INVALID_ADDRESS)
- error.SetErrorStringWithFormat ("invalid start address string '%s'", option_arg);
- some_location_specified = true;
+ {
+ ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
+ start_addr = Args::StringToAddress(&exe_ctx, option_arg, LLDB_INVALID_ADDRESS, &error);
+ if (start_addr != LLDB_INVALID_ADDRESS)
+ some_location_specified = true;
+ }
break;
case 'e':
- end_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 0);
- if (end_addr == LLDB_INVALID_ADDRESS)
- end_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 16);
-
- if (end_addr == LLDB_INVALID_ADDRESS)
- error.SetErrorStringWithFormat ("invalid end address string '%s'", option_arg);
+ {
+ ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
+ end_addr = Args::StringToAddress(&exe_ctx, option_arg, LLDB_INVALID_ADDRESS, &error);
+ if (end_addr != LLDB_INVALID_ADDRESS)
+ some_location_specified = true;
+ }
break;
- some_location_specified = true;
case 'n':
func_name.assign (option_arg);
some_location_specified = true;
OpenPOWER on IntegriCloud