diff options
author | Jim Ingham <jingham@apple.com> | 2012-04-26 21:39:32 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2012-04-26 21:39:32 +0000 |
commit | 57190baa6c6b07378456834d8fb08d723f3f22ce (patch) | |
tree | 4bcc8116bcb52425e19892e026c2b9efe25ef9d4 /lldb/source/Core/Debugger.cpp | |
parent | 2faa82d4b8d79c4f4bdfb2991687212251b004b1 (diff) | |
download | bcm5719-llvm-57190baa6c6b07378456834d8fb08d723f3f22ce.tar.gz bcm5719-llvm-57190baa6c6b07378456834d8fb08d723f3f22ce.zip |
Don't call SBDebugger::SetInternalVariable in the sigwinch_handler, since that takes locks and potentially does allocations.
Just call SBDebugger::SetTerminalWidth on the driver's SBDebugger, which does the same job, but no locks.
Also add the value checking to SetTerminalWidth you get with SetInternalVariable(..., "term-width", ...).
rdar://problem/11310563
llvm-svn: 155665
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
-rw-r--r-- | lldb/source/Core/Debugger.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 6bb68db42f1..9a7a3f57620 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -2523,10 +2523,7 @@ DebuggerInstanceSettings::ValidTermWidthValue (const char *value, Error err) if (end && end[0] == '\0') { - if (width >= 10 && width <= 1024) - valid = true; - else - err.SetErrorString ("invalid term-width value; value must be between 10 and 1024"); + return ValidTermWidthValue (width, err); } else err.SetErrorStringWithFormat ("'%s' is not a valid unsigned integer string", value); @@ -2535,6 +2532,17 @@ DebuggerInstanceSettings::ValidTermWidthValue (const char *value, Error err) return valid; } +bool +DebuggerInstanceSettings::ValidTermWidthValue (uint32_t value, Error err) +{ + if (value >= 10 && value <= 1024) + return true; + else + { + err.SetErrorString ("invalid term-width value; value must be between 10 and 1024"); + return false; + } +} void DebuggerInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name, |