summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/RNBRemote.h
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-11-18 05:57:03 +0000
committerGreg Clayton <gclayton@apple.com>2010-11-18 05:57:03 +0000
commit3af9ea56d30ca97a5ce31cb1024501b324f8fa47 (patch)
tree6c613eee05c2d066b9a58e727f079725ffc34964 /lldb/tools/debugserver/source/RNBRemote.h
parent19ca5608db90bf06bfaba3e1b28af6ed68165d7d (diff)
downloadbcm5719-llvm-3af9ea56d30ca97a5ce31cb1024501b324f8fa47.tar.gz
bcm5719-llvm-3af9ea56d30ca97a5ce31cb1024501b324f8fa47.zip
Fixed Process::Halt() as it was broken for "process halt" after recent changes
to the DoHalt down in ProcessGDBRemote. I also moved the functionality that was in ProcessGDBRemote::DoHalt up into Process::Halt so not every class has to implement a tricky halt/resume on the internal state thread. The functionality is the same as it was before with two changes: - when we eat the event we now just reuse the event we consume when the private state thread is paused and set the interrupted bool on the event if needed - we also properly update the Process::m_public_state with the state of the event we consume. Prior to this, if you issued a "process halt" it would eat the event, not update the process state, and then produce a new event with the interrupted bit set and send it. Anyone listening to the event would get the stopped event with a process that whose state was set to "running". Fixed debugserver to not have to be spawned with the architecture of the inferior process. This worked fine for launching processes, but when attaching to processes by name or pid without a file in lldb, it would fail. Now debugserver can support multiple architectures for a native debug session on the current host. This currently means i386 and x86_64 are supported in the same binary and a x86_64 debugserver can attach to a i386 executable. This change involved a lot of changes to make sure we dynamically detect the correct registers for the inferior process. llvm-svn: 119680
Diffstat (limited to 'lldb/tools/debugserver/source/RNBRemote.h')
-rw-r--r--lldb/tools/debugserver/source/RNBRemote.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/tools/debugserver/source/RNBRemote.h b/lldb/tools/debugserver/source/RNBRemote.h
index 30ab7e67302..fab42bc9693 100644
--- a/lldb/tools/debugserver/source/RNBRemote.h
+++ b/lldb/tools/debugserver/source/RNBRemote.h
@@ -106,10 +106,12 @@ public:
typedef rnb_err_t (RNBRemote::*HandlePacketCallback)(const char *p);
- RNBRemote(bool use_native_regs);
- ~RNBRemote();
+ RNBRemote (bool use_native_regs, const char *arch);
+ ~RNBRemote ();
- static void InitializeRegisters (int use_native);
+ void Initialize();
+
+ bool InitializeRegisters ();
rnb_err_t HandleAsyncPacket(PacketEnum *type = NULL);
rnb_err_t HandleReceivedPacket(PacketEnum *type = NULL);
@@ -194,9 +196,6 @@ private:
protected:
- static void
- InitializeNativeRegisters ();
-
rnb_err_t GetCommData ();
void CommDataReceived(const std::string& data);
struct Packet
@@ -273,8 +272,7 @@ protected:
typedef BreakpointMap::const_iterator BreakpointMapConstIter;
RNBContext m_ctx; // process context
RNBSocket m_comm; // communication port
- bool m_extended_mode; // are we in extended mode?
- bool m_noack_mode; // are we in no-ack mode?
+ std::string m_arch;
nub_thread_t m_continue_thread; // thread to continue; 0 for any, -1 for all
nub_thread_t m_thread; // thread for other ops; 0 for any, -1 for all
PThreadMutex m_mutex; // Mutex that protects
@@ -286,7 +284,9 @@ protected:
BreakpointMap m_breakpoints;
BreakpointMap m_watchpoints;
uint32_t m_max_payload_size; // the maximum sized payload we should send to gdb
- bool m_use_native_regs;
+ bool m_extended_mode:1, // are we in extended mode?
+ m_noack_mode:1, // are we in no-ack mode?
+ m_use_native_regs:1; // Use native registers by querying DNB layer for register definitions?
};
/* We translate the /usr/include/mach/exception_types.h exception types
OpenPOWER on IntegriCloud