diff options
Diffstat (limited to 'lldb/source/Core/RegisterValue.cpp')
| -rw-r--r-- | lldb/source/Core/RegisterValue.cpp | 42 |
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; |

