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
This commit is contained in:
Jim Ingham
2012-04-26 21:39:32 +00:00
parent 2faa82d4b8
commit 57190baa6c
3 changed files with 20 additions and 9 deletions

View File

@@ -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,