22
22
#include " lldb/Interpreter/NamedOptionValue.h"
23
23
#include " lldb/Interpreter/Options.h"
24
24
#include " lldb/Target/ExecutionContext.h"
25
+ #include " lldb/Target/Process.h"
25
26
#include " lldb/Target/RegisterContext.h"
27
+ #include " lldb/Target/Thread.h"
26
28
27
29
using namespace lldb ;
28
30
using namespace lldb_private ;
@@ -90,7 +92,8 @@ class CommandObjectRegisterRead : public CommandObject
90
92
format = m_options.format ;
91
93
92
94
reg_data.Dump (&strm, 0 , format, reg_info->byte_size , 1 , UINT32_MAX, LLDB_INVALID_ADDRESS, 0 , 0 );
93
- if (m_options.lookup_addresses && ((reg_info->encoding == eEncodingUint) || (reg_info->encoding == eEncodingSint)))
95
+ if (((reg_info->encoding == eEncodingUint) || (reg_info->encoding == eEncodingSint)) &&
96
+ (reg_info->byte_size == reg_ctx->GetThread ().GetProcess ().GetAddressByteSize ()))
94
97
{
95
98
addr_t reg_addr = reg_ctx->ReadRegisterAsUnsigned (reg, 0 );
96
99
if (reg_addr)
@@ -101,9 +104,6 @@ class CommandObjectRegisterRead : public CommandObject
101
104
strm.PutCString (" " );
102
105
so_reg_addr.Dump (&strm, exe_ctx.GetBestExecutionContextScope (), Address::DumpStyleResolvedDescription);
103
106
}
104
- else
105
- {
106
- }
107
107
}
108
108
}
109
109
strm.EOL ();
@@ -246,8 +246,7 @@ class CommandObjectRegisterRead : public CommandObject
246
246
CommandOptions (CommandInterpreter &interpreter) :
247
247
Options (interpreter),
248
248
set_indexes (OptionValue::ConvertTypeToMask (OptionValue::eTypeUInt64)),
249
- dump_all_sets (false , false ), // Initial and default values are false
250
- lookup_addresses (false , false ) // Initial and default values are false
249
+ dump_all_sets (false , false ) // Initial and default values are false
251
250
{
252
251
OptionParsingStarting ();
253
252
}
@@ -280,10 +279,6 @@ class CommandObjectRegisterRead : public CommandObject
280
279
dump_all_sets.SetCurrentValue (true );
281
280
break ;
282
281
283
- case ' l' :
284
- lookup_addresses.SetCurrentValue (true );
285
- break ;
286
-
287
282
default :
288
283
error.SetErrorStringWithFormat (" Unrecognized short option '%c'\n " , short_option);
289
284
break ;
@@ -297,7 +292,6 @@ class CommandObjectRegisterRead : public CommandObject
297
292
format = eFormatDefault;
298
293
set_indexes.Clear ();
299
294
dump_all_sets.Clear ();
300
- lookup_addresses.Clear ();
301
295
}
302
296
303
297
const OptionDefinition*
@@ -314,7 +308,6 @@ class CommandObjectRegisterRead : public CommandObject
314
308
lldb::Format format;
315
309
OptionValueArray set_indexes;
316
310
OptionValueBoolean dump_all_sets;
317
- OptionValueBoolean lookup_addresses;
318
311
};
319
312
320
313
CommandOptions m_options;
@@ -324,7 +317,6 @@ OptionDefinition
324
317
CommandObjectRegisterRead::CommandOptions::g_option_table[] =
325
318
{
326
319
{ LLDB_OPT_SET_ALL, false , " format" , ' f' , required_argument, NULL , 0 , eArgTypeExprFormat, " Specify the format to use when dumping register values." },
327
- { LLDB_OPT_SET_ALL, false , " lookup" , ' l' , no_argument , NULL , 0 , eArgTypeNone , " Lookup the register values as addresses and show that each value maps to in the address space." },
328
320
{ LLDB_OPT_SET_1 , false , " set" , ' s' , required_argument, NULL , 0 , eArgTypeIndex , " Specify which register sets to dump by index." },
329
321
{ LLDB_OPT_SET_2 , false , " all" , ' a' , no_argument , NULL , 0 , eArgTypeNone , " Show all register sets." },
330
322
{ 0 , false , NULL , 0 , 0 , NULL , NULL , eArgTypeNone, NULL }
0 commit comments