mirror of
https://github.com/RPCSX/llvm.git
synced 2025-05-13 19:06:05 +00:00
Do not record line number to implicitly mark start of function if function has arguments. Extra line number entries trip gdb in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83563 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bfa19bf4c2
commit
eda312193d
@ -1782,17 +1782,23 @@ void DwarfDebug::EndModule() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// CollectVariableInfo - Populate DbgScope entries with variables' info.
|
/// CollectVariableInfo - Populate DbgScope entries with variables' info.
|
||||||
void DwarfDebug::CollectVariableInfo() {
|
bool DwarfDebug::CollectVariableInfo() {
|
||||||
if (!MMI) return;
|
if (!MMI) return false;
|
||||||
|
bool ArgsCollected = false;
|
||||||
MachineModuleInfo::VariableDbgInfoMapTy &VMap = MMI->getVariableDbgInfo();
|
MachineModuleInfo::VariableDbgInfoMapTy &VMap = MMI->getVariableDbgInfo();
|
||||||
for (MachineModuleInfo::VariableDbgInfoMapTy::iterator VI = VMap.begin(),
|
for (MachineModuleInfo::VariableDbgInfoMapTy::iterator VI = VMap.begin(),
|
||||||
VE = VMap.end(); VI != VE; ++VI) {
|
VE = VMap.end(); VI != VE; ++VI) {
|
||||||
MDNode *Var = VI->first;
|
MDNode *Var = VI->first;
|
||||||
|
DIVariable DV (Var);
|
||||||
|
if (DV.isNull()) continue;
|
||||||
|
if (DV.getTag() == dwarf::DW_TAG_arg_variable)
|
||||||
|
ArgsCollected = true;
|
||||||
DILocation VLoc(VI->second.first);
|
DILocation VLoc(VI->second.first);
|
||||||
unsigned VSlot = VI->second.second;
|
unsigned VSlot = VI->second.second;
|
||||||
DbgScope *Scope = getDbgScope(VLoc.getScope().getNode(), NULL);
|
DbgScope *Scope = getDbgScope(VLoc.getScope().getNode(), NULL);
|
||||||
Scope->AddVariable(new DbgVariable(DIVariable(Var), VSlot, false));
|
Scope->AddVariable(new DbgVariable(DV, VSlot, false));
|
||||||
}
|
}
|
||||||
|
return ArgsCollected;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// SetDbgScopeBeginLabels - Update DbgScope begin labels for the scopes that
|
/// SetDbgScopeBeginLabels - Update DbgScope begin labels for the scopes that
|
||||||
@ -1903,7 +1909,7 @@ void DwarfDebug::BeginFunction(MachineFunction *MF) {
|
|||||||
#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
|
#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
|
||||||
if (!ExtractScopeInformation(MF))
|
if (!ExtractScopeInformation(MF))
|
||||||
return;
|
return;
|
||||||
CollectVariableInfo();
|
bool ArgsCollected = CollectVariableInfo();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Begin accumulating function debug information.
|
// Begin accumulating function debug information.
|
||||||
@ -1914,14 +1920,19 @@ void DwarfDebug::BeginFunction(MachineFunction *MF) {
|
|||||||
|
|
||||||
// Emit label for the implicitly defined dbg.stoppoint at the start of the
|
// Emit label for the implicitly defined dbg.stoppoint at the start of the
|
||||||
// function.
|
// function.
|
||||||
DebugLoc FDL = MF->getDefaultDebugLoc();
|
#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
|
||||||
if (!FDL.isUnknown()) {
|
if (!ArgsCollected) {
|
||||||
DebugLocTuple DLT = MF->getDebugLocTuple(FDL);
|
#else
|
||||||
unsigned LabelID = RecordSourceLine(DLT.Line, DLT.Col, DLT.CompileUnit);
|
if (1) {
|
||||||
Asm->printLabel(LabelID);
|
#endif
|
||||||
O << '\n';
|
DebugLoc FDL = MF->getDefaultDebugLoc();
|
||||||
|
if (!FDL.isUnknown()) {
|
||||||
|
DebugLocTuple DLT = MF->getDebugLocTuple(FDL);
|
||||||
|
unsigned LabelID = RecordSourceLine(DLT.Line, DLT.Col, DLT.CompileUnit);
|
||||||
|
Asm->printLabel(LabelID);
|
||||||
|
O << '\n';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TimePassesIsEnabled)
|
if (TimePassesIsEnabled)
|
||||||
DebugTimer->stopTimer();
|
DebugTimer->stopTimer();
|
||||||
}
|
}
|
||||||
|
@ -556,7 +556,7 @@ public:
|
|||||||
bool ExtractScopeInformation(MachineFunction *MF);
|
bool ExtractScopeInformation(MachineFunction *MF);
|
||||||
|
|
||||||
/// CollectVariableInfo - Populate DbgScope entries with variables' info.
|
/// CollectVariableInfo - Populate DbgScope entries with variables' info.
|
||||||
void CollectVariableInfo();
|
bool CollectVariableInfo();
|
||||||
|
|
||||||
/// SetDbgScopeBeginLabels - Update DbgScope begin labels for the scopes that
|
/// SetDbgScopeBeginLabels - Update DbgScope begin labels for the scopes that
|
||||||
/// start with this machine instruction.
|
/// start with this machine instruction.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user