Did some work on the "register read" command to only show the first register
set by default when dumping registers. If you want to see all of the register
sets you can use the "--all" option:
(lldb) register read --all
If you want to just see some register sets, you can currently specify them
by index:
(lldb) register read --set 0 --set 2
We need to get shorter register set names soon so we can specify the register
sets by name without having to type too much. I will make this change soon.
You can also have any integer encoded registers resolve the address values
back to any code or data from the object files using the "--lookup" option.
Below is sample output when stopped in the libc function "puts" with some
const strings in registers:
Process 8973 stopped
* thread #1: tid = 0x2c03, 0x00007fff828fa30f libSystem.B.dylib`puts + 1, stop reason = instruction step into
frame #0: 0x00007fff828fa30f libSystem.B.dylib`puts + 1
(lldb) register read --lookup
General Purpose Registers:
rax = 0x0000000100000e98 "----------------------------------------------------------------------"
rbx = 0x0000000000000000
rcx = 0x0000000000000001
rdx = 0x0000000000000000
rdi = 0x0000000100000e98 "----------------------------------------------------------------------"
rsi = 0x0000000100800000
rbp = 0x00007fff5fbff710
rsp = 0x00007fff5fbff280
r8 = 0x0000000000000040
r9 = 0x0000000000000000
r10 = 0x0000000000000000
r11 = 0x0000000000000246
r12 = 0x0000000000000000
r13 = 0x0000000000000000
r14 = 0x0000000000000000
r15 = 0x0000000000000000
rip = 0x00007fff828fa30f libSystem.B.dylib`puts + 1
rflags = 0x0000000000000246
cs = 0x0000000000000027
fs = 0x0000000000000000
gs = 0x0000000000000000
As we can see, we see two constant strings and the PC (register "rip") is
showing the code it resolves to.
I fixed the register "--format" option to work as expected.
Added a setting to disable skipping the function prologue when setting
breakpoints as a target settings variable:
(lldb) settings set target.skip-prologue false
Updated the user settings controller boolean value handler funciton to be able
to take the default value so it can correctly respond to the eVarSetOperationClear
operation.
Did some usability work on the OptionValue classes.
Fixed the "image lookup" command to correctly respond to the "--verbose"
option and display the detailed symbol context information when looking up
line table entries and functions by name. This previously was only working
for address lookups.
llvm-svn: 129977
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 1dadb50..3a1ae1e 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -1290,6 +1290,7 @@
#define TSC_DEFAULT_ARCH "default-arch"
#define TSC_EXPR_PREFIX "expr-prefix"
#define TSC_PREFER_DYNAMIC "prefer-dynamic-value"
+#define TSC_SKIP_PROLOGUE "skip-prologue"
static const ConstString &
@@ -1315,6 +1316,15 @@
}
+static const ConstString &
+GetSettingNameForSkipPrologue ()
+{
+ static ConstString g_const_string (TSC_SKIP_PROLOGUE);
+ return g_const_string;
+}
+
+
+
bool
Target::SettingsController::SetGlobalVariable (const ConstString &var_name,
const char *index_value,
@@ -1364,7 +1374,8 @@
InstanceSettings (owner, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance),
m_expr_prefix_path (),
m_expr_prefix_contents (),
- m_prefer_dynamic_value (true)
+ m_prefer_dynamic_value (true),
+ m_skip_prologue (true)
{
// CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
// until the vtables for TargetInstanceSettings are properly set up, i.e. AFTER all the initializers.
@@ -1381,7 +1392,6 @@
{
const lldb::InstanceSettingsSP &pending_settings = m_owner.FindPendingSettings (m_instance_name);
CopyInstanceSettings (pending_settings,false);
- //m_owner.RemovePendingSettings (m_instance_name);
}
}
@@ -1392,7 +1402,6 @@
{
const lldb::InstanceSettingsSP &pending_settings = m_owner.FindPendingSettings (m_instance_name);
CopyInstanceSettings (pending_settings,false);
- //m_owner.RemovePendingSettings (m_instance_name);
}
}
@@ -1464,36 +1473,11 @@
}
else if (var_name == GetSettingNameForPreferDynamicValue())
{
- switch (op)
- {
- default:
- err.SetErrorToGenericError ();
- err.SetErrorString ("Unrecognized operation. Cannot update value.\n");
- return;
- case eVarSetOperationAssign:
- {
- bool success;
- bool result = Args::StringToBoolean(value, false, &success);
-
- if (success)
- {
- m_prefer_dynamic_value = result;
- }
- else
- {
- err.SetErrorStringWithFormat ("Bad value \"%s\" for %s, should be Boolean.",
- value,
- GetSettingNameForPreferDynamicValue().AsCString());
- }
- return;
- }
- case eVarSetOperationClear:
- m_prefer_dynamic_value = true;
- case eVarSetOperationAppend:
- err.SetErrorToGenericError ();
- err.SetErrorString ("Cannot append to a bool.\n");
- return;
- }
+ UserSettingsController::UpdateBooleanVariable (op, m_prefer_dynamic_value, value, true, err);
+ }
+ else if (var_name == GetSettingNameForSkipPrologue())
+ {
+ UserSettingsController::UpdateBooleanVariable (op, m_skip_prologue, value, true, err);
}
}
@@ -1527,6 +1511,13 @@
else
value.AppendString ("false");
}
+ else if (var_name == GetSettingNameForSkipPrologue())
+ {
+ if (m_skip_prologue)
+ value.AppendString ("true");
+ else
+ value.AppendString ("false");
+ }
else
{
if (err)
@@ -1570,5 +1561,6 @@
// ================= ================== =========== ==== ====== ====== =========================================================================
{ TSC_EXPR_PREFIX , eSetVarTypeString , NULL , NULL, false, false, "Path to a file containing expressions to be prepended to all expressions." },
{ TSC_PREFER_DYNAMIC, eSetVarTypeBoolean ,"true" , NULL, false, false, "Should printed values be shown as their dynamic value." },
+ { TSC_SKIP_PROLOGUE , eSetVarTypeBoolean ,"true" , NULL, false, false, "Skip function prologues when setting breakpoints by name." },
{ NULL , eSetVarTypeNone , NULL , NULL, false, false, NULL }
};