[LLVMdev] bugpoint usage

Fernando Magno Quintao Pereira fernando at CS.UCLA.EDU
Wed Feb 21 20:16:22 PST 2007


Hey, Seung,

That's how it works:

$> llvm-gcc hello.c -o hello
$> llc -march=x86 hello.bc -o hello.s
$> gcc -g hello.s -o hello.exe
$> gdb hello.exe

If you want to debug the pass:

$> llvm-gcc hello.c -o hello
$> gdb llc
[inside gdb] run -march=x86 hello.bc -o hello.s

hope it helps,

Fernando

> Thank you so much for this info.
> That's exactly what I want.
> But, I'm still not sure about using -g.
>
> Let me imagine I am modifying x86 assembly instructions and trying to test it with 'hello.c' to check out the assembly is properly emitted.
> I should type "$ llvm-gcc hello.c -o hello" to have the bytecode of 'hello.c'.
> And then I can have an x86 assembly mnemonics with "$ llc -march=x86 hello.bc"
> Where can I use -g?
> llvm-gcc and llc don't seem to have such an option -g.
> Forgive my ignorance.
> Would you mind telling me that?
>
> - Seung
>
> ---- Original message ----
>> Date: Wed, 21 Feb 2007 09:03:17 -0800 (PST)
>> From: Fernando Magno Quintao Pereira <fernando at cs.ucla.edu>
>> Subject: Re: [LLVMdev] bugpoint usage
>> To: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu>
>>
>>
>> Hey, Seung,
>>
>>     I think what you want is to use gdb to debug your pass, isn' it? If
>> you are running your pass with llc (or opt, etc), you only have to do "gdb
>> llc", and the debugger will load all your files and libraries. Then you
>> can set breakpoints, and do everything that gdb does. Also, many times I
>> have been using gdb to debug the assembly code produced by llc. You only
>> have to compile it with -g, and it will work, e.g. gcc p.s -o p.exe ; gdb
>> p.exe.
>>
>> Fernando
>>
>>> Thank you for this information.
>>> If so, is there any way to grasp which kinda data throw in and out in LLVM as shown in such a way in gdb?
>>> Thanks,
>>>
>>> Seung Jae Lee
>>>
>>> ---- Original message ----
>>>> Date: Tue, 20 Feb 2007 23:54:04 -0600
>>>> From: "John T. Criswell" <criswell at cs.uiuc.edu>
>>>> Subject: Re: [LLVMdev] bugpoint usage
>>>> To: LLVM Developers Mailing List <llvmdev at cs.uiuc.edu>
>>>>
>>>> Seung Jae Lee wrote:
>>>>> Hello.
>>>>> Can I use debugging options such as 'step', 'next'(in gdb) also in LLVM bugpoint?
>>>>>
>>>> I assume you're asking if you can use commands like "step" or "next"
>>>> when using bugpoint.  The answer is no, but this is because bugpoint is
>>>> not a debugger like gdb.  Bugpoint is a program that reduces testcases
>>>> that trigger bugs in LLVM passes.
>>>>
>>>> Often times in LLVM development, some large LLVM bytecode file triggers
>>>> a bug in a set of LLVM passes.  It is difficult to know what LLVM passes
>>>> are responsible for the failure or what part of the input is triggering
>>>> the problem.  Bugpoint automates the process of narrowing down where a
>>>> bug is and what input is triggering it.
>>>>
>>>> For more information, you can read about bugpoint at:
>>>>
>>>> http://llvm.org/docs/HowToSubmitABug.html
>>>> http://llvm.org/docs/CommandGuide/html/bugpoint.html
>>>>
>>>> -- John T.
>>>>
>>>>> Thank you.
>>>>> _______________________________________________
>>>>> 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
>>> _______________________________________________
>>> 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
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



More information about the llvm-dev mailing list