summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/RegisterValue.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-05-15 04:12:07 +0000
committerGreg Clayton <gclayton@apple.com>2011-05-15 04:12:07 +0000
commit9a8fa9161fbed411f4e34c551bc7033b64fd72d1 (patch)
tree491428ee7d69700d75372a7057beea1156c2eda6 /lldb/source/Core/RegisterValue.cpp
parent745ae2853c4812300823b77f1f0a88019d3b9da0 (diff)
downloadbcm5719-llvm-9a8fa9161fbed411f4e34c551bc7033b64fd72d1.tar.gz
bcm5719-llvm-9a8fa9161fbed411f4e34c551bc7033b64fd72d1.zip
Added generic register numbers for simple ABI argument registers and defined
the appropriate registers for arm and x86_64. The register names for the arguments that are the size of a pointer or less are all named "arg1", "arg2", etc. This allows you to read these registers by name: (lldb) register read arg1 arg2 arg3 ... You can also now specify you want to see alternate register names when executing the read register command: (lldb) register read --alternate (lldb) register read -A llvm-svn: 131376
Diffstat (limited to 'lldb/source/Core/RegisterValue.cpp')
-rw-r--r--lldb/source/Core/RegisterValue.cpp42
1 files changed, 39 insertions, 3 deletions
diff --git a/lldb/source/Core/RegisterValue.cpp b/lldb/source/Core/RegisterValue.cpp
index bc66a8c2185..7e7b3811338 100644
--- a/lldb/source/Core/RegisterValue.cpp
+++ b/lldb/source/Core/RegisterValue.cpp
@@ -24,13 +24,49 @@ using namespace lldb_private;
bool
-RegisterValue::Dump (Stream *s, const RegisterInfo *reg_info, bool prefix_with_name, Format format) const
+RegisterValue::Dump (Stream *s,
+ const RegisterInfo *reg_info,
+ bool prefix_with_name,
+ bool prefix_with_alt_name,
+ Format format) const
{
DataExtractor data;
if (GetData (data))
{
- if (prefix_with_name && reg_info->name != NULL)
- s->Printf ("%s = ", reg_info->name);
+ bool name_printed = false;
+ if (prefix_with_name)
+ {
+ if (reg_info->name)
+ {
+ s->Printf ("%s", reg_info->name);
+ name_printed = true;
+ }
+ else if (reg_info->alt_name)
+ {
+ s->Printf ("%s", reg_info->alt_name);
+ prefix_with_alt_name = false;
+ name_printed = true;
+ }
+ }
+ if (prefix_with_alt_name)
+ {
+ if (name_printed)
+ s->PutChar ('/');
+ if (reg_info->alt_name)
+ {
+ s->Printf ("%s", reg_info->alt_name);
+ name_printed = true;
+ }
+ else if (!name_printed)
+ {
+ // No alternate name but we were asked to display a name, so show the main name
+ s->Printf ("%s", reg_info->name);
+ name_printed = true;
+ }
+ }
+ if (name_printed)
+ s->PutCString (" = ");
+
if (format == eFormatDefault)
format = reg_info->format;
OpenPOWER on IntegriCloud