This patch provides ARM/ELF application debugging (DWARF format) for ARM
backend.
--
Raul Fernandes Herbster
Embedded and Pervasive Computing Laboratory - embedded.dee.ufcg.edu.br
Electrical Engineering Department - DEE - www.ee.ufcg.edu.br
Electrical Engineering and Informatics Center - CEEI
Federal University of Campina Grande - UFCG - www.ufcg.edu.br
Caixa Postal 10105
58109-970 Campina Grande - PB - Brasil
Index: lib/Target/ARM/ARMAsmPrinter.cpp
===================================================================
RCS file: /var/cvs/llvm/llvm/lib/Target/ARM/ARMAsmPrinter.cpp,v
retrieving revision 1.69
diff -u -r1.69 ARMAsmPrinter.cpp
--- lib/Target/ARM/ARMAsmPrinter.cpp 30 Apr 2007 00:23:51 -0000 1.69
+++ lib/Target/ARM/ARMAsmPrinter.cpp 2 May 2007 11:43:41 -0000
@@ -175,9 +175,7 @@
bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
AFI = MF.getInfo<ARMFunctionInfo>();
- if (Subtarget->isTargetDarwin()) {
- DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
- }
+ DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
SetupMachineFunction(MF);
O << "\n";
@@ -231,10 +229,8 @@
EmitAlignment(2, F);
O << CurrentFnName << ":\n";
- if (Subtarget->isTargetDarwin()) {
- // Emit pre-function debug information.
- DW.BeginFunction(&MF);
- }
+ // Emit pre-function debug information.
+ DW.BeginFunction(&MF);
// Print out code for the function.
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
@@ -254,10 +250,8 @@
if (TAI->hasDotTypeDotSizeDirective())
O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n";
- if (Subtarget->isTargetDarwin()) {
- // Emit post-function debug information.
- DW.EndFunction();
- }
+ // Emit post-function debug information.
+ DW.EndFunction();
return false;
}
@@ -763,10 +757,8 @@
}
bool ARMAsmPrinter::doInitialization(Module &M) {
- if (Subtarget->isTargetDarwin()) {
- // Emit initial debug information.
- DW.BeginModule(&M);
- }
+ // Emit initial debug information.
+ DW.BeginModule(&M);
return AsmPrinter::doInitialization(M);
}
@@ -992,6 +984,9 @@
// linker can safely perform dead code stripping. Since LLVM never
// generates code that does this, it is always safe to set.
O << "\t.subsections_via_symbols\n";
+ } else {
+ // Emit final debug information for ELF.
+ DW.EndModule();
}
AsmPrinter::doFinalization(M);
Index: lib/Target/ARM/ARMISelLowering.cpp
===================================================================
RCS file: /var/cvs/llvm/llvm/lib/Target/ARM/ARMISelLowering.cpp,v
retrieving revision 1.47
diff -u -r1.47 ARMISelLowering.cpp
--- lib/Target/ARM/ARMISelLowering.cpp 27 Apr 2007 13:54:47 -0000 1.47
+++ lib/Target/ARM/ARMISelLowering.cpp 2 May 2007 11:43:41 -0000
@@ -178,9 +178,6 @@
// Support label based line numbers.
setOperationAction(ISD::LOCATION, MVT::Other, Expand);
setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
- // FIXME - use subtarget debug flags
- if (!Subtarget->isTargetDarwin())
- setOperationAction(ISD::LABEL, MVT::Other, Expand);
setOperationAction(ISD::RET, MVT::Other, Custom);
setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
Index: lib/Target/ARM/ARMRegisterInfo.cpp
===================================================================
RCS file: /var/cvs/llvm/llvm/lib/Target/ARM/ARMRegisterInfo.cpp,v
retrieving revision 1.92
diff -u -r1.92 ARMRegisterInfo.cpp
--- lib/Target/ARM/ARMRegisterInfo.cpp 1 May 2007 09:13:03 -0000 1.92
+++ lib/Target/ARM/ARMRegisterInfo.cpp 2 May 2007 11:43:41 -0000
@@ -1373,6 +1373,11 @@
emitSPUpdate(MBB, MBBI, -NumBytes, isThumb, TII);
}
+ if(STI.isTargetELF() && hasFP(MF)) {
+ MFI->setOffsetAdjustment(MFI->getOffsetAdjustment() -
+ AFI->getFramePtrSpillOffset());
+ }
+
AFI->setGPRCalleeSavedArea1Size(GPRCS1Size);
AFI->setGPRCalleeSavedArea2Size(GPRCS2Size);
AFI->setDPRCalleeSavedAreaSize(DPRCSSize);
Index: lib/Target/ARM/ARMTargetAsmInfo.cpp
===================================================================
RCS file: /var/cvs/llvm/llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp,v
retrieving revision 1.19
diff -u -r1.19 ARMTargetAsmInfo.cpp
--- lib/Target/ARM/ARMTargetAsmInfo.cpp 2 May 2007 01:02:40 -0000 1.19
+++ lib/Target/ARM/ARMTargetAsmInfo.cpp 2 May 2007 11:43:41 -0000
@@ -63,8 +63,25 @@
DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
} else {
+ NeedsSet = false;
+ HasLEB128 = true;
+ AbsoluteSectionOffsets = true;
+ ReadOnlySection = "\t.section\t.rodata\n";
PrivateGlobalPrefix = ".L";
WeakRefDirective = "\t.weak\t";
+ DwarfRequiresFrameSection = false;
+ DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",%progbits";
+ DwarfInfoSection = "\t.section\t.debug_info,\"\",%progbits";
+ DwarfLineSection = "\t.section\t.debug_line,\"\",%progbits";
+ DwarfFrameSection = "\t.section\t.debug_frame,\"\",%progbits";
+ DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",%progbits";
+ DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",%progbits";
+ DwarfStrSection = "\t.section\t.debug_str,\"\",%progbits";
+ DwarfLocSection = "\t.section\t.debug_loc,\"\",%progbits";
+ DwarfARangesSection = "\t.section\t.debug_aranges,\"\",%progbits";
+ DwarfRangesSection = "\t.section\t.debug_ranges,\"\",%progbits";
+ DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",%progbits";
+
if (Subtarget->isAAPCS_ABI()) {
StaticCtorsSection = "\t.section .init_array,\"aw\",%init_array";
StaticDtorsSection = "\t.section .fini_array,\"aw\",%fini_array";
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits