summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-12-01 23:28:38 +0000
committerGreg Clayton <gclayton@apple.com>2011-12-01 23:28:38 +0000
commit61e7a58c0ced8df707c0ca0b85632268ace30d27 (patch)
treedd27b4584524382bc35eecd04121111ae2d30386 /lldb/source/Plugins/Process/gdb-remote
parent576c0f8e542e0a69d2f450450ef4ba8124b01d28 (diff)
downloadbcm5719-llvm-61e7a58c0ced8df707c0ca0b85632268ace30d27.tar.gz
bcm5719-llvm-61e7a58c0ced8df707c0ca0b85632268ace30d27.zip
Process IDs (lldb::pid_t) and thread IDs (lldb::tid_t) are now 64 bit. This
will allow us to represent a process/thread ID using a pointer for the OS plug-ins where they might want to represent the process or thread ID using the address of the process or thread structure. llvm-svn: 145644
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp8
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp6
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp18
3 files changed, 16 insertions, 16 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 13b1abe796d..60234ac07bd 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1019,7 +1019,7 @@ GDBRemoteCommunicationClient::SendAttach
if (pid != LLDB_INVALID_PROCESS_ID)
{
char packet[64];
- const int packet_len = ::snprintf (packet, sizeof(packet), "vAttach;%x", pid);
+ const int packet_len = ::snprintf (packet, sizeof(packet), "vAttach;%llx", pid);
assert (packet_len < sizeof(packet));
if (SendPacketAndWaitForResponse (packet, packet_len, response, false))
{
@@ -1334,7 +1334,7 @@ GDBRemoteCommunicationClient::GetProcessInfo (lldb::pid_t pid, ProcessInstanceIn
if (m_supports_qProcessInfoPID)
{
char packet[32];
- const int packet_len = ::snprintf (packet, sizeof (packet), "qProcessInfoPID:%i", pid);
+ const int packet_len = ::snprintf (packet, sizeof (packet), "qProcessInfoPID:%llu", pid);
assert (packet_len < sizeof(packet));
StringExtractorGDBRemote response;
if (SendPacketAndWaitForResponse (packet, packet_len, response, false))
@@ -1404,9 +1404,9 @@ GDBRemoteCommunicationClient::FindProcesses (const ProcessInstanceInfoMatch &mat
}
if (match_info.GetProcessInfo().ProcessIDIsValid())
- packet.Printf("pid:%u;",match_info.GetProcessInfo().GetProcessID());
+ packet.Printf("pid:%llu;",match_info.GetProcessInfo().GetProcessID());
if (match_info.GetProcessInfo().ParentProcessIDIsValid())
- packet.Printf("parent_pid:%u;",match_info.GetProcessInfo().GetParentProcessID());
+ packet.Printf("parent_pid:%llu;",match_info.GetProcessInfo().GetParentProcessID());
if (match_info.GetProcessInfo().UserIDIsValid())
packet.Printf("uid:%u;",match_info.GetProcessInfo().GetUserID());
if (match_info.GetProcessInfo().GroupIDIsValid())
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index 2fbac25c933..e5141c456e6 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -275,7 +275,7 @@ GDBRemoteCommunicationServer::Handle_qHostInfo (StringExtractorGDBRemote &packet
static void
CreateProcessInfoResponse (const ProcessInstanceInfo &proc_info, StreamString &response)
{
- response.Printf ("pid:%i;ppid:%i;uid:%i;gid:%i;euid:%i;egid:%i;",
+ response.Printf ("pid:%llu;ppid:%llu;uid:%i;gid:%i;euid:%i;egid:%i;",
proc_info.GetProcessID(),
proc_info.GetParentProcessID(),
proc_info.GetUserID(),
@@ -641,7 +641,7 @@ GDBRemoteCommunicationServer::Handle_qC (StringExtractorGDBRemote &packet)
{
lldb::pid_t pid = m_process_launch_info.GetProcessID();
StreamString response;
- response.Printf("QC%x", pid);
+ response.Printf("QC%llx", pid);
if (m_is_platform)
{
// If we launch a process and this GDB server is acting as a platform,
@@ -707,7 +707,7 @@ GDBRemoteCommunicationServer::Handle_qLaunchGDBServer (StringExtractorGDBRemote
{
uint16_t port = (intptr_t)accept_thread_result;
char response[256];
- const int response_len = ::snprintf (response, sizeof(response), "pid:%u;port:%u;", debugserver_pid, port);
+ const int response_len = ::snprintf (response, sizeof(response), "pid:%llu;port:%u;", debugserver_pid, port);
assert (response_len < sizeof(response));
//m_port_to_pid_map[port] = debugserver_launch_info.GetProcessID();
success = SendPacket (response, response_len) > 0;
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index e8e5aac7b01..3a21821935a 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -408,10 +408,10 @@ ProcessGDBRemote::DoConnectRemote (const char *remote_url)
SetPrivateState (state);
}
else
- error.SetErrorStringWithFormat ("Process %i was reported after connecting to '%s', but state was not stopped: %s", pid, remote_url, StateAsCString (state));
+ error.SetErrorStringWithFormat ("Process %llu was reported after connecting to '%s', but state was not stopped: %s", pid, remote_url, StateAsCString (state));
}
else
- error.SetErrorStringWithFormat ("Process %i was reported after connecting to '%s', but no stop reply packet was received", pid, remote_url);
+ error.SetErrorStringWithFormat ("Process %llu was reported after connecting to '%s', but no stop reply packet was received", pid, remote_url);
}
return error;
}
@@ -772,7 +772,7 @@ ProcessGDBRemote::DoAttachToProcessWithID (lldb::pid_t attach_pid)
if (error.Success())
{
char packet[64];
- const int packet_len = ::snprintf (packet, sizeof(packet), "vAttach;%x", attach_pid);
+ const int packet_len = ::snprintf (packet, sizeof(packet), "vAttach;%llx", attach_pid);
SetID (attach_pid);
m_async_broadcaster.BroadcastEvent (eBroadcastBitAsyncContinue, new EventDataBytes (packet, packet_len));
}
@@ -890,7 +890,7 @@ ProcessGDBRemote::DoResume ()
if (m_gdb_comm.GetVContSupported ('c'))
{
for (tid_collection::const_iterator t_pos = m_continue_c_tids.begin(), t_end = m_continue_c_tids.end(); t_pos != t_end; ++t_pos)
- continue_packet.Printf(";c:%4.4x", *t_pos);
+ continue_packet.Printf(";c:%4.4llx", *t_pos);
}
else
continue_packet_error = true;
@@ -901,7 +901,7 @@ ProcessGDBRemote::DoResume ()
if (m_gdb_comm.GetVContSupported ('C'))
{
for (tid_sig_collection::const_iterator s_pos = m_continue_C_tids.begin(), s_end = m_continue_C_tids.end(); s_pos != s_end; ++s_pos)
- continue_packet.Printf(";C%2.2x:%4.4x", s_pos->second, s_pos->first);
+ continue_packet.Printf(";C%2.2x:%4.4llx", s_pos->second, s_pos->first);
}
else
continue_packet_error = true;
@@ -912,7 +912,7 @@ ProcessGDBRemote::DoResume ()
if (m_gdb_comm.GetVContSupported ('s'))
{
for (tid_collection::const_iterator t_pos = m_continue_s_tids.begin(), t_end = m_continue_s_tids.end(); t_pos != t_end; ++t_pos)
- continue_packet.Printf(";s:%4.4x", *t_pos);
+ continue_packet.Printf(";s:%4.4llx", *t_pos);
}
else
continue_packet_error = true;
@@ -923,7 +923,7 @@ ProcessGDBRemote::DoResume ()
if (m_gdb_comm.GetVContSupported ('S'))
{
for (tid_sig_collection::const_iterator s_pos = m_continue_S_tids.begin(), s_end = m_continue_S_tids.end(); s_pos != s_end; ++s_pos)
- continue_packet.Printf(";S%2.2x:%4.4x", s_pos->second, s_pos->first);
+ continue_packet.Printf(";S%2.2x:%4.4llx", s_pos->second, s_pos->first);
}
else
continue_packet_error = true;
@@ -2131,7 +2131,7 @@ ProcessGDBRemote::StartDebugserverProcess (const char *debugserver_url) // Th
m_debugserver_pid = LLDB_INVALID_PROCESS_ID;
if (error.Fail() || log)
- error.PutToLog(log.get(), "Host::LaunchProcess (launch_info) => pid=%i, path='%s'", m_debugserver_pid, debugserver_path);
+ error.PutToLog(log.get(), "Host::LaunchProcess (launch_info) => pid=%llu, path='%s'", m_debugserver_pid, debugserver_path);
}
else
{
@@ -2176,7 +2176,7 @@ ProcessGDBRemote::MonitorDebugserverProcess
TargetSP target_sp (Debugger::FindTargetWithProcess(process));
if (log)
- log->Printf ("ProcessGDBRemote::MonitorDebugserverProcess (baton=%p, pid=%i, signo=%i (0x%x), exit_status=%i)", callback_baton, debugserver_pid, signo, signo, exit_status);
+ log->Printf ("ProcessGDBRemote::MonitorDebugserverProcess (baton=%p, pid=%llu, signo=%i (0x%x), exit_status=%i)", callback_baton, debugserver_pid, signo, signo, exit_status);
if (target_sp)
{
OpenPOWER on IntegriCloud