[LLVMdev] LLVM native code and GDB -> Segmentation Fault

Duncan Sands baldrick at free.fr
Wed Nov 23 02:16:28 PST 2011


On 22/11/11 22:27, Rafael Baldiati Parizi wrote:
> But the error is related to a conversion between llvm and gcc in "gcc-program.s
> -o program"?

No, it isn't.  GCC just calls the system assembler in this case.

> I need to use GDB to make an extraction of the information generated by GDB.
>
> For other programs, the process that wrote the first post worked perfectly,
> except for some.
> That this is the problem, for the compilation is the need to inform the -lm to
> link math libraries. It could be related to this -lm argument ?

No, almost certainly not.  Far more likely is that your program is buggy, for
example uses freed memory.  When running under gdb memory layout may be a bit
different to when not running under gdb I think, so you may see an issue when
running under gdb that you don't see otherwise.  Try running your program under
valgrind.

Ciao, Duncan.

>
> 2011/11/22 Duncan Sands <baldrick at free.fr <mailto:baldrick at free.fr>>
>
>     Hi Rafael,
>
>
>         it is my program that dies.
>
>
>     try running it under valgrind.
>
>     Ciao, Duncan.
>
>
>         Moreover, if I run ./program.native, it works.
>
>         You are missing something?
>
>
>         2011/11/22 Duncan Sands <baldrick at free.fr <mailto:baldrick at free.fr>
>         <mailto:baldrick at free.fr <mailto:baldrick at free.fr>>>
>
>
>             Hi Rafael, is it your program that dies with a segfault, or is it
>         gdb that dies?
>
>             Ciao, Duncan.
>
>          > I have a problem with the generation of native code.
>          > I'm wanting to run a native code with GDB.
>          > When I run the program with "/lli program.bc/ -> OK,
>          > but if I do /"llc program.bc -o program.s/ " and then "/gcc -g
>         program.s -o
>          > program.native/" results in an error when running under GDB.
>          >
>          > Error = Segmentation fault.
>          >
>          > How can I solve this problem?
>          >
>          > Bye
>          >
>          > --
>          > */Rafael Parizi/*
>          >
>          >
>          >
>          >
>          >
>          > ______________________________ _________________
>          > LLVM Developers mailing list
>          > LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>
>         <mailto:LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>>
>         http://llvm.cs.uiuc.edu
>
>          > http://lists.cs.uiuc.edu/ mailman/listinfo/llvmdev
>         <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>
>
>             ______________________________ _________________
>             LLVM Developers mailing list
>         LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>
>         <mailto:LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>>
>         http://llvm.cs.uiuc.edu
>         http://lists.cs.uiuc.edu/ mailman/listinfo/llvmdev
>         <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>
>
>
>
>
>         --
>         */Rafael Parizi/*
>
>
>
>
>
>
>
> --
> */Rafael Parizi/*
>
>
>




More information about the llvm-dev mailing list