[Lldb-commits] [lldb] r105755 - in /lldb/trunk: lldb.xcodeproj/project.pbxproj source/Symbol/SymbolVendor.cpp source/Symbol/SymbolVendor.mm

Jason Molenda jmolenda at apple.com
Wed Jun 9 14:48:33 PDT 2010


Author: jmolenda
Date: Wed Jun  9 16:48:33 2010
New Revision: 105755

URL: http://llvm.org/viewvc/llvm-project?rev=105755&view=rev
Log:
SymbolVendor.mm doesn't seem to have any Objective-C in it;
move to SymbolVendor.cpp.  Xcode project file updated.

Added:
    lldb/trunk/source/Symbol/SymbolVendor.cpp
      - copied unchanged from r105752, lldb/trunk/source/Symbol/SymbolVendor.mm
Removed:
    lldb/trunk/source/Symbol/SymbolVendor.mm
Modified:
    lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=105755&r1=105754&r2=105755&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Jun  9 16:48:33 2010
@@ -176,7 +176,6 @@
 		26D5B0D811B07550009A862E /* Symbol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1B10F1B8EC00F91463 /* Symbol.cpp */; };
 		26D5B0D911B07550009A862E /* SymbolContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1C10F1B8EC00F91463 /* SymbolContext.cpp */; };
 		26D5B0DA11B07550009A862E /* SymbolFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1D10F1B8EC00F91463 /* SymbolFile.cpp */; };
-		26D5B0DB11B07550009A862E /* SymbolVendor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1E10F1B8EC00F91463 /* SymbolVendor.mm */; };
 		26D5B0DC11B07550009A862E /* Symtab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1F10F1B8EC00F91463 /* Symtab.cpp */; };
 		26D5B0DD11B07550009A862E /* Type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F2010F1B8EC00F91463 /* Type.cpp */; };
 		26D5B0DE11B07550009A862E /* TypeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F2110F1B8EC00F91463 /* TypeList.cpp */; };
@@ -351,6 +350,7 @@
 		9AC70390117675270086C050 /* SBInstructionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC7038F117675270086C050 /* SBInstructionList.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		9AC703AF117675410086C050 /* SBInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703AE117675410086C050 /* SBInstruction.cpp */; };
 		9AC703B1117675490086C050 /* SBInstructionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703B0117675490086C050 /* SBInstructionList.cpp */; };
