mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +00:00
Emit DWARF info for all code section in an assembly file
Currently, when using llvm as an assembler, DWARF debug information is only generated for the .text section. This patch modifies this so that DWARF info is emitted for all executable sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211273 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -11,10 +11,12 @@
|
||||
#define LLVM_MC_MCCONTEXT_H
|
||||
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/SetVector.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/MC/MCDwarf.h"
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/SectionKind.h"
|
||||
#include "llvm/Support/Allocator.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
@@ -129,11 +131,10 @@ namespace llvm {
|
||||
/// assembly source files.
|
||||
unsigned GenDwarfFileNumber;
|
||||
|
||||
/// The default initial text section that we generate dwarf debugging line
|
||||
/// info for when generating dwarf assembly source files.
|
||||
const MCSection *GenDwarfSection;
|
||||
/// Symbols created for the start and end of this section.
|
||||
MCSymbol *GenDwarfSectionStartSym, *GenDwarfSectionEndSym;
|
||||
/// Symbols created for the start and end of each section, used for
|
||||
/// generating the .debug_ranges and .debug_aranges sections.
|
||||
MapVector<const MCSection *, std::pair<MCSymbol *, MCSymbol *> >
|
||||
SectionStartEndSyms;
|
||||
|
||||
/// The information gathered from labels that will have dwarf label
|
||||
/// entries when generating dwarf assembly source files.
|
||||
@@ -374,16 +375,18 @@ namespace llvm {
|
||||
void setGenDwarfFileNumber(unsigned FileNumber) {
|
||||
GenDwarfFileNumber = FileNumber;
|
||||
}
|
||||
const MCSection *getGenDwarfSection() { return GenDwarfSection; }
|
||||
void setGenDwarfSection(const MCSection *Sec) { GenDwarfSection = Sec; }
|
||||
MCSymbol *getGenDwarfSectionStartSym() { return GenDwarfSectionStartSym; }
|
||||
void setGenDwarfSectionStartSym(MCSymbol *Sym) {
|
||||
GenDwarfSectionStartSym = Sym;
|
||||
MapVector<const MCSection *, std::pair<MCSymbol *, MCSymbol *> > &
|
||||
getGenDwarfSectionSyms() {
|
||||
return SectionStartEndSyms;
|
||||
}
|
||||
MCSymbol *getGenDwarfSectionEndSym() { return GenDwarfSectionEndSym; }
|
||||
void setGenDwarfSectionEndSym(MCSymbol *Sym) {
|
||||
GenDwarfSectionEndSym = Sym;
|
||||
std::pair<MapVector<const MCSection *,
|
||||
std::pair<MCSymbol *, MCSymbol *> >::iterator,
|
||||
bool>
|
||||
addGenDwarfSection(const MCSection *Sec) {
|
||||
return SectionStartEndSyms.insert(
|
||||
std::make_pair(Sec, std::make_pair(nullptr, nullptr)));
|
||||
}
|
||||
void finalizeDwarfSections(MCStreamer &MCOS);
|
||||
const std::vector<MCGenDwarfLabelEntry> &getMCGenDwarfLabelEntries() const {
|
||||
return MCGenDwarfLabelEntries;
|
||||
}
|
||||
|
||||
@@ -126,6 +126,10 @@ public:
|
||||
void EmitFill(uint64_t NumBytes, uint8_t FillValue) override;
|
||||
void EmitZeros(uint64_t NumBytes) override;
|
||||
void FinishImpl() override;
|
||||
|
||||
virtual bool mayHaveInstructions() const {
|
||||
return getCurrentSectionData()->hasInstructions();
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
@@ -722,6 +722,8 @@ public:
|
||||
virtual void FinishImpl() = 0;
|
||||
/// Finish - Finish emission of machine code.
|
||||
void Finish();
|
||||
|
||||
virtual bool mayHaveInstructions() const { return true; }
|
||||
};
|
||||
|
||||
/// createNullStreamer - Create a dummy machine code streamer, which does
|
||||
|
||||
Reference in New Issue
Block a user