Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lldb/include/lldb/Symbol/ObjectFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ class ObjectFile : public std::enable_shared_from_this<ObjectFile>,

static lldb::DataBufferSP MapFileData(const FileSpec &file, uint64_t Size,
uint64_t Offset);
std::string GetObjectName() const;

protected:
// Member variables.
Expand Down
2 changes: 2 additions & 0 deletions lldb/include/lldb/Symbol/SymbolFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ class SymbolFile : public PluginInterface {
return args;
}

std::string GetObjectName() const;

protected:
void AssertModuleLock();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,12 +727,7 @@ void SymbolFileDWARFDebugMap::ForEachSymbolFile(
Progress::kDefaultHighFrequencyReportTime);
for (uint32_t oso_idx = 0; oso_idx < num_oso_idxs; ++oso_idx) {
if (SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx)) {
progress.Increment(oso_idx, oso_dwarf->GetObjectFile()
? oso_dwarf->GetObjectFile()
->GetFileSpec()
.GetFilename()
.GetString()
: "");
progress.Increment(oso_idx, oso_dwarf->GetObjectName());
if (closure(*oso_dwarf) == IterationAction::Stop)
return;
}
Expand Down
9 changes: 9 additions & 0 deletions lldb/source/Symbol/ObjectFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,15 @@ uint32_t ObjectFile::GetCacheHash() {
return *m_cache_hash;
}

std::string ObjectFile::GetObjectName() const {
if (ModuleSP module_sp = GetModule())
if (ConstString object_name = module_sp->GetObjectName())
return llvm::formatv("{0}({1})", GetFileSpec().GetFilename().GetString(),
object_name.GetString())
.str();
return GetFileSpec().GetFilename().GetString();
}

namespace llvm {
namespace json {

Expand Down
8 changes: 8 additions & 0 deletions lldb/source/Symbol/SymbolFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
#include "lldb/Core/PluginManager.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SymbolFileOnDemand.h"
#include "lldb/Symbol/Symtab.h"
#include "lldb/Symbol/TypeMap.h"
#include "lldb/Symbol/TypeSystem.h"
#include "lldb/Symbol/VariableList.h"
Expand Down Expand Up @@ -259,3 +261,9 @@ void SymbolFileCommon::Dump(Stream &s) {
if (Symtab *symtab = GetSymtab())
symtab->Dump(&s, nullptr, eSortOrderNone);
}

std::string SymbolFile::GetObjectName() const {
if (const ObjectFile *object_file = GetObjectFile())
return object_file->GetObjectName();
return "";
}