[Lldb-commits] [lldb] r114361 - in /lldb/trunk: include/lldb/Core/Debugger.h include/lldb/Core/UserSettingsController.h include/lldb/Target/Process.h include/lldb/Target/Target.h include/lldb/Target/Thread.h source/Core/Debugger.cpp source/Core/UserSettingsController.cpp source/Target/Process.cpp source/Target/Target.cpp source/Target/Thread.cpp
Caroline Tice
ctice at apple.com
Mon Sep 20 14:37:42 PDT 2010
Author: ctice
Date: Mon Sep 20 16:37:42 2010
New Revision: 114361
URL: http://llvm.org/viewvc/llvm-project?rev=114361&view=rev
Log:
Make GetInstanceSettingsValue methods take an Error * rather than an Error &,
and have them return a bool to indicate success or not.
Modified:
lldb/trunk/include/lldb/Core/Debugger.h
lldb/trunk/include/lldb/Core/UserSettingsController.h
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/include/lldb/Target/Thread.h
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Core/UserSettingsController.cpp
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/Target.cpp
lldb/trunk/source/Target/Thread.cpp
Modified: lldb/trunk/include/lldb/Core/Debugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=114361&r1=114360&r2=114361&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Debugger.h (original)
+++ lldb/trunk/include/lldb/Core/Debugger.h Mon Sep 20 16:37:42 2010
@@ -60,11 +60,11 @@
Error &err,
bool pending);
- void
+ bool
GetInstanceSettingsValue (const SettingEntry &entry,
const ConstString &var_name,
StringList &value,
- Error &err);
+ Error *err);
uint32_t
GetTerminalWidth () const
Modified: lldb/trunk/include/lldb/Core/UserSettingsController.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/UserSettingsController.h?rev=114361&r1=114360&r2=114361&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/UserSettingsController.h (original)
+++ lldb/trunk/include/lldb/Core/UserSettingsController.h Mon Sep 20 16:37:42 2010
@@ -370,11 +370,11 @@
Error &err,
bool pending) = 0;
- virtual void
+ virtual bool
GetInstanceSettingsValue (const SettingEntry &entry,
const ConstString &var_name,
StringList &value,
- Error &err) = 0;
+ Error *err) = 0;
virtual void
CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=114361&r1=114360&r2=114361&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Mon Sep 20 16:37:42 2010
@@ -69,11 +69,11 @@
Error &err,
bool pending);
- void
+ bool
GetInstanceSettingsValue (const SettingEntry &entry,
const ConstString &var_name,
StringList &value,
- Error &err);
+ Error *err);
const Args &
Modified: lldb/trunk/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=114361&r1=114360&r2=114361&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Mon Sep 20 16:37:42 2010
@@ -56,11 +56,11 @@
Error &err,
bool pending);
- void
+ bool
GetInstanceSettingsValue (const SettingEntry &entry,
const ConstString &var_name,
StringList &value,
- Error &err);
+ Error *err);
protected:
Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=114361&r1=114360&r2=114361&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Mon Sep 20 16:37:42 2010
@@ -50,11 +50,11 @@
Error &err,
bool pending);
- void
+ bool
GetInstanceSettingsValue (const SettingEntry &entry,
const ConstString &var_name,
StringList &value,
- Error &err);
+ Error *err);
RegularExpression *
GetSymbolsToAvoidRegexp()
Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=114361&r1=114360&r2=114361&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Mon Sep 20 16:37:42 2010
@@ -1375,11 +1375,11 @@
}
}
-void
+bool
DebuggerInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
const ConstString &var_name,
StringList &value,
- Error &err)
+ Error *err)
{
if (var_name == PromptVarName())
{
@@ -1404,7 +1404,12 @@
value.AppendString ("false");
}
else
- err.SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+ {
+ if (err)
+ err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+ return false;
+ }
+ return true;
}
void
Modified: lldb/trunk/source/Core/UserSettingsController.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/UserSettingsController.cpp?rev=114361&r1=114360&r2=114361&view=diff
==============================================================================
--- lldb/trunk/source/Core/UserSettingsController.cpp (original)
+++ lldb/trunk/source/Core/UserSettingsController.cpp Mon Sep 20 16:37:42 2010
@@ -562,7 +562,7 @@
if (current_settings != NULL)
{
- current_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, err);
+ current_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
}
else
{
@@ -575,14 +575,14 @@
if (pos != m_pending_settings.end())
{
lldb::InstanceSettingsSP settings_sp = pos->second;
- settings_sp->GetInstanceSettingsValue (*instance_entry, const_var_name, value, err);
+ settings_sp->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
}
else
{
if (m_settings.level_name.GetLength() > 0)
{
// No valid instance name; assume they want the default settings.
- m_default_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, err);
+ m_default_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
}
else
{
@@ -595,7 +595,7 @@
ConstString dbg_name (debugger_instance_name);
InstanceSettings *dbg_settings = FindSettingsForInstance (dbg_name);
if (dbg_settings)
- dbg_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, err);
+ dbg_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
}
}
}
@@ -621,7 +621,7 @@
{
var_type = instance_entry->var_type;
if (m_settings.level_name.GetLength() > 0)
- m_default_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, err);
+ m_default_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
else
{
// We're at the Debugger level; use the debugger's instance settings.
@@ -633,7 +633,7 @@
ConstString dbg_name (tmp_name.GetData());
InstanceSettings *dbg_settings = FindSettingsForInstance (dbg_name);
if (dbg_settings)
- dbg_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, err);
+ dbg_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
}
}
}
@@ -716,7 +716,7 @@
SettingEntry &entry = m_settings.instance_settings[i];
ConstString var_name (entry.var_name);
StringList value;
- m_default_settings->GetInstanceSettingsValue (entry, var_name, value, err);
+ m_default_settings->GetInstanceSettingsValue (entry, var_name, value, NULL);
std::string value_str;
if (value.GetSize() == 1)
@@ -777,8 +777,7 @@
SettingEntry &entry = m_settings.instance_settings[i];
ConstString var_name (entry.var_name);
StringList tmp_value;
- Error err;
- m_default_settings->GetInstanceSettingsValue (entry, var_name, tmp_value, err);
+ m_default_settings->GetInstanceSettingsValue (entry, var_name, tmp_value, NULL);
StreamString value_string;
@@ -817,8 +816,7 @@
SettingEntry &entry = m_settings.instance_settings[i];
ConstString var_name (entry.var_name);
StringList tmp_value;
- Error err;
- settings_sp->GetInstanceSettingsValue (entry, var_name, tmp_value, err);
+ settings_sp->GetInstanceSettingsValue (entry, var_name, tmp_value, NULL);
StreamString value_str;
@@ -884,8 +882,7 @@
SettingEntry &entry = m_settings.instance_settings[i];
const ConstString var_name (entry.var_name);
StringList tmp_value;
- Error err;
- settings->GetInstanceSettingsValue (entry, var_name, tmp_value, err);
+ settings->GetInstanceSettingsValue (entry, var_name, tmp_value, NULL);
StreamString tmp_value_str;
if (tmp_value.GetSize() == 0)
Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=114361&r1=114360&r2=114361&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Mon Sep 20 16:37:42 2010
@@ -1988,11 +1988,11 @@
m_disable_aslr = new_process_settings->m_disable_aslr;
}
-void
+bool
ProcessInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
const ConstString &var_name,
StringList &value,
- Error &err)
+ Error *err)
{
if (var_name == RunArgsVarName())
{
@@ -2039,7 +2039,12 @@
value.AppendString ("false");
}
else
- err.SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+ {
+ if (err)
+ err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+ return false;
+ }
+ return true;
}
const ConstString
Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=114361&r1=114360&r2=114361&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Mon Sep 20 16:37:42 2010
@@ -934,11 +934,11 @@
// Currently 'target' does not have any instance settings.
}
-void
+bool
TargetInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
const ConstString &var_name,
StringList &value,
- Error &err)
+ Error *err)
{
// Currently 'target' does not have any instance settings.
}
Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=114361&r1=114360&r2=114361&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Mon Sep 20 16:37:42 2010
@@ -1062,11 +1062,11 @@
m_avoid_regexp_ap.reset ();
}
-void
+bool
ThreadInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
const ConstString &var_name,
StringList &value,
- Error &err)
+ Error *err)
{
if (var_name == StepAvoidRegexpVarName())
{
@@ -1080,7 +1080,12 @@
}
else
- err.SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+ {
+ if (err)
+ err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+ return false;
+ }
+ return true;
}
const ConstString
More information about the lldb-commits
mailing list