summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/lldb.xcodeproj/project.pbxproj14
-rw-r--r--lldb/source/Plugins/Process/Linux/CMakeLists.txt1
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp (renamed from lldb/source/Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.cpp)0
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h (renamed from lldb/source/Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.h)0
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp3
-rw-r--r--lldb/source/Plugins/Process/Utility/CMakeLists.txt1
-rw-r--r--lldb/source/Plugins/Process/Utility/LinuxSignals.cpp85
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp6
-rw-r--r--lldb/source/Target/ProcessLaunchInfo.cpp2
9 files changed, 49 insertions, 63 deletions
diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj
index 248a79b0a89..863ffaac3b1 100644
--- a/lldb/lldb.xcodeproj/project.pbxproj
+++ b/lldb/lldb.xcodeproj/project.pbxproj
@@ -72,7 +72,6 @@
233B009919610B1F0090E598 /* ProcessLinux.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 233B009119610B1F0090E598 /* ProcessLinux.h */; };
233B009A19610B1F0090E598 /* ProcessMonitor.cpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 233B009219610B1F0090E598 /* ProcessMonitor.cpp */; };
233B009B19610B1F0090E598 /* ProcessMonitor.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 233B009319610B1F0090E598 /* ProcessMonitor.h */; };
- 239F5B2F19296DC500083917 /* NativeRegisterContextLinux_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 239F5B2E19296DC500083917 /* NativeRegisterContextLinux_x86_64.h */; };
23EDE3321926843600F6A132 /* NativeRegisterContext.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 23EDE3311926843600F6A132 /* NativeRegisterContext.h */; };
23EDE33319269E7C00F6A132 /* NativeRegisterContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23EDE3301926839700F6A132 /* NativeRegisterContext.cpp */; };
23EFE389193D1ABC00E54E54 /* SBTypeEnumMember.h in Headers */ = {isa = PBXBuildFile; fileRef = 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -934,9 +933,9 @@
233B009D19610D6B0090E598 /* Host.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Host.cpp; sourceTree = "<group>"; };
233B00A1196113730090E598 /* ProcFileReader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ProcFileReader.cpp; sourceTree = "<group>"; };
233B00A2196113730090E598 /* ProcFileReader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProcFileReader.h; sourceTree = "<group>"; };
+ 233B00A919622F3F0090E598 /* NativeRegisterContextLinux_x86_64.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NativeRegisterContextLinux_x86_64.cpp; sourceTree = "<group>"; };
+ 233B00AA19622F3F0090E598 /* NativeRegisterContextLinux_x86_64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NativeRegisterContextLinux_x86_64.h; sourceTree = "<group>"; };
2360092C193FB21500189DB1 /* MemoryRegionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MemoryRegionInfo.h; path = include/lldb/Target/MemoryRegionInfo.h; sourceTree = "<group>"; };
- 239F5B2E19296DC500083917 /* NativeRegisterContextLinux_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeRegisterContextLinux_x86_64.h; path = Utility/NativeRegisterContextLinux_x86_64.h; sourceTree = "<group>"; };
- 239F5B3019298D4600083917 /* NativeRegisterContextLinux_x86_64.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContextLinux_x86_64.cpp; path = Utility/NativeRegisterContextLinux_x86_64.cpp; sourceTree = "<group>"; };
23EDE3301926839700F6A132 /* NativeRegisterContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContext.cpp; path = source/Target/NativeRegisterContext.cpp; sourceTree = "<group>"; };
23EDE3311926843600F6A132 /* NativeRegisterContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeRegisterContext.h; path = include/lldb/Target/NativeRegisterContext.h; sourceTree = "<group>"; };
23EDE3371926AAD500F6A132 /* RegisterInfoInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterInfoInterface.h; path = Utility/RegisterInfoInterface.h; sourceTree = "<group>"; };
@@ -2222,6 +2221,8 @@
233B008F19610B1F0090E598 /* LinuxThread.h */,
232CB62B19213AC200EF39FC /* NativeProcessLinux.cpp */,
232CB62C19213AC200EF39FC /* NativeProcessLinux.h */,
+ 233B00AA19622F3F0090E598 /* NativeRegisterContextLinux_x86_64.h */,
+ 233B00A919622F3F0090E598 /* NativeRegisterContextLinux_x86_64.cpp */,
232CB62D19213AC200EF39FC /* NativeThreadLinux.cpp */,
232CB62E19213AC200EF39FC /* NativeThreadLinux.h */,
233B009019610B1F0090E598 /* ProcessLinux.cpp */,
@@ -2918,6 +2919,7 @@
B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */,
23059A0519532B96007B8189 /* LinuxSignals.cpp */,
23059A0619532B96007B8189 /* LinuxSignals.h */,
+ 23173F8B192BA93F005C708F /* lldb-x86-register-enums.h */,
26474C9E18D0CAEC0073DEBA /* RegisterContext_mips64.h */,
26474C9F18D0CAEC0073DEBA /* RegisterContext_x86.h */,
26957D9213D381C900670048 /* RegisterContextDarwin_arm.cpp */,
@@ -2963,6 +2965,7 @@
26474CC818D0CB5B0073DEBA /* RegisterContextPOSIX.h */,
26CA979F172B1FD5005DC71B /* RegisterContextThreadMemory.cpp */,
26CA97A0172B1FD5005DC71B /* RegisterContextThreadMemory.h */,
+ 23EDE3371926AAD500F6A132 /* RegisterInfoInterface.h */,
26474CD018D0CB700073DEBA /* RegisterInfos_i386.h */,
26474CD118D0CB710073DEBA /* RegisterInfos_mips64.h */,
26474CD218D0CB710073DEBA /* RegisterInfos_x86_64.h */,
@@ -2974,10 +2977,6 @@
AF68D3301255A110002FF25B /* UnwindLLDB.h */,
26E3EEE411A9901300FBADB6 /* UnwindMacOSXFrameBackchain.h */,
26E3EEE311A9901300FBADB6 /* UnwindMacOSXFrameBackchain.cpp */,
- 23EDE3371926AAD500F6A132 /* RegisterInfoInterface.h */,
- 239F5B2E19296DC500083917 /* NativeRegisterContextLinux_x86_64.h */,
- 239F5B3019298D4600083917 /* NativeRegisterContextLinux_x86_64.cpp */,
- 23173F8B192BA93F005C708F /* lldb-x86-register-enums.h */,
);
name = Utility;
sourceTree = "<group>";
@@ -4202,7 +4201,6 @@
260CC63A15D04377002BF2E0 /* OptionValueUUID.h in Headers */,
260A248E15D06C50009981B0 /* OptionValues.h in Headers */,
AF061F88182C97ED00B6A19C /* RegisterContextHistory.h in Headers */,
- 239F5B2F19296DC500083917 /* NativeRegisterContextLinux_x86_64.h in Headers */,
26DAED6015D327A200E15819 /* OptionValuePathMappings.h in Headers */,
26ACEC2815E077AE00E94760 /* Property.h in Headers */,
26491E3B15E1DB8600CBFFC2 /* OptionValueRegex.h in Headers */,
diff --git a/lldb/source/Plugins/Process/Linux/CMakeLists.txt b/lldb/source/Plugins/Process/Linux/CMakeLists.txt
index 3f15e19d762..4753219c398 100644
--- a/lldb/source/Plugins/Process/Linux/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Linux/CMakeLists.txt
@@ -6,6 +6,7 @@ include_directories(../Utility)
add_lldb_library(lldbPluginProcessLinux
NativeProcessLinux.cpp
+ NativeRegisterContextLinux_x86_64.cpp
NativeThreadLinux.cpp
ProcessLinux.cpp
ProcessMonitor.cpp
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
index 9d7ca9558cd..9d7ca9558cd 100644
--- a/lldb/source/Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
diff --git a/lldb/source/Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
index d7353c08ef4..d7353c08ef4 100644
--- a/lldb/source/Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
index d9cd18357e7..d5f2753e5a3 100644
--- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -12,12 +12,13 @@
#include <signal.h>
#include "NativeProcessLinux.h"
+#include "NativeRegisterContextLinux_x86_64.h"
+
#include "lldb/Core/Log.h"
#include "lldb/Core/State.h"
#include "lldb/Host/Host.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-private-log.h"
-#include "Plugins/Process/Utility/NativeRegisterContextLinux_x86_64.h"
#include "Plugins/Process/Utility/RegisterContextLinux_i386.h"
#include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h"
#include "Plugins/Process/Utility/RegisterInfoInterface.h"
diff --git a/lldb/source/Plugins/Process/Utility/CMakeLists.txt b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
index 880b8758ef8..31055297f08 100644
--- a/lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -9,7 +9,6 @@ add_lldb_library(lldbPluginProcessUtility
HistoryUnwind.cpp
InferiorCallPOSIX.cpp
LinuxSignals.cpp
- NativeRegisterContextLinux_x86_64.cpp
RegisterContextDarwin_arm.cpp
RegisterContextDarwin_arm64.cpp
RegisterContextDarwin_i386.cpp
diff --git a/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp b/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
index f0affb7b68b..fb49df681ca 100644
--- a/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
+++ b/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp
@@ -7,9 +7,6 @@
//
//===----------------------------------------------------------------------===//
-// C Includes
-#include <signal.h>
-
// C++ Includes
// Other libraries and framework includes
// Project includes
@@ -28,52 +25,38 @@ LinuxSignals::Reset()
{
m_signals.clear();
- // FIXME we now need *Signals classes on systems that are different OSes (e.g. LinuxSignals
- // needed on MacOSX to debug Linux from MacOSX, and similar scenarios, used by ProcessGDBRemote). These must be defined
- // not based on OS includes and defines.
-
-#define ADDSIGNAL(S, SUPPRESS, STOP, NOTIFY, DESCRIPTION) \
- AddSignal(SIG ## S, "SIG" #S, #S, SUPPRESS, STOP, NOTIFY, DESCRIPTION)
-
- ADDSIGNAL(HUP, false, true, true, "hangup");
- ADDSIGNAL(INT, true, true, true, "interrupt");
- ADDSIGNAL(QUIT, false, true, true, "quit");
- ADDSIGNAL(ILL, false, true, true, "illegal instruction");
- ADDSIGNAL(TRAP, true, true, true, "trace trap (not reset when caught)");
- ADDSIGNAL(ABRT, false, true, true, "abort");
- ADDSIGNAL(IOT, false, true, true, "abort");
- ADDSIGNAL(BUS, false, true, true, "bus error");
- ADDSIGNAL(FPE, false, true, true, "floating point exception");
- ADDSIGNAL(KILL, false, true, true, "kill");
- ADDSIGNAL(USR1, false, true, true, "user defined signal 1");
- ADDSIGNAL(SEGV, false, true, true, "segmentation violation");
- ADDSIGNAL(USR2, false, true, true, "user defined signal 2");
- ADDSIGNAL(PIPE, false, true, true, "write to pipe with reading end closed");
- ADDSIGNAL(ALRM, false, false, true, "alarm");
- ADDSIGNAL(TERM, false, true, true, "termination requested");
-#ifdef SIGSTKFLT
- ADDSIGNAL(STKFLT, false, true, true, "stack fault");
-#endif
- ADDSIGNAL(CHLD, false, false, true, "child process exit");
- ADDSIGNAL(CONT, false, true, true, "process continue");
- ADDSIGNAL(STOP, true, true, true, "process stop");
- ADDSIGNAL(TSTP, false, true, true, "tty stop");
- ADDSIGNAL(TTIN, false, true, true, "background tty read");
- ADDSIGNAL(TTOU, false, true, true, "background tty write");
- ADDSIGNAL(URG, false, true, true, "urgent data on socket");
- ADDSIGNAL(XCPU, false, true, true, "CPU resource exceeded");
- ADDSIGNAL(XFSZ, false, true, true, "file size limit exceeded");
- ADDSIGNAL(VTALRM, false, true, true, "virtual alarm");
- ADDSIGNAL(PROF, false, true, true, "profiling alarm");
- ADDSIGNAL(WINCH, false, true, true, "window size change");
-#ifdef SIGPOLL
- ADDSIGNAL(POLL, false, true, true, "pollable event");
-#endif
- ADDSIGNAL(IO, false, true, true, "input/output ready");
-#ifdef SIGPWR
- ADDSIGNAL(PWR, false, true, true, "power failure");
-#endif
- ADDSIGNAL(SYS, false, true, true, "invalid system call");
-
-#undef ADDSIGNAL
+ AddSignal (1, "SIGHUP", "HUP", false, true , true , "hangup");
+ AddSignal (2, "SIGINT", "INT", true , true , true , "interrupt");
+ AddSignal (3, "SIGQUIT", "QUIT", false, true , true , "quit");
+ AddSignal (4, "SIGILL", "ILL", false, true , true , "illegal instruction");
+ AddSignal (5, "SIGTRAP", "TRAP", true , true , true , "trace trap (not reset when caught)");
+ AddSignal (6, "SIGABRT", "ABRT", false, true , true , "abort()");
+ AddSignal (6, "SIGIOT", "IOT", false, true , true , "IOT trap");
+ AddSignal (7, "SIGBUS", "BUS", false, true , true , "bus error");
+ AddSignal (8, "SIGFPE", "FPE", false, true , true , "floating point exception");
+ AddSignal (9, "SIGKILL", "KILL", false, true , true , "kill");
+ AddSignal (10, "SIGUSR1", "USR1", false, true , true , "user defined signal 1");
+ AddSignal (11, "SIGSEGV", "SEGV", false, true , true , "segmentation violation");
+ AddSignal (12, "SIGUSR2", "USR2", false, true , true , "user defined signal 2");
+ AddSignal (13, "SIGPIPE", "PIPE", false, true , true , "write to pipe with reading end closed");
+ AddSignal (14, "SIGALRM", "ALRM", false, false, false, "alarm");
+ AddSignal (15, "SIGTERM", "TERM", false, true , true , "termination requested");
+ AddSignal (16, "SIGSTKFLT", "STKFLT", false, true , true , "stack fault");
+ AddSignal (16, "SIGCLD", "CLD", false, false, true , "same as SIGCHLD");
+ AddSignal (17, "SIGCHLD", "CHLD", false, false, true , "child status has changed");
+ AddSignal (18, "SIGCONT", "CONT", false, true , true , "process continue");
+ AddSignal (19, "SIGSTOP", "STOP", true , true , true , "process stop");
+ AddSignal (20, "SIGTSTP", "TSTP", false, true , true , "tty stop");
+ AddSignal (21, "SIGTTIN", "TTIN", false, true , true , "background tty read");
+ AddSignal (22, "SIGTTOU", "TTOU", false, true , true , "background tty write");
+ AddSignal (23, "SIGURG", "URG", false, true , true , "urgent data on socket");
+ AddSignal (24, "SIGXCPU", "XCPU", false, true , true , "CPU resource exceeded");
+ AddSignal (25, "SIGXFSZ", "XFSZ", false, true , true , "file size limit exceeded");
+ AddSignal (26, "SIGVTALRM", "VTALRM", false, true , true , "virtual time alarm");
+ AddSignal (27, "SIGPROF", "PROF", false, true , true , "profiling time alarm");
+ AddSignal (28, "SIGWINCH", "WINCH", false, true , true , "window size changes");
+ AddSignal (29, "SIGPOLL", "POLL", false, true , true , "pollable event");
+ AddSignal (29, "SIGIO", "IO", false, true , true , "input/output ready");
+ AddSignal (30, "SIGPWR", "PWR", false, true , true , "power failure");
+ AddSignal (31, "SIGSYS", "SYS", false, true , true , "invalid system call");
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index 3d19b115d4c..e59cf34f8e3 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -15,6 +15,8 @@
// C Includes
// C++ Includes
#include <cstring>
+#include <chrono>
+#include <thread>
// Other libraries and framework includes
#include "llvm/ADT/Triple.h"
@@ -535,8 +537,8 @@ GDBRemoteCommunicationServer::LaunchDebugServerProcess ()
if (log)
log->Printf ("GDBRemoteCommunicationServer::%s waiting for launched process to hit first stop (%d)...", __FUNCTION__, iteration++);
- // FIXME use a sleep method with finer granularity.
- sleep (1);
+ // FIXME use a finer granularity.
+ std::this_thread::sleep_for(std::chrono::seconds(1));
}
if (log)
diff --git a/lldb/source/Target/ProcessLaunchInfo.cpp b/lldb/source/Target/ProcessLaunchInfo.cpp
index 05d3eb5f908..9d06c96ed1a 100644
--- a/lldb/source/Target/ProcessLaunchInfo.cpp
+++ b/lldb/source/Target/ProcessLaunchInfo.cpp
@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
+#include "lldb/Host/Config.h"
+
#include "lldb/Target/ProcessLaunchInfo.h"
#ifndef LLDB_DISABLE_POSIX
OpenPOWER on IntegriCloud