This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to debug gcc


aram bharathi wrote:
> hi,
>    i like to debug arm-elf-gcc line by line using gdb.  what command i have to run for this.
>  
> whenever i run
> 
> gdb arm-elf-gcc a.out

Do you *really* mean to feed "a.out" to GCC? Very likely
it's the final, linked executable...


> program exits with one error that 
> 
> starting program : /gcc/bin/arm-elf-gcc
> arm-elf-gcc: no input files
> 
> Program exited with code 01
> 
> what is the correct  option for this

You need to tell GDB that the arguments are for GCC, like so:

  gdb --args arm-elf-gcc a.out

However, this would still debug the GCC driver ('gcc') program
not the actual compiler ('cc1', etc.) spawned by it. You can
do that using Alexandre Oliva's "debugx" script:

  http://gcc.gnu.org/ml/gcc/2004-03/msg01195.html

HTH,
Ranjit.

-- 
Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA.    Web: http://ranjitmathew.hostingzero.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]