[lldb-dev] Fwd: [PATCH] Fix compile warnings with Platform::GetFile

Steve Pucci spucci at google.com
Fri Jan 17 07:33:11 PST 2014


Forgot to reply all:

---------- Forwarded message ----------
From: Steve Pucci <spucci at google.com>
Date: Fri, Jan 17, 2014 at 7:32 AM
Subject: Re: [lldb-dev] [PATCH] Fix compile warnings with Platform::GetFile
To: Sylvestre Ledru <sylvestre at debian.org>


This is the first piece of the separation of the previously submitted
patch.  Notes for this piece (copied from previous email):

The rename of Platform::GetFile (the three-argument version) to
GetFileWithUUID was suggested by gclayton as a way to silence gcc warnings;
the warning is emitted when there is an overloaded function in a base class
(Platform) for which a derived class redefines one of the overloads but not
the other (because doing so hides the other overload from users of the
derived class).  By giving the two methods different names, the situation
is avoided.

Compiled and passed lldb tests on Linux Ubuntu 12.04 and gcc 4.8.2.

Thanks,
   Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140117/5e40e4f4/attachment.html>
-------------- next part --------------
diff --git a/include/lldb/Target/Platform.h b/include/lldb/Target/Platform.h
index 355c052..be54df9 100644
--- a/include/lldb/Target/Platform.h
+++ b/include/lldb/Target/Platform.h
@@ -314,9 +314,9 @@ namespace lldb_private {
         ///     An error object.
         //------------------------------------------------------------------
         virtual Error
-        GetFile (const FileSpec &platform_file, 
-                 const UUID *uuid_ptr,
-                 FileSpec &local_file);
+        GetFileWithUUID (const FileSpec &platform_file, 
+                         const UUID *uuid_ptr,
+                         FileSpec &local_file);
 
         //----------------------------------------------------------------------
         // Locate the scripting resource given a module specification.
diff --git a/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
index da29c16..10449ff 100644
--- a/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
+++ b/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
@@ -571,14 +571,14 @@ PlatformFreeBSD::GetGroupName (uint32_t gid)
 
 // From PlatformMacOSX only
 Error
-PlatformFreeBSD::GetFile (const FileSpec &platform_file,
-                          const UUID *uuid_ptr,
-                          FileSpec &local_file)
+PlatformFreeBSD::GetFileWithUUID (const FileSpec &platform_file,
+                                  const UUID *uuid_ptr,
+                                  FileSpec &local_file)
 {
     if (IsRemote())
     {
         if (m_remote_platform_sp)
-            return m_remote_platform_sp->GetFile (platform_file, uuid_ptr, local_file);
+            return m_remote_platform_sp->GetFileWithUUID (platform_file, uuid_ptr, local_file);
     }
 
     // Default to the local case
diff --git a/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h b/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
index 11d1cd6..d09557d 100644
--- a/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
+++ b/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
@@ -144,8 +144,8 @@ public:
 
     // Only on PlatformMacOSX:
     virtual lldb_private::Error
-    GetFile (const lldb_private::FileSpec &platform_file,
-             const lldb_private::UUID* uuid, lldb_private::FileSpec &local_file);
+    GetFileWithUUID (const lldb_private::FileSpec &platform_file,
+                     const lldb_private::UUID* uuid, lldb_private::FileSpec &local_file);
 
     lldb_private::Error
     GetSharedModule (const lldb_private::ModuleSpec &module_spec,
diff --git a/source/Plugins/Platform/Linux/PlatformLinux.cpp b/source/Plugins/Platform/Linux/PlatformLinux.cpp
index 7ffb30e..be3b0a9 100644
--- a/source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ b/source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -285,13 +285,13 @@ PlatformLinux::ResolveExecutable (const FileSpec &exe_file,
 }
 
 Error
-PlatformLinux::GetFile (const FileSpec &platform_file, 
-                        const UUID *uuid_ptr, FileSpec &local_file)
+PlatformLinux::GetFileWithUUID (const FileSpec &platform_file, 
+                                const UUID *uuid_ptr, FileSpec &local_file)
 {
     if (IsRemote())
     {
         if (m_remote_platform_sp)
-            return m_remote_platform_sp->GetFile (platform_file, uuid_ptr, local_file);
+            return m_remote_platform_sp->GetFileWithUUID (platform_file, uuid_ptr, local_file);
     }
 
     // Default to the local case
diff --git a/source/Plugins/Platform/Linux/PlatformLinux.h b/source/Plugins/Platform/Linux/PlatformLinux.h
index a77780d..91010b9 100644
--- a/source/Plugins/Platform/Linux/PlatformLinux.h
+++ b/source/Plugins/Platform/Linux/PlatformLinux.h
@@ -73,8 +73,8 @@ namespace lldb_private {
         GetStatus (Stream &strm);
 
         virtual Error
-        GetFile (const FileSpec &platform_file,
-                 const UUID* uuid, FileSpec &local_file);
+        GetFileWithUUID (const FileSpec &platform_file,
+                         const UUID* uuid, FileSpec &local_file);
 
         virtual bool
         GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &proc_info);
diff --git a/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
index 9ffd68d..74b4f35 100644
--- a/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
@@ -249,7 +249,7 @@ PlatformMacOSX::GetSymbolFile (const FileSpec &platform_file,
     if (IsRemote())
     {
         if (m_remote_platform_sp)
-            return m_remote_platform_sp->GetFile (platform_file, uuid_ptr, local_file);
+            return m_remote_platform_sp->GetFileWithUUID (platform_file, uuid_ptr, local_file);
     }
 
     // Default to the local case
@@ -258,9 +258,9 @@ PlatformMacOSX::GetSymbolFile (const FileSpec &platform_file,
 }
 
 lldb_private::Error
-PlatformMacOSX::GetFile (const lldb_private::FileSpec &platform_file,
-                         const lldb_private::UUID *uuid_ptr,
-                         lldb_private::FileSpec &local_file)
+PlatformMacOSX::GetFileWithUUID (const lldb_private::FileSpec &platform_file,
+                                 const lldb_private::UUID *uuid_ptr,
+                                 lldb_private::FileSpec &local_file)
 {
     if (IsRemote() && m_remote_platform_sp)
     {
diff --git a/source/Plugins/Platform/MacOSX/PlatformMacOSX.h b/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
index 2354e6f..57e57e7 100644
--- a/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
+++ b/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
@@ -87,9 +87,9 @@ public:
     }
     
     virtual lldb_private::Error
-    GetFile (const lldb_private::FileSpec &platform_file, 
-             const lldb_private::UUID *uuid_ptr,
-             lldb_private::FileSpec &local_file);
+    GetFileWithUUID (const lldb_private::FileSpec &platform_file, 
+                     const lldb_private::UUID *uuid_ptr,
+                     lldb_private::FileSpec &local_file);
     
     virtual bool
     GetSupportedArchitectureAtIndex (uint32_t idx, 
diff --git a/source/Plugins/Platform/Windows/PlatformWindows.cpp b/source/Plugins/Platform/Windows/PlatformWindows.cpp
index 361e910..a362ffa 100644
--- a/source/Plugins/Platform/Windows/PlatformWindows.cpp
+++ b/source/Plugins/Platform/Windows/PlatformWindows.cpp
@@ -542,14 +542,14 @@ PlatformWindows::GetGroupName (uint32_t gid)
 }
 
 Error
-PlatformWindows::GetFile (const FileSpec &platform_file,
-                          const UUID *uuid_ptr,
-                          FileSpec &local_file)
+PlatformWindows::GetFileWithUUID (const FileSpec &platform_file,
+                                  const UUID *uuid_ptr,
+                                  FileSpec &local_file)
 {
     if (IsRemote())
     {
         if (m_remote_platform_sp)
-            return m_remote_platform_sp->GetFile (platform_file, uuid_ptr, local_file);
+            return m_remote_platform_sp->GetFileWithUUID (platform_file, uuid_ptr, local_file);
     }
 
     // Default to the local case
diff --git a/source/Plugins/Platform/Windows/PlatformWindows.h b/source/Plugins/Platform/Windows/PlatformWindows.h
index 67d3e88..7d3a167 100644
--- a/source/Plugins/Platform/Windows/PlatformWindows.h
+++ b/source/Plugins/Platform/Windows/PlatformWindows.h
@@ -125,8 +125,8 @@ public:
            lldb_private::Error &error);
 
     virtual lldb_private::Error
-    GetFile(const lldb_private::FileSpec &platform_file,
-            const lldb_private::UUID* uuid, lldb_private::FileSpec &local_file);
+    GetFileWithUUID(const lldb_private::FileSpec &platform_file,
+                    const lldb_private::UUID* uuid, lldb_private::FileSpec &local_file);
 
     lldb_private::Error
     GetSharedModule(const lldb_private::ModuleSpec &module_spec,
diff --git a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
index cd2433d..80421ad 100644
--- a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -119,9 +119,9 @@ PlatformRemoteGDBServer::ResolveExecutable (const FileSpec &exe_file,
 }
 
 Error
-PlatformRemoteGDBServer::GetFile (const FileSpec &platform_file, 
-                                  const UUID *uuid_ptr,
-                                  FileSpec &local_file)
+PlatformRemoteGDBServer::GetFileWithUUID (const FileSpec &platform_file, 
+                                          const UUID *uuid_ptr,
+                                          FileSpec &local_file)
 {
     // Default to the local case
     local_file = platform_file;
diff --git a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
index 808fb5e..91e1e7c 100644
--- a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
+++ b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
@@ -73,9 +73,9 @@ public:
     GetDescription ();
 
     virtual lldb_private::Error
-    GetFile (const lldb_private::FileSpec &platform_file, 
-             const lldb_private::UUID *uuid_ptr,
-             lldb_private::FileSpec &local_file);
+    GetFileWithUUID (const lldb_private::FileSpec &platform_file, 
+                     const lldb_private::UUID *uuid_ptr,
+                     lldb_private::FileSpec &local_file);
 
     virtual bool
     GetProcessInfo (lldb::pid_t pid, 
diff --git a/source/Target/Platform.cpp b/source/Target/Platform.cpp
index 66f9c0e..dc80b4a 100644
--- a/source/Target/Platform.cpp
+++ b/source/Target/Platform.cpp
@@ -81,9 +81,9 @@ Platform::SetDefaultPlatform (const lldb::PlatformSP &platform_sp)
 }
 
 Error
-Platform::GetFile (const FileSpec &platform_file, 
-                   const UUID *uuid_ptr,
-                   FileSpec &local_file)
+Platform::GetFileWithUUID (const FileSpec &platform_file, 
+                           const UUID *uuid_ptr,
+                           FileSpec &local_file)
 {
     // Default to the local case
     local_file = platform_file;
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index a34d53e..c53c1e3 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -1067,7 +1067,7 @@ Target::SetExecutableModule (ModuleSP& executable_sp, bool get_dependent_files)
                 FileSpec dependent_file_spec (dependent_files.GetFileSpecPointerAtIndex(i));
                 FileSpec platform_dependent_file_spec;
                 if (m_platform_sp)
-                    m_platform_sp->GetFile (dependent_file_spec, NULL, platform_dependent_file_spec);
+                    m_platform_sp->GetFileWithUUID (dependent_file_spec, NULL, platform_dependent_file_spec);
                 else
                     platform_dependent_file_spec = dependent_file_spec;
 


More information about the lldb-dev mailing list