[Lldb-commits] [lldb] r156036 - in /lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote: GDBRemoteCommunicationServer.cpp GDBRemoteCommunicationServer.h

Johnny Chen johnny.chen at apple.com
Wed May 2 17:03:10 PDT 2012


Author: johnny
Date: Wed May  2 19:03:10 2012
New Revision: 156036

URL: http://llvm.org/viewvc/llvm-project?rev=156036&view=rev
Log:
Cleanup the port range code a bit.

Modified:
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=156036&r1=156035&r2=156036&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Wed May  2 19:03:10 2012
@@ -64,7 +64,6 @@
     {
         printf("SetPortRange(%u, %u) called\n", lo_port_num, hi_port_num);
         SetPortRange(lo_port_num, hi_port_num);
-        m_use_port_range = true;
     }
 }
 
@@ -751,6 +750,7 @@
                                                           "localhost:%u", 
                                                           GetAndUpdateNextPort());
                 assert (host_and_port_len < sizeof(host_and_port));
+                printf("Launching debugserver with: %s...\n", host_and_port);
                 error = StartDebugserverProcess (host_and_port,
                                                  unix_socket_name, 
                                                  debugserver_launch_info);

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h?rev=156036&r1=156035&r2=156036&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h Wed May  2 19:03:10 2012
@@ -60,6 +60,8 @@
     {
         m_lo_port_num = lo_port_num;
         m_hi_port_num = hi_port_num;
+        m_next_port = m_lo_port_num;
+        m_use_port_range = true;
     }
 
     // If we are using a port range, get and update the next port to be used variable.
@@ -69,7 +71,7 @@
     {
         if (!m_use_port_range)
             return 0;
-        int16_t val = m_next_port;
+        uint16_t val = m_next_port;
         if (++m_next_port > m_hi_port_num)
             m_next_port = m_lo_port_num;
         return val;





More information about the lldb-commits mailing list