diff options
| author | Greg Clayton <gclayton@apple.com> | 2010-10-09 01:40:57 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2010-10-09 01:40:57 +0000 |
| commit | 237cd90620dcd6226d6909b34932d192d3473423 (patch) | |
| tree | ad34e88df14e0daadc6f50b0ae699c06c2abf172 /lldb/source | |
| parent | a2fabff4f6f4ccbbd6d237d6737720a91b6cc030 (diff) | |
| download | bcm5719-llvm-237cd90620dcd6226d6909b34932d192d3473423.tar.gz bcm5719-llvm-237cd90620dcd6226d6909b34932d192d3473423.zip | |
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
Diffstat (limited to 'lldb/source')
| -rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 11 | ||||
| -rw-r--r-- | lldb/source/Interpreter/CommandObject.cpp | 4 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp | 7 | ||||
| -rw-r--r-- | lldb/source/Target/UnixSignals.cpp | 66 |
4 files changed, 50 insertions, 38 deletions
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index c2f43368a96..09459d856b3 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -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); diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 2210fc850a3..0ccb2d75a3d 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -633,7 +633,7 @@ CommandObject::g_arguments_data[] = { { eArgTypeAddress, "address", CommandCompletions::eNoCompletion, NULL, "A valid address in the target program's execution space." }, { eArgTypeAliasName, "alias-name", CommandCompletions::eNoCompletion, NULL, "The name of an abbreviation (alias) for a debugger command." }, - { eArgTypeAliasOptions, "options-for-aliased-command", CommandCompletions::eNoCompletion, NULL, "Command options to be used as part of an alias (abbreviation) definition. (See 'help commands alias' for more information.)" }, + { eArgTypeAliasOptions, "options-for-aliased-command", CommandCompletions::eNoCompletion, NULL, "Command options to be used as part of an alias (abbreviation) definition. (See 'help commands alias' for more information.)" }, { eArgTypeArchitecture, "arch", CommandCompletions::eNoCompletion, NULL, "The architecture name, e.g. i386 or x86_64." }, { eArgTypeBoolean, "boolean", CommandCompletions::eNoCompletion, NULL, "A Boolean value: 'true' or 'false'" }, { eArgTypeBreakpointID, "breakpt-id", CommandCompletions::eNoCompletion, BreakpointIDHelpTextCallback, NULL }, @@ -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." }, diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp index f1847d861da..d6667340e3e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -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; } diff --git a/lldb/source/Target/UnixSignals.cpp b/lldb/source/Target/UnixSignals.cpp index e6500c5dba8..2d6a8b20304 100644 --- a/lldb/source/Target/UnixSignals.cpp +++ b/lldb/source/Target/UnixSignals.cpp @@ -47,39 +47,41 @@ 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(); - - AddSignal(1, "SIGHUP", false, true, true ); // 1 hangup - AddSignal(2, "SIGINT", true, true, true ); // 2 interrupt - AddSignal(3, "SIGQUIT", false, true, true ); // 3 quit - AddSignal(4, "SIGILL", false, true, true ); // 4 illegal instruction (not reset when caught) - AddSignal(5, "SIGTRAP", true, true, true ); // 5 trace trap (not reset when caught) - AddSignal(6, "SIGABRT", false, true, true ); // 6 abort() - AddSignal(7, "SIGEMT", false, true, true ); // 7 pollable event ([XSR] generated, not supported) - AddSignal(8, "SIGFPE", false, true, true ); // 8 floating point exception - AddSignal(9, "SIGKILL", false, true, true ); // 9 kill (cannot be caught or ignored) - AddSignal(10, "SIGBUS", false, true, true ); // 10 bus error - AddSignal(11, "SIGSEGV", false, true, true ); // 11 segmentation violation - AddSignal(12, "SIGSYS", false, true, true ); // 12 bad argument to system call - AddSignal(13, "SIGPIPE", false, true, true ); // 13 write on a pipe with no one to read it - AddSignal(14, "SIGALRM", false, false, true ); // 14 alarm clock - AddSignal(15, "SIGTERM", false, true, true ); // 15 software termination signal from kill - AddSignal(16, "SIGURG", false, false, false); // 16 urgent condition on IO channel - AddSignal(17, "SIGSTOP", false, true, true ); // 17 sendable stop signal not from tty - AddSignal(18, "SIGTSTP", false, true, true ); // 18 stop signal from tty - AddSignal(19, "SIGCONT", false, true, true ); // 19 continue a stopped process - AddSignal(20, "SIGCHLD", false, false, true ); // 20 to parent on child stop or exit - AddSignal(21, "SIGTTIN", false, true, true ); // 21 to readers pgrp upon background tty read - AddSignal(22, "SIGTTOU", false, true, true ); // 22 like TTIN for output if (tp->t_local<OSTOP) - AddSignal(23, "SIGIO", false, false, false); // 23 input/output possible signal - AddSignal(24, "SIGXCPU", false, true, true ); // 24 exceeded CPU time limit - AddSignal(25, "SIGXFSZ", false, true, true ); // 25 exceeded file size limit - AddSignal(26, "SIGVTALRM", false, false, false); // 26 virtual time alarm - AddSignal(27, "SIGPROF", false, false, false); // 27 profiling time alarm - AddSignal(28, "SIGWINCH", false, false, false); // 28 window size changes - AddSignal(29, "SIGINFO", false, true, true ); // 29 information request - AddSignal(30, "SIGUSR1", false, true, true ); // 30 user defined signal 1 - AddSignal(31, "SIGUSR2", false, true, true ); // 31 user defined signal 2 + // 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 + AddSignal(4, "SIGILL", false, true, true ); // 4 illegal instruction (not reset when caught) + AddSignal(5, "SIGTRAP", true, true, true ); // 5 trace trap (not reset when caught) + AddSignal(6, "SIGABRT", false, true, true ); // 6 abort() + AddSignal(7, "SIGEMT", false, true, true ); // 7 pollable event ([XSR] generated, not supported) + AddSignal(8, "SIGFPE", false, true, true ); // 8 floating point exception + AddSignal(9, "SIGKILL", false, true, true ); // 9 kill (cannot be caught or ignored) + AddSignal(10, "SIGBUS", false, true, true ); // 10 bus error + AddSignal(11, "SIGSEGV", false, true, true ); // 11 segmentation violation + AddSignal(12, "SIGSYS", false, true, true ); // 12 bad argument to system call + AddSignal(13, "SIGPIPE", false, true, true ); // 13 write on a pipe with no one to read it + AddSignal(14, "SIGALRM", false, false, true ); // 14 alarm clock + AddSignal(15, "SIGTERM", false, true, true ); // 15 software termination signal from kill + AddSignal(16, "SIGURG", false, false, false); // 16 urgent condition on IO channel + AddSignal(17, "SIGSTOP", false, true, true ); // 17 sendable stop signal not from tty + AddSignal(18, "SIGTSTP", false, true, true ); // 18 stop signal from tty + AddSignal(19, "SIGCONT", false, true, true ); // 19 continue a stopped process + AddSignal(20, "SIGCHLD", false, false, true ); // 20 to parent on child stop or exit + AddSignal(21, "SIGTTIN", false, true, true ); // 21 to readers pgrp upon background tty read + AddSignal(22, "SIGTTOU", false, true, true ); // 22 like TTIN for output if (tp->t_local<OSTOP) + AddSignal(23, "SIGIO", false, false, false); // 23 input/output possible signal + AddSignal(24, "SIGXCPU", false, true, true ); // 24 exceeded CPU time limit + AddSignal(25, "SIGXFSZ", false, true, true ); // 25 exceeded file size limit + AddSignal(26, "SIGVTALRM", false, false, false); // 26 virtual time alarm + AddSignal(27, "SIGPROF", false, false, false); // 27 profiling time alarm + AddSignal(28, "SIGWINCH", false, false, false); // 28 window size changes + AddSignal(29, "SIGINFO", false, true, true ); // 29 information request + 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) { |

