Fixed process.gdb-remote to be able to properly propagate the signals and

obey the UnixSignals table that we have in the process.

llvm-svn: 116139
This commit is contained in:
Greg Clayton 2010-10-09 01:40:57 +00:00
parent a2fabff4f6
commit 237cd90620
4 changed files with 50 additions and 38 deletions

View File

@ -846,8 +846,15 @@ public:
if (command.GetArgumentCount() == 1)
{
int signo = Args::StringToSInt32(command.GetArgumentAtIndex(0), -1, 0);
if (signo == -1)
int signo = LLDB_INVALID_SIGNAL_NUMBER;
const char *signal_name = command.GetArgumentAtIndex(0);
if (::isxdigit (signal_name[0]))
signo = Args::StringToSInt32(signal_name, LLDB_INVALID_SIGNAL_NUMBER, 0);
else
signo = process->GetUnixSignals().GetSignalNumberFromName (signal_name);
if (signo == LLDB_INVALID_SIGNAL_NUMBER)
{
result.AppendErrorWithFormat ("Invalid signal argument '%s'.\n", command.GetArgumentAtIndex(0));
result.SetStatus (eReturnStatusFailed);

View File

@ -678,7 +678,7 @@ CommandObject::g_arguments_data[] =
{ eArgTypeSettingVariableName, "setting-variable-name", CommandCompletions::eNoCompletion, NULL, "The name of a settable internal debugger variable. Type 'settings list' to see a complete list of such variables." },
{ eArgTypeShlibName, "shlib-name", CommandCompletions::eNoCompletion, NULL, "The name of a shared library." },
{ eArgTypeSourceFile, "source-file", CommandCompletions::eNoCompletion, NULL, "The name of a source file.." },
{ eArgTypeSortOrder, "sort-order", CommandCompletions::eNoCompletion, NULL, "The sort order when dumping the symbol table." },
{ eArgTypeSortOrder, "sort-order", CommandCompletions::eNoCompletion, NULL, "Specify a sort order when dumping lists." },
{ eArgTypeStartAddress, "start-address", CommandCompletions::eNoCompletion, NULL, "Help text goes here." },
{ eArgTypeSymbol, "symbol", CommandCompletions::eNoCompletion, NULL, "Any symbol name (function name, variable, argument, etc.)" },
{ eArgTypeThreadID, "thread-id", CommandCompletions::eNoCompletion, NULL, "Thread ID number." },

View File

@ -78,8 +78,12 @@ ThreadGDBRemote::GetQueueName ()
bool
ThreadGDBRemote::WillResume (StateType resume_state)
{
// TODO: cache for next time in case we can match things up??
ClearStackFrames();
// Call the Thread::WillResume first. If we stop at a signal, the stop info
// class for signal will set the resume signal that we need below. The signal
// stuff obeys the Process::UnixSignal defaults.
Thread::WillResume(resume_state);
int signo = GetResumeSignal();
switch (resume_state)
@ -106,7 +110,6 @@ ThreadGDBRemote::WillResume (StateType resume_state)
default:
break;
}
Thread::WillResume(resume_state);
return true;
}

View File

@ -47,7 +47,8 @@ UnixSignals::Reset ()
// order, you can either subclass this class, and use Add & Remove to change them
// or you can subclass and build them afresh in your constructor;
m_signals.clear();
// SIGNO NAME SUPPRESS STOP NOTIFY
// ===== ============ ========= ====== ======
AddSignal(1, "SIGHUP", false, true, true ); // 1 hangup
AddSignal(2, "SIGINT", true, true, true ); // 2 interrupt
AddSignal(3, "SIGQUIT", false, true, true ); // 3 quit
@ -80,6 +81,7 @@ UnixSignals::Reset ()
AddSignal(30, "SIGUSR1", false, true, true ); // 30 user defined signal 1
AddSignal(31, "SIGUSR2", false, true, true ); // 31 user defined signal 2
}
void
UnixSignals::AddSignal (int signo, const char *name, bool default_suppress, bool default_stop, bool default_notify)
{