mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 06:24:57 +00:00
DebugInfo: Emit function definitions within their namespace scope.
This workaround (presumably for ancient GDB) doesn't appear to be required (GDB 7.5 seems to tolerate function definition DIEs in namespace scope just fine). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209189 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -326,28 +326,6 @@ DIE &DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU,
|
||||
// Pick up abstract subprogram DIE.
|
||||
SPDie = &SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie());
|
||||
SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_abstract_origin, *AbsSPDIE);
|
||||
} else if (!SP.getFunctionDeclaration()) {
|
||||
// There is not any need to generate specification DIE for a function
|
||||
// defined at compile unit level. If a function is defined inside another
|
||||
// function then gdb prefers the definition at top level and but does not
|
||||
// expect specification DIE in parent function. So avoid creating
|
||||
// specification DIE for a function defined inside a function.
|
||||
DIScope SPContext = resolve(SP.getContext());
|
||||
if (SP.isDefinition() && !SPContext.isCompileUnit() &&
|
||||
!SPContext.isFile() && !isSubprogramContext(SPContext)) {
|
||||
SPCU.addFlag(*SPDie, dwarf::DW_AT_declaration);
|
||||
|
||||
// Add arguments.
|
||||
DICompositeType SPTy = SP.getType();
|
||||
DIArray Args = SPTy.getTypeArray();
|
||||
uint16_t SPTag = SPTy.getTag();
|
||||
if (SPTag == dwarf::DW_TAG_subroutine_type)
|
||||
SPCU.constructSubprogramArguments(*SPDie, Args);
|
||||
DIE *SPDeclDie = SPDie;
|
||||
SPDie =
|
||||
&SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie());
|
||||
SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_specification, *SPDeclDie);
|
||||
}
|
||||
}
|
||||
|
||||
attachLowHighPC(SPCU, *SPDie, FunctionBeginSym, FunctionEndSym);
|
||||
|
Reference in New Issue
Block a user