Added a quicker lookup in the SectionLoadList when looking things up by
section by using a DenseMap.

Fixed some logging calls to get the log shared pointer.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124926 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 769849d..6442e21 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -90,7 +90,9 @@
 size_t
 GDBRemoteCommunication::SendAck ()
 {
-    ProcessGDBRemoteLog::LogIf (GDBR_LOG_PACKETS, "send packet: +");
+    LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PACKETS));
+    if (log)
+        log->Printf ("send packet: +");
     ConnectionStatus status = eConnectionStatusSuccess;
     char ack_char = '+';
     return Write (&ack_char, 1, status, NULL) == 1;
@@ -99,7 +101,9 @@
 size_t
 GDBRemoteCommunication::SendNack ()
 {
-    ProcessGDBRemoteLog::LogIf (GDBR_LOG_PACKETS, "send packet: -");
+    LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PACKETS));
+    if (log)
+        log->Printf ("send packet: -");
     ConnectionStatus status = eConnectionStatusSuccess;
     char nack_char = '-';
     return Write (&nack_char, 1, status, NULL) == 1;
@@ -440,7 +444,9 @@
         packet.PutChar('#');
         packet.PutHex8(CalculcateChecksum (payload, payload_length));
 
-        ProcessGDBRemoteLog::LogIf (GDBR_LOG_PACKETS, "send packet: %s", packet.GetData());
+        LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PACKETS));
+        if (log)
+            log->Printf ("send packet: %s", packet.GetData());
         ConnectionStatus status = eConnectionStatusSuccess;
         size_t bytes_written = Write (packet.GetData(), packet.GetSize(), status, NULL);
         if (bytes_written == packet.GetSize())
@@ -453,7 +459,9 @@
         }
         else
         {
-            ProcessGDBRemoteLog::LogIf (GDBR_LOG_PACKETS, "error: failed to send packet: %s", packet.GetData());
+            LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PACKETS));
+            if (log)
+                log->Printf ("error: failed to send packet: %s", packet.GetData());
         }
         return bytes_written;
     }
@@ -614,7 +622,9 @@
             if (event_bytes)
             {
                 const char * packet_data =  (const char *)event_bytes->GetBytes();
-                ProcessGDBRemoteLog::LogIf (GDBR_LOG_PACKETS, "read packet: %s", packet_data);
+                LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PACKETS));
+                if (log)
+                    log->Printf ("read packet: %s", packet_data);
                 const size_t packet_size =  event_bytes->GetByteSize();
                 if (packet_data && packet_size > 0)
                 {