Hi all, FlexyCore, the company I am working for, use LLVM to generate binary for ARM platform. We are very fulfilled with LLVM, and FlexyCore will be pleased to contribute on this software. We need debug support in ARM binary, but, in LLVM 2.4, this support is not activated for ARM backend. Consequently, I made small modifications in order to activate it (see the patch in attach file). My experience is not enough on LLVM to know if it is the right way to solve the problem. But these modifications work on our use cases. Could you help us in order to check if these modifications are corrects or not ? If it is not the right way, could you explain us how to solve this problem in the correct way, and we will be pleased to re-submit patch on this issue. I also use 'make check' command in order to verify that modifications does not generate regressions. Results are: * Without ARM debug support === Summary == # of expected passes 2726 # of unexpected failures 58 # of expected failures 6 * With ARM debug support === Summary == # of expected passes 2727 # of unexpected failures 57 # of expected failures 6 The extra success test is funccall.ll from test/DebugInfo. In order to build successfully LLVM on ARM Linux EABI platform, I put in comment the usage of __register_frame into JIT.cpp because it seems that __register_frame function is not into my libgcc. Could you mention which tools and versions that must to be used in order to build LLVM on ARM Linux EABI platform. Thanks, Mikaël. http://www.nabble.com/file/p20938563/arm-debug-from-llvm2-4.patch arm-debug-from-llvm2-4.patch -- View this message in context: http://www.nabble.com/ARM-Debug-support-patch-tp20938563p20938563.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
Hello, Mikaël> We need debug support in ARM binary, but, in LLVM 2.4, this support is not > activated for ARM backend. Consequently, I made small modifications in order > to activate it (see the patch in attach file). My experience is not enough > on LLVM to know if it is the right way to solve the problem. But these > modifications work on our use cases.asmprinter part looks ok for me. I'll let others comment on DAG part.> The extra success test is funccall.ll from test/DebugInfo. In order to build > successfully LLVM on ARM Linux EABI platform, I put in comment the usage of > __register_frame into JIT.cpp because it seems that __register_frame > function is not into my libgcc.How dwarf frames are registered there then? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Hi Mikaël, Thanks for the patch. Some comments: 1. Please don't use tabs. 2. Index: lib/Target/ARM/ARMInstrInfo.cpp ==================================================================--- lib/Target/ARM/ARMInstrInfo.cpp (revision 14) +++ lib/Target/ARM/ARMInstrInfo.cpp (working copy) @@ -904,7 +904,8 @@ return TAI->getInlineAsmLength(MI- >getOperand(0).getSymbolName()); if (MI->isLabel()) return 0; - if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) + if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF || + MI->getOpcode() == TargetInstrInfo::DECLARE) return 0; Same for ARM::DBG_LABEL. 3. + case ISD::DECLARE: { + SDValue Chain = Op.getOperand(0); + SDValue N1 = Op.getOperand(1); + SDValue N2 = Op.getOperand(2); + + if (!isa<FrameIndexSDNode>(N1)) + break; + + int FI = cast<FrameIndexSDNode>(N1)->getIndex(); Something like this will be better: FrameIndexSDNode *FINode = dyn_cast<FrameIndexSDNode>(N1); if (!FINode) break; int FI = FINode->getIndex(); I'll fix these minor issues and commit the patch for you. Thanks for your contribution! Evan On Dec 10, 2008, at 8:38 AM, Mike-1 wrote:> > Hi all, > > FlexyCore, the company I am working for, use LLVM to generate binary > for ARM > platform. We are very fulfilled with LLVM, and FlexyCore will be > pleased to > contribute on this software. > > > We need debug support in ARM binary, but, in LLVM 2.4, this support > is not > activated for ARM backend. Consequently, I made small modifications > in order > to activate it (see the patch in attach file). My experience is not > enough > on LLVM to know if it is the right way to solve the problem. But these > modifications work on our use cases. > > > > Could you help us in order to check if these modifications are > corrects or > not ? If it is not the right way, could you explain us how to solve > this > problem in the correct way, and we will be pleased to re-submit > patch on > this issue. > > I also use 'make check' command in order to verify that > modifications does > not generate regressions. > Results are: > > * Without ARM debug support > === Summary ==> # of expected passes 2726 > # of unexpected failures 58 > # of expected failures 6 > * With ARM debug support > === Summary ==> # of expected passes 2727 > # of unexpected failures 57 > # of expected failures 6 > > The extra success test is funccall.ll from test/DebugInfo. In order > to build > successfully LLVM on ARM Linux EABI platform, I put in comment the > usage of > __register_frame into JIT.cpp because it seems that __register_frame > function is not into my libgcc. Could you mention which tools and > versions > that must to be used in order to build LLVM on ARM Linux EABI > platform. > > Thanks, > > Mikaël. > > http://www.nabble.com/file/p20938563/arm-debug-from-llvm2-4.patch > arm-debug-from-llvm2-4.patch > -- > View this message in context: http://www.nabble.com/ARM-Debug-support-patch-tp20938563p20938563.html > Sent from the LLVM - Dev mailing list archive at Nabble.com. > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Another problem: + if (isa<GlobalValue>(cpool->getConstVal())) { + GlobalValue *GV = cast<GlobalValue>(cpool- >getConstVal()); This only works in static relocation mode. I'll fix this. Evan On Dec 10, 2008, at 10:29 AM, Evan Cheng wrote:> Hi Mikaël, > > Thanks for the patch. Some comments: > > 1. Please don't use tabs. > 2. > Index: lib/Target/ARM/ARMInstrInfo.cpp > ==================================================================> --- lib/Target/ARM/ARMInstrInfo.cpp (revision 14) > +++ lib/Target/ARM/ARMInstrInfo.cpp (working copy) > @@ -904,7 +904,8 @@ > return TAI->getInlineAsmLength(MI- >> getOperand(0).getSymbolName()); > if (MI->isLabel()) > return 0; > - if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) > + if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF || > + MI->getOpcode() == TargetInstrInfo::DECLARE) > return 0; > > Same for ARM::DBG_LABEL. > > 3. > + case ISD::DECLARE: { > + SDValue Chain = Op.getOperand(0); > + SDValue N1 = Op.getOperand(1); > + SDValue N2 = Op.getOperand(2); > + > + if (!isa<FrameIndexSDNode>(N1)) > + break; > + > + int FI = cast<FrameIndexSDNode>(N1)->getIndex(); > > Something like this will be better: > FrameIndexSDNode *FINode = dyn_cast<FrameIndexSDNode>(N1); > if (!FINode) > break; > int FI = FINode->getIndex(); > > I'll fix these minor issues and commit the patch for you. Thanks for > your contribution! > > Evan > On Dec 10, 2008, at 8:38 AM, Mike-1 wrote: > >> >> Hi all, >> >> FlexyCore, the company I am working for, use LLVM to generate binary >> for ARM >> platform. We are very fulfilled with LLVM, and FlexyCore will be >> pleased to >> contribute on this software. >> >> >> We need debug support in ARM binary, but, in LLVM 2.4, this support >> is not >> activated for ARM backend. Consequently, I made small modifications >> in order >> to activate it (see the patch in attach file). My experience is not >> enough >> on LLVM to know if it is the right way to solve the problem. But >> these >> modifications work on our use cases. >> >> >> >> Could you help us in order to check if these modifications are >> corrects or >> not ? If it is not the right way, could you explain us how to solve >> this >> problem in the correct way, and we will be pleased to re-submit >> patch on >> this issue. >> >> I also use 'make check' command in order to verify that >> modifications does >> not generate regressions. >> Results are: >> >> * Without ARM debug support >> === Summary ==>> # of expected passes 2726 >> # of unexpected failures 58 >> # of expected failures 6 >> * With ARM debug support >> === Summary ==>> # of expected passes 2727 >> # of unexpected failures 57 >> # of expected failures 6 >> >> The extra success test is funccall.ll from test/DebugInfo. In order >> to build >> successfully LLVM on ARM Linux EABI platform, I put in comment the >> usage of >> __register_frame into JIT.cpp because it seems that __register_frame >> function is not into my libgcc. Could you mention which tools and >> versions >> that must to be used in order to build LLVM on ARM Linux EABI >> platform. >> >> Thanks, >> >> Mikaël. >> >> http://www.nabble.com/file/p20938563/arm-debug-from-llvm2-4.patch >> arm-debug-from-llvm2-4.patch >> -- >> View this message in context: http://www.nabble.com/ARM-Debug-support-patch-tp20938563p20938563.html >> Sent from the LLVM - Dev mailing list archive at Nabble.com. >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
I've committed the patch with some fixes. It allows ARM target to generate Dwarf information. However, I did not have much luck debugging llvm produced executables. I would appreciate it very much if you can put the debug support to test and contribute more patches. Thanks, Evan On Dec 10, 2008, at 8:38 AM, Mike-1 wrote:> > Hi all, > > FlexyCore, the company I am working for, use LLVM to generate binary > for ARM > platform. We are very fulfilled with LLVM, and FlexyCore will be > pleased to > contribute on this software. > > > We need debug support in ARM binary, but, in LLVM 2.4, this support > is not > activated for ARM backend. Consequently, I made small modifications > in order > to activate it (see the patch in attach file). My experience is not > enough > on LLVM to know if it is the right way to solve the problem. But these > modifications work on our use cases. > > > > Could you help us in order to check if these modifications are > corrects or > not ? If it is not the right way, could you explain us how to solve > this > problem in the correct way, and we will be pleased to re-submit > patch on > this issue. > > I also use 'make check' command in order to verify that > modifications does > not generate regressions. > Results are: > > * Without ARM debug support > === Summary ==> # of expected passes 2726 > # of unexpected failures 58 > # of expected failures 6 > * With ARM debug support > === Summary ==> # of expected passes 2727 > # of unexpected failures 57 > # of expected failures 6 > > The extra success test is funccall.ll from test/DebugInfo. In order > to build > successfully LLVM on ARM Linux EABI platform, I put in comment the > usage of > __register_frame into JIT.cpp because it seems that __register_frame > function is not into my libgcc. Could you mention which tools and > versions > that must to be used in order to build LLVM on ARM Linux EABI > platform. > > Thanks, > > Mikaël. > > http://www.nabble.com/file/p20938563/arm-debug-from-llvm2-4.patch > arm-debug-from-llvm2-4.patch > -- > View this message in context: http://www.nabble.com/ARM-Debug-support-patch-tp20938563p20938563.html > Sent from the LLVM - Dev mailing list archive at Nabble.com. > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Hi, Evan> I've committed the patch with some fixes. It allows ARM target to > generate Dwarf information. However, I did not have much luck > debugging llvm produced executables. I would appreciate it very much > if you can put the debug support to test and contribute more patches.Maybe encoding is somehow different for arm/linux and arm/darwin? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Thanks for the commit. FlexyCore works only on ARM EABI Linux target for now. This binary with Dwarf information could be debugged with a gdb-server 6.8 without problem on our side. If you are working on ARM Linux target, could you send us LLVM source file, and gdb version ? But if you are using ARM Darwin as Anton suggest, we are unable to test this for now. We are open to help on this target, but we need some help to efficiently setup the right Darwin platform (pre-compile binary platform, qemu, boards ???). Do not hesitate to contact us directly by mail on this topic. Thanks, Mike. Evan Cheng wrote:> > I've committed the patch with some fixes. It allows ARM target to > generate Dwarf information. However, I did not have much luck > debugging llvm produced executables. I would appreciate it very much > if you can put the debug support to test and contribute more patches. > > Thanks, > > Evan > > On Dec 10, 2008, at 8:38 AM, Mike-1 wrote: > >> >> Hi all, >> >> FlexyCore, the company I am working for, use LLVM to generate binary >> for ARM >> platform. We are very fulfilled with LLVM, and FlexyCore will be >> pleased to >> contribute on this software. >> >> >> We need debug support in ARM binary, but, in LLVM 2.4, this support >> is not >> activated for ARM backend. Consequently, I made small modifications >> in order >> to activate it (see the patch in attach file). My experience is not >> enough >> on LLVM to know if it is the right way to solve the problem. But these >> modifications work on our use cases. >> >> >> >> Could you help us in order to check if these modifications are >> corrects or >> not ? If it is not the right way, could you explain us how to solve >> this >> problem in the correct way, and we will be pleased to re-submit >> patch on >> this issue. >> >> I also use 'make check' command in order to verify that >> modifications does >> not generate regressions. >> Results are: >> >> * Without ARM debug support >> === Summary ==>> # of expected passes 2726 >> # of unexpected failures 58 >> # of expected failures 6 >> * With ARM debug support >> === Summary ==>> # of expected passes 2727 >> # of unexpected failures 57 >> # of expected failures 6 >> >> The extra success test is funccall.ll from test/DebugInfo. In order >> to build >> successfully LLVM on ARM Linux EABI platform, I put in comment the >> usage of >> __register_frame into JIT.cpp because it seems that __register_frame >> function is not into my libgcc. Could you mention which tools and >> versions >> that must to be used in order to build LLVM on ARM Linux EABI >> platform. >> >> Thanks, >> >> Mikaël. >> >> http://www.nabble.com/file/p20938563/arm-debug-from-llvm2-4.patch >> arm-debug-from-llvm2-4.patch >> -- >> View this message in context: >> http://www.nabble.com/ARM-Debug-support-patch-tp20938563p20938563.html >> Sent from the LLVM - Dev mailing list archive at Nabble.com. >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-- View this message in context: http://www.nabble.com/ARM-Debug-support-patch-tp20938563p20958834.html Sent from the LLVM - Dev mailing list archive at Nabble.com.