Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Rename GsymDIContext to GsymContext #140227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//===-- GsymDIContext.h --------------------------------------------------===//
//===-- GsymContext.h --------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===/

#ifndef LLVM_DEBUGINFO_GSYM_GSYMDICONTEXT_H
#define LLVM_DEBUGINFO_GSYM_GSYMDICONTEXT_H
#ifndef LLVM_DEBUGINFO_GSYM_GSYMCONTEXT_H
#define LLVM_DEBUGINFO_GSYM_GSYMCONTEXT_H

#include "llvm/DebugInfo/DIContext.h"
#include <cstdint>
Expand All @@ -27,12 +27,12 @@ class GsymReader;
/// interface to different symbolication formats (e.g. GSYM, PDB and DWARF).
/// More control and power over the debug information access can be had by using
/// the GSYM interfaces directly.
class GsymDIContext : public DIContext {
class GsymContext : public DIContext {
public:
GsymDIContext(std::unique_ptr<GsymReader> Reader);
GsymContext(std::unique_ptr<GsymReader> Reader);

GsymDIContext(GsymDIContext &) = delete;
GsymDIContext &operator=(GsymDIContext &) = delete;
GsymContext(GsymContext &) = delete;
GsymContext &operator=(GsymContext &) = delete;

static bool classof(const DIContext *DICtx) {
return DICtx->getKind() == CK_GSYM;
Expand Down Expand Up @@ -63,4 +63,4 @@ class GsymDIContext : public DIContext {

} // end namespace llvm

#endif // LLVM_DEBUGINFO_PDB_PDBCONTEXT_H
#endif // LLVM_DEBUGINFO_GSYM_GSYMCONTEXT_H
2 changes: 1 addition & 1 deletion 2 llvm/lib/DebugInfo/GSYM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_llvm_component_library(LLVMDebugInfoGSYM
FileWriter.cpp
FunctionInfo.cpp
GsymCreator.cpp
GsymDIContext.cpp
GsymContext.cpp
GsymReader.cpp
InlineInfo.cpp
LineTable.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
//===-- GsymDIContext.cpp ------------------------------------------------===//
//===-- GsymContext.cpp ------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===/

#include "llvm/DebugInfo/GSYM/GsymDIContext.h"
#include "llvm/DebugInfo/GSYM/GsymContext.h"

#include "llvm/DebugInfo/GSYM/GsymReader.h"
#include "llvm/Support/Path.h"

using namespace llvm;
using namespace llvm::gsym;

GsymDIContext::GsymDIContext(std::unique_ptr<GsymReader> Reader)
GsymContext::GsymContext(std::unique_ptr<GsymReader> Reader)
: DIContext(CK_GSYM), Reader(std::move(Reader)) {}

void GsymDIContext::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {}
void GsymContext::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {}

static bool fillLineInfoFromLocation(const SourceLocation &Location,
DILineInfoSpecifier Specifier,
Expand Down Expand Up @@ -61,8 +61,8 @@ static bool fillLineInfoFromLocation(const SourceLocation &Location,
}

std::optional<DILineInfo>
GsymDIContext::getLineInfoForAddress(object::SectionedAddress Address,
DILineInfoSpecifier Specifier) {
GsymContext::getLineInfoForAddress(object::SectionedAddress Address,
DILineInfoSpecifier Specifier) {
if (Address.SectionIndex != object::SectionedAddress::UndefSection)
return {};

Expand Down Expand Up @@ -93,16 +93,16 @@ GsymDIContext::getLineInfoForAddress(object::SectionedAddress Address,
}

std::optional<DILineInfo>
GsymDIContext::getLineInfoForDataAddress(object::SectionedAddress Address) {
GsymContext::getLineInfoForDataAddress(object::SectionedAddress Address) {
// We can't implement this, there's no such information in the GSYM file.

return {};
}

DILineInfoTable
GsymDIContext::getLineInfoForAddressRange(object::SectionedAddress Address,
uint64_t Size,
DILineInfoSpecifier Specifier) {
GsymContext::getLineInfoForAddressRange(object::SectionedAddress Address,
uint64_t Size,
DILineInfoSpecifier Specifier) {
if (Size == 0)
return DILineInfoTable();

Expand Down Expand Up @@ -131,8 +131,8 @@ GsymDIContext::getLineInfoForAddressRange(object::SectionedAddress Address,
}

DIInliningInfo
GsymDIContext::getInliningInfoForAddress(object::SectionedAddress Address,
DILineInfoSpecifier Specifier) {
GsymContext::getInliningInfoForAddress(object::SectionedAddress Address,
DILineInfoSpecifier Specifier) {
auto ResultOrErr = Reader->lookup(Address.Address);

if (!ResultOrErr)
Expand All @@ -159,7 +159,7 @@ GsymDIContext::getInliningInfoForAddress(object::SectionedAddress Address,
}

std::vector<DILocal>
GsymDIContext::getLocalsForAddress(object::SectionedAddress Address) {
GsymContext::getLocalsForAddress(object::SectionedAddress Address) {
// We can't implement this, there's no such information in the GSYM file.

return {};
Expand Down
6 changes: 3 additions & 3 deletions 6 llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/DebugInfo/BTF/BTFContext.h"
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/GSYM/GsymDIContext.h"
#include "llvm/DebugInfo/GSYM/GsymContext.h"
#include "llvm/DebugInfo/GSYM/GsymReader.h"
#include "llvm/DebugInfo/PDB/PDB.h"
#include "llvm/DebugInfo/PDB/PDBContext.h"
Expand Down Expand Up @@ -665,7 +665,7 @@ LLVMSymbolizer::getOrCreateModuleInfo(StringRef ModuleName) {
// If this is a COFF object containing PDB info and not containing DWARF
// section, use a PDBContext to symbolize. Otherwise, use DWARF.
// Create a DIContext to symbolize as follows:
// - If there is a GSYM file, create a GsymDIContext.
// - If there is a GSYM file, create a GsymContext.
// - Otherwise, if this is a COFF object containing PDB info, create a
// PDBContext.
// - Otherwise, create a DWARFContext.
Expand All @@ -677,7 +677,7 @@ LLVMSymbolizer::getOrCreateModuleInfo(StringRef ModuleName) {
std::unique_ptr<gsym::GsymReader> Reader =
std::make_unique<gsym::GsymReader>(std::move(*ReaderOrErr));

Context = std::make_unique<gsym::GsymDIContext>(std::move(Reader));
Context = std::make_unique<gsym::GsymContext>(std::move(Reader));
}
}
if (!Context) {
Expand Down
2 changes: 1 addition & 1 deletion 2 llvm/utils/gn/secondary/llvm/lib/DebugInfo/GSYM/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static_library("GSYM") {
"FileWriter.cpp",
"FunctionInfo.cpp",
"GsymCreator.cpp",
"GsymDIContext.cpp",
"GsymContext.cpp",
"GsymReader.cpp",
"Header.cpp",
"InlineInfo.cpp",
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.