llvm.org GIT mirror llvm / e8e5495
Debug support for arm-linux. Patch by Raul Herbster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36690 91177308-0d34-0410-b5e6-96231b3b80d8 Lauro Ramos Venancio 13 years ago
4 changed file(s) with 32 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
174174 bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
175175 AFI = MF.getInfo();
176176
177 if (Subtarget->isTargetDarwin()) {
178 DW.SetModuleInfo(&getAnalysis());
179 }
177 DW.SetModuleInfo(&getAnalysis());
180178
181179 SetupMachineFunction(MF);
182180 O << "\n";
230228 EmitAlignment(2, F);
231229
232230 O << CurrentFnName << ":\n";
233 if (Subtarget->isTargetDarwin()) {
234 // Emit pre-function debug information.
235 DW.BeginFunction(&MF);
236 }
231 // Emit pre-function debug information.
232 DW.BeginFunction(&MF);
237233
238234 // Print out code for the function.
239235 for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
253249 if (TAI->hasDotTypeDotSizeDirective())
254250 O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n";
255251
256 if (Subtarget->isTargetDarwin()) {
257 // Emit post-function debug information.
258 DW.EndFunction();
259 }
252 // Emit post-function debug information.
253 DW.EndFunction();
260254
261255 return false;
262256 }
768762 }
769763
770764 bool ARMAsmPrinter::doInitialization(Module &M) {
771 if (Subtarget->isTargetDarwin()) {
772 // Emit initial debug information.
773 DW.BeginModule(&M);
774 }
765 // Emit initial debug information.
766 DW.BeginModule(&M);
775767
776768 return AsmPrinter::doInitialization(M);
777769 }
997989 // linker can safely perform dead code stripping. Since LLVM never
998990 // generates code that does this, it is always safe to set.
999991 O << "\t.subsections_via_symbols\n";
992 } else {
993 // Emit final debug information for ELF.
994 DW.EndModule();
1000995 }
1001996
1002997 AsmPrinter::doFinalization(M);
177177 // Support label based line numbers.
178178 setOperationAction(ISD::LOCATION, MVT::Other, Expand);
179179 setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand);
180 // FIXME - use subtarget debug flags
181 if (!Subtarget->isTargetDarwin())
182 setOperationAction(ISD::LABEL, MVT::Other, Expand);
183180
184181 setOperationAction(ISD::RET, MVT::Other, Custom);
185182 setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
13721372 emitSPUpdate(MBB, MBBI, -NumBytes, isThumb, TII);
13731373 }
13741374
1375 if(STI.isTargetELF() && hasFP(MF)) {
1376 MFI->setOffsetAdjustment(MFI->getOffsetAdjustment() -
1377 AFI->getFramePtrSpillOffset());
1378 }
1379
13751380 AFI->setGPRCalleeSavedArea1Size(GPRCS1Size);
13761381 AFI->setGPRCalleeSavedArea2Size(GPRCS2Size);
13771382 AFI->setDPRCalleeSavedAreaSize(DPRCSSize);
6262 DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
6363 DwarfMacInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
6464 } else {
65 NeedsSet = false;
66 HasLEB128 = true;
67 AbsoluteDebugSectionOffsets = true;
68 ReadOnlySection = "\t.section\t.rodata\n";
6569 PrivateGlobalPrefix = ".L";
6670 WeakRefDirective = "\t.weak\t";
71 DwarfRequiresFrameSection = false;
72 DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",%progbits";
73 DwarfInfoSection = "\t.section\t.debug_info,\"\",%progbits";
74 DwarfLineSection = "\t.section\t.debug_line,\"\",%progbits";
75 DwarfFrameSection = "\t.section\t.debug_frame,\"\",%progbits";
76 DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",%progbits";
77 DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",%progbits";
78 DwarfStrSection = "\t.section\t.debug_str,\"\",%progbits";
79 DwarfLocSection = "\t.section\t.debug_loc,\"\",%progbits";
80 DwarfARangesSection = "\t.section\t.debug_aranges,\"\",%progbits";
81 DwarfRangesSection = "\t.section\t.debug_ranges,\"\",%progbits";
82 DwarfMacInfoSection = "\t.section\t.debug_macinfo,\"\",%progbits";
83
6784 if (Subtarget->isAAPCS_ABI()) {
6885 StaticCtorsSection = "\t.section .init_array,\"aw\",%init_array";
6986 StaticDtorsSection = "\t.section .fini_array,\"aw\",%fini_array";