comes from by using a virtual function to provide it from the Module's SymbolVendor by default. This allows the DWARF parser, when being used to parse DWARF in .o files with a parent DWARF + debug map parser, to get its type list from the DWARF + debug map parser so when we go and find full definitions for types (that might come from other .o files), we can use the type list from the debug map parser. Otherwise we ended up mixing clang types from one .o file (say a const pointer to a forward declaration "class A") with the a full type from another .o file. This causes expression parsing, when copying the clang types from those parsed by the DWARF parser into the expression AST, to fail -- for good reason. Now all types are created in the same list. Also added host support for crash description strings that can be set before doing a piece of work. On MacOSX, this ties in with CrashReporter support that allows a string to be dispalyed when the app crashes and allows LLDB.framework to print a description string in the crash log. Right now this is hookup up the the CommandInterpreter::HandleCommand() where each command notes that it is about to be executed, so if we crash while trying to do this command, we should be able to see the command that caused LLDB to exit. For all other platforms, this is a nop. llvm-svn: 118672
57 lines
1.9 KiB
C++
57 lines
1.9 KiB
C++
//===-- SymbolFile.cpp ------------------------------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "lldb/lldb-private.h"
|
|
#include "lldb/Symbol/SymbolFile.h"
|
|
#include "lldb/Core/Module.h"
|
|
#include "lldb/Core/PluginManager.h"
|
|
#include "lldb/Symbol/ObjectFile.h"
|
|
|
|
using namespace lldb_private;
|
|
|
|
SymbolFile*
|
|
SymbolFile::FindPlugin (ObjectFile* obj_file)
|
|
{
|
|
std::auto_ptr<SymbolFile> best_sym_file_ap;
|
|
if (obj_file != NULL)
|
|
{
|
|
// TODO: Load any plug-ins in the appropriate plug-in search paths and
|
|
// iterate over all of them to find the best one for the job.
|
|
|
|
//----------------------------------------------------------------------
|
|
// We currently only have one debug symbol parser...
|
|
//----------------------------------------------------------------------
|
|
std::auto_ptr<SymbolFile> best_symfile_ap;
|
|
uint32_t best_symfile_abilities = 0;
|
|
|
|
SymbolFileCreateInstance create_callback;
|
|
for (uint32_t idx = 0; (create_callback = PluginManager::GetSymbolFileCreateCallbackAtIndex(idx)) != NULL; ++idx)
|
|
{
|
|
std::auto_ptr<SymbolFile> curr_symfile_ap(create_callback(obj_file));
|
|
|
|
if (curr_symfile_ap.get())
|
|
{
|
|
uint32_t sym_file_abilities = curr_symfile_ap->GetAbilities();
|
|
if (sym_file_abilities > best_symfile_abilities)
|
|
{
|
|
best_symfile_abilities = sym_file_abilities;
|
|
best_sym_file_ap = curr_symfile_ap;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return best_sym_file_ap.release();
|
|
}
|
|
|
|
TypeList *
|
|
SymbolFile::GetTypeList ()
|
|
{
|
|
return m_obj_file->GetModule()->GetTypeList();
|
|
}
|