summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-05-08 04:53:50 +0000
committerGreg Clayton <gclayton@apple.com>2011-05-08 04:53:50 +0000
commitc4103b3c2fe3e38b6a93ce37fca6e8d7d95b2469 (patch)
treeb089504562bb71cb554d9c28a58a0dd7443284f0 /lldb/tools/debugserver/source
parentd9ca42aa4f6a714fb2f04c06e50f721037b5e055 (diff)
downloadbcm5719-llvm-c4103b3c2fe3e38b6a93ce37fca6e8d7d95b2469.tar.gz
bcm5719-llvm-c4103b3c2fe3e38b6a93ce37fca6e8d7d95b2469.zip
Fixed not being able to launch the i386 slice of a universal binary by adding
a new "QLaunchArch:<arch-name>" where <arch-name> is the architecture name. This allows us to remotely launch a debugserver and then set the architecture for the binary we will launch. llvm-svn: 131064
Diffstat (limited to 'lldb/tools/debugserver/source')
-rw-r--r--lldb/tools/debugserver/source/RNBRemote.cpp10
-rw-r--r--lldb/tools/debugserver/source/RNBRemote.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp
index 22bcb01a87d..5eed2c571a3 100644
--- a/lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/lldb/tools/debugserver/source/RNBRemote.cpp
@@ -175,6 +175,7 @@ RNBRemote::CreatePacketTable ()
t.push_back (Packet (set_max_packet_size, &RNBRemote::HandlePacket_QSetMaxPacketSize , NULL, "QSetMaxPacketSize:", "Tell " DEBUGSERVER_PROGRAM_NAME " the max sized packet gdb can handle"));
t.push_back (Packet (set_max_payload_size, &RNBRemote::HandlePacket_QSetMaxPayloadSize , NULL, "QSetMaxPayloadSize:", "Tell " DEBUGSERVER_PROGRAM_NAME " the max sized payload gdb can handle"));
t.push_back (Packet (set_environment_variable, &RNBRemote::HandlePacket_QEnvironment , NULL, "QEnvironment:", "Add an environment variable to the inferior's environment"));
+ t.push_back (Packet (set_launch_arch, &RNBRemote::HandlePacket_QLaunchArch , NULL, "QLaunchArch:", "Set the architecture to use when launching a process for hosts that can run multiple architecture slices from universal files."));
t.push_back (Packet (set_disable_aslr, &RNBRemote::HandlePacket_QSetDisableASLR , NULL, "QSetDisableASLR:", "Set wether to disable ASLR when launching the process with the set argv ('A') packet"));
t.push_back (Packet (set_stdin, &RNBRemote::HandlePacket_QSetSTDIO , NULL, "QSetSTDIN:", "Set the standard input for a process to be launched with the 'A' packet"));
t.push_back (Packet (set_stdout, &RNBRemote::HandlePacket_QSetSTDIO , NULL, "QSetSTDOUT:", "Set the standard output for a process to be launched with the 'A' packet"));
@@ -1883,6 +1884,15 @@ RNBRemote::HandlePacket_QEnvironment (const char *p)
return SendPacket ("OK");
}
+rnb_err_t
+RNBRemote::HandlePacket_QLaunchArch (const char *p)
+{
+ p += sizeof ("QLaunchArch:") - 1;
+ if (DNBSetArchitecture(p))
+ return SendPacket ("OK");
+ return SendPacket ("E63");
+}
+
void
append_hex_value (std::ostream& ostrm, const uint8_t* buf, size_t buf_size, bool swap)
{
diff --git a/lldb/tools/debugserver/source/RNBRemote.h b/lldb/tools/debugserver/source/RNBRemote.h
index 538fad48899..f727718a616 100644
--- a/lldb/tools/debugserver/source/RNBRemote.h
+++ b/lldb/tools/debugserver/source/RNBRemote.h
@@ -98,6 +98,7 @@ public:
set_max_packet_size, // 'QSetMaxPacketSize:'
set_max_payload_size, // 'QSetMaxPayloadSize:'
set_environment_variable, // 'QEnvironment:'
+ set_launch_arch, // 'QLaunchArch:'
set_disable_aslr, // 'QSetDisableASLR:'
set_stdin, // 'QSetSTDIN:'
set_stdout, // 'QSetSTDOUT:'
@@ -170,6 +171,7 @@ public:
rnb_err_t HandlePacket_QSetMaxPayloadSize (const char *p);
rnb_err_t HandlePacket_QSetMaxPacketSize (const char *p);
rnb_err_t HandlePacket_QEnvironment (const char *p);
+ rnb_err_t HandlePacket_QLaunchArch (const char *p);
rnb_err_t HandlePacket_QPrefixRegisterPacketsWithThreadID (const char *p);
rnb_err_t HandlePacket_last_signal (const char *p);
rnb_err_t HandlePacket_m (const char *p);
OpenPOWER on IntegriCloud