+		AF94005911C03F6500085DB9 /* SymbolVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF94005711C03F6500085DB9 /* SymbolVendor.cpp */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -824,7 +824,6 @@
 		26BC7F1B10F1B8EC00F91463 /* Symbol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Symbol.cpp; path = source/Symbol/Symbol.cpp; sourceTree = "<group>"; };
 		26BC7F1C10F1B8EC00F91463 /* SymbolContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolContext.cpp; path = source/Symbol/SymbolContext.cpp; sourceTree = "<group>"; };
 		26BC7F1D10F1B8EC00F91463 /* SymbolFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolFile.cpp; path = source/Symbol/SymbolFile.cpp; sourceTree = "<group>"; };
-		26BC7F1E10F1B8EC00F91463 /* SymbolVendor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SymbolVendor.mm; path = source/Symbol/SymbolVendor.mm; sourceTree = "<group>"; };
 		26BC7F1F10F1B8EC00F91463 /* Symtab.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Symtab.cpp; path = source/Symbol/Symtab.cpp; sourceTree = "<group>"; };
 		26BC7F2010F1B8EC00F91463 /* Type.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Type.cpp; path = source/Symbol/Type.cpp; sourceTree = "<group>"; };
 		26BC7F2110F1B8EC00F91463 /* TypeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeList.cpp; path = source/Symbol/TypeList.cpp; sourceTree = "<group>"; };
@@ -1032,6 +1031,7 @@
 		9AF16A9E11402D69007A7B3F /* SBBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBreakpoint.h; path = include/lldb/API/SBBreakpoint.h; sourceTree = "<group>"; };
 		9AF16CC611408686007A7B3F /* SBBreakpointLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBreakpointLocation.h; path = include/lldb/API/SBBreakpointLocation.h; sourceTree = "<group>"; };
 		9AF16CC7114086A1007A7B3F /* SBBreakpointLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBreakpointLocation.cpp; path = source/API/SBBreakpointLocation.cpp; sourceTree = "<group>"; };
+		AF94005711C03F6500085DB9 /* SymbolVendor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolVendor.cpp; path = source/Symbol/SymbolVendor.cpp; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -1664,6 +1664,7 @@
 		26BC7C4B10F1B6C100F91463 /* Symbol */ = {
 			isa = PBXGroup;
 			children = (
+				AF94005711C03F6500085DB9 /* SymbolVendor.cpp */,
 				26BC7C5510F1B6E900F91463 /* Block.h */,
 				26BC7F1310F1B8EC00F91463 /* Block.cpp */,
 				26BC7C5610F1B6E900F91463 /* ClangASTContext.h */,
@@ -1691,7 +1692,6 @@
 				26BC7C6210F1B6E900F91463 /* SymbolFile.h */,
 				26BC7F1D10F1B8EC00F91463 /* SymbolFile.cpp */,
 				26BC7C6310F1B6E900F91463 /* SymbolVendor.h */,
-				26BC7F1E10F1B8EC00F91463 /* SymbolVendor.mm */,
 				26BC7C6410F1B6E900F91463 /* Symtab.h */,
 				26BC7F1F10F1B8EC00F91463 /* Symtab.cpp */,
 				26BC7C6510F1B6E900F91463 /* Type.h */,
@@ -2457,7 +2457,6 @@
 				26D5B0D811B07550009A862E /* Symbol.cpp in Sources */,
 				26D5B0D911B07550009A862E /* SymbolContext.cpp in Sources */,
 				26D5B0DA11B07550009A862E /* SymbolFile.cpp in Sources */,
-				26D5B0DB11B07550009A862E /* SymbolVendor.mm in Sources */,
 				26D5B0DC11B07550009A862E /* Symtab.cpp in Sources */,
 				26D5B0DD11B07550009A862E /* Type.cpp in Sources */,
 				26D5B0DE11B07550009A862E /* TypeList.cpp in Sources */,
@@ -2622,6 +2621,7 @@
 				49F1A74611B3388F003ED505 /* ClangExpressionDeclMap.cpp in Sources */,
 				49D7072911B5AD11001AD875 /* ClangASTSource.cpp in Sources */,
 				4CA9637B11B6E99A00780E28 /* CommandObjectApropos.cpp in Sources */,
+				AF94005911C03F6500085DB9 /* SymbolVendor.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Removed: lldb/trunk/source/Symbol/SymbolVendor.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/SymbolVendor.mm?rev=105754&view=auto
==============================================================================
--- lldb/trunk/source/Symbol/SymbolVendor.mm (original)
+++ lldb/trunk/source/Symbol/SymbolVendor.mm (removed)
@@ -1,386 +0,0 @@
-//===-- SymbolVendor.mm -----------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "lldb/Symbol/SymbolVendor.h"
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Core/Module.h"
-#include "lldb/Core/PluginManager.h"
-#include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Symbol/SymbolFile.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-
-//----------------------------------------------------------------------
-// FindPlugin
-//
-// Platforms can register a callback to use when creating symbol
-// vendors to allow for complex debug information file setups, and to
-// also allow for finding separate debug information files.
-//----------------------------------------------------------------------
-SymbolVendor*
-SymbolVendor::FindPlugin (Module* module)
-{
-    std::auto_ptr<SymbolVendor> instance_ap;
-    //----------------------------------------------------------------------
-    // We currently only have one debug symbol parser...
-    //----------------------------------------------------------------------
-    SymbolVendorCreateInstance create_callback;
-    for (uint32_t idx = 0; (create_callback = PluginManager::GetSymbolVendorCreateCallbackAtIndex(idx)) != NULL; ++idx)
-    {
-        instance_ap.reset(create_callback(module));
-
-        if (instance_ap.get())
-        {
-            // TODO: make sure this symbol vendor is what we want. We
-            // currently are just returning the first one we find, but
-            // we may want to call this function only when we have our
-            // main executable module and then give all symbol vendor
-            // plug-ins a chance to compete for who wins.
-            return instance_ap.release();
-        }
-    }
-    // The default implementation just tries to create debug information using the
-    // file representation for the module.
-    instance_ap.reset(new SymbolVendor(module));
-    if (instance_ap.get())
-        instance_ap->AddSymbolFileRepresendation(module->GetObjectFile());
-    return instance_ap.release();
-}
-
-//----------------------------------------------------------------------
-// SymbolVendor constructor
-//----------------------------------------------------------------------
-SymbolVendor::SymbolVendor(Module *module) :
-    ModuleChild(module),
-    m_mutex (Mutex::eMutexTypeRecursive),
-    m_type_list(),
-    m_compile_units(),
-    m_sym_file_ap()
-{
-    ObjectFile * objfile = module->GetObjectFile();
-    ConstString target_triple;
-    if (objfile && objfile->GetTargetTriple(target_triple))
-    {
-        m_type_list.GetClangASTContext().SetTargetTriple (target_triple.AsCString());
-    }
-}
-
-//----------------------------------------------------------------------
-// Destructor
-//----------------------------------------------------------------------
-SymbolVendor::~SymbolVendor()
-{
-}
-
-//----------------------------------------------------------------------
-// Add a represantion given an object file.
-//----------------------------------------------------------------------
-void
-SymbolVendor::AddSymbolFileRepresendation(ObjectFile *obj_file)
-{
-    Mutex::Locker locker(m_mutex);
-    if (obj_file != NULL)
-        m_sym_file_ap.reset(SymbolFile::FindPlugin(obj_file));
-}
-
-bool
-SymbolVendor::SetCompileUnitAtIndex
-(CompUnitSP& cu, uint32_t idx)
-{
-    Mutex::Locker locker(m_mutex);
-    const uint32_t num_compile_units = GetNumCompileUnits();
-    if (idx < num_compile_units)
-    {
-        // Fire off an assertion if this compile unit already exists for now.
-        // The partial parsing should take care of only setting the compile
-        // unit once, so if this assertion fails, we need to make sure that
-        // we don't have a race condition, or have a second parse of the same
-        // compile unit.
-        assert(m_compile_units[idx].get() == NULL);
-        m_compile_units[idx] = cu;
-        return true;
-    }
-    return false;
-}
-
-uint32_t
-SymbolVendor::GetNumCompileUnits()
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_compile_units.empty())
-    {
-        if (m_sym_file_ap.get())
-        {
-            // Resize our array of compile unit shared pointers -- which will
-            // each remain NULL until someone asks for the actual compile unit
-            // information. When this happens, the symbol file will be asked
-            // to parse this compile unit information.
-            m_compile_units.resize(m_sym_file_ap->GetNumCompileUnits());
-        }
-    }
-    return m_compile_units.size();
-}
-
-size_t
-SymbolVendor::ParseCompileUnitFunctions (const SymbolContext &sc)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->ParseCompileUnitFunctions(sc);
-    return 0;
-}
-
-bool
-SymbolVendor::ParseCompileUnitLineTable (const SymbolContext &sc)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->ParseCompileUnitLineTable(sc);
-    return false;
-}
-
-bool
-SymbolVendor::ParseCompileUnitSupportFiles (const SymbolContext& sc, FileSpecList& support_files)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->ParseCompileUnitSupportFiles(sc, support_files);
-    return false;
-}
-
-size_t
-SymbolVendor::ParseFunctionBlocks (const SymbolContext &sc)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->ParseFunctionBlocks(sc);
-    return 0;
-}
-
-size_t
-SymbolVendor::ParseTypes (const SymbolContext &sc)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->ParseTypes(sc);
-    return 0;
-}
-
-size_t
-SymbolVendor::ParseVariablesForContext (const SymbolContext& sc)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->ParseVariablesForContext(sc);
-    return 0;
-}
-
-Type*
-SymbolVendor::ResolveTypeUID(lldb::user_id_t type_uid)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->ResolveTypeUID(type_uid);
-    return NULL;
-}
-
-
-uint32_t
-SymbolVendor::ResolveSymbolContext (const Address& so_addr, uint32_t resolve_scope, SymbolContext& sc)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->ResolveSymbolContext(so_addr, resolve_scope, sc);
-    return 0;
-}
-
-uint32_t
-SymbolVendor::ResolveSymbolContext (const FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->ResolveSymbolContext(file_spec, line, check_inlines, resolve_scope, sc_list);
-    return 0;
-}
-
-uint32_t
-SymbolVendor::FindGlobalVariables (const ConstString &name, bool append, uint32_t max_matches, VariableList& variables)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->FindGlobalVariables(name, append, max_matches, variables);
-    return 0;
-}
-
-uint32_t
-SymbolVendor::FindGlobalVariables (const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->FindGlobalVariables(regex, append, max_matches, variables);
-    return 0;
-}
-
-uint32_t
-SymbolVendor::FindFunctions(const ConstString &name, bool append, SymbolContextList& sc_list)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->FindFunctions(name, append, sc_list);
-    return 0;
-}
-
-uint32_t
-SymbolVendor::FindFunctions(const RegularExpression& regex, bool append, SymbolContextList& sc_list)
-{
-    Mutex::Locker locker(m_mutex);
-    if (m_sym_file_ap.get())
-        return m_sym_file_ap->FindFunctions(regex, append, sc_list);
-    return 0;
-}
-
-
-
-//uint32_t
-//SymbolVendor::FindTypes(const SymbolContext& sc, const ConstString &name, bool append, uint32_t max_matches, Type::Encoding encoding, const char *udt_name, TypeList& types)
-//{
-//  Mutex::Locker locker(m_mutex);
-//  if (m_sym_file_ap.get())
-//  {
-//      lldb::user_id_t udt_uid = LLDB_INVALID_UID;
-//      if (encoding == Type::user_defined_type)
-//          udt_uid = UserDefType::GetUserDefTypeUID(udt_name);
-//
-//      return m_sym_file_ap->FindTypes(sc, name, append, max_matches, encoding, udt_uid, types);
-//  }
-//  return 0;
-//}
-//
-//uint32_t
-//SymbolVendor::FindTypes(const SymbolContext& sc, const RegularExpression& regex, bool append, uint32_t max_matches, Type::Encoding encoding, const char *udt_name, TypeList& types)
-//{
-//  Mutex::Locker locker(m_mutex);
-//  if (m_sym_file_ap.get())
-//  {
-//      lldb::user_id_t udt_uid = LLDB_INVALID_UID;
-//
-//      if (encoding == Type::user_defined_type)
-//          udt_uid = UserDefType::GetUserDefTypeUID(udt_name);
-//
-//      return m_sym_file_ap->FindTypes(sc, regex, append, max_matches, encoding, udt_uid, types);
-//  }
-//  return 0;
-//}
-
-void
-SymbolVendor::Dump(Stream *s)
-{
-    Mutex::Locker locker(m_mutex);
-    bool show_context = false;
-
-    s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
-    s->Indent();
-    s->PutCString("SymbolVendor");
-    if (m_sym_file_ap.get())
-    {
-        ObjectFile *objfile = m_sym_file_ap->GetObjectFile();
-        if (objfile)
-        {
-            const FileSpec &objfile_file_spec = objfile->GetFileSpec();
-            if (objfile_file_spec)
-            {
-                s->PutCString(" (");
-                objfile_file_spec.Dump(s);
-                s->PutChar(')');
-            }
-        }
-    }
-    s->EOL();
-    s->IndentMore();
-    m_type_list.Dump(s, show_context);
-
-    CompileUnitConstIter cu_pos, cu_end;
-    cu_end = m_compile_units.end();
-    for (cu_pos = m_compile_units.begin(); cu_pos != cu_end; ++cu_pos)
-    {
-        // We currently only dump the compile units that have been parsed
-        if (cu_pos->get())
-            (*cu_pos)->Dump(s, show_context);
-    }
-
-    s->IndentLess();
-
-}
-
-CompUnitSP
-SymbolVendor::GetCompileUnitAtIndex(uint32_t idx)
-{
-    Mutex::Locker locker(m_mutex);
-    CompUnitSP cu_sp;
-    const uint32_t num_compile_units = GetNumCompileUnits();
-    if (idx < num_compile_units)
-    {
-        cu_sp = m_compile_units[idx];
-        if (cu_sp.get() == NULL)
-        {
-            m_compile_units[idx] = m_sym_file_ap->ParseCompileUnitAtIndex(idx);
-            cu_sp = m_compile_units[idx];
-        }
-    }
-    return cu_sp;
-}
-
-
-//------------------------------------------------------------------
-// PluginInterface protocol
-//------------------------------------------------------------------
-const char *
-SymbolVendor::GetPluginName()
-{
-    return "SymbolVendor";
-}
-
-const char *
-SymbolVendor::GetShortPluginName()
-{
-    return "vendor-default";
-}
-
-uint32_t
-SymbolVendor::GetPluginVersion()
-{
-    return 1;
-}
-
-void
-SymbolVendor::GetPluginCommandHelp (const char *command, Stream *strm)
-{
-}
-
-Error
-SymbolVendor::ExecutePluginCommand (Args &command, Stream *strm)
-{
-    Error error;
-    error.SetErrorString("No plug-in command are currently supported.");
-    return error;
-}
-
-Log *
-SymbolVendor::EnablePluginLogging (Stream *strm, Args &command)
-{
-    return NULL;
-}
-
-





More information about the lldb-commits mailing list