This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: how to debug gcc
- From: Ranjit Mathew <rmathew at gmail dot com>
- To: aram bharathi <arambharathi at linuxmail dot org>
- Cc: arm-gnu at codesourcery dot com, gcc <gcc at gcc dot gnu dot org>
- Date: Mon, 10 Jan 2005 11:25:33 +0530
- Subject: Re: how to debug gcc
- References: <20050109064646.C226123CF7@ws5-3.us4.outblaze.com>
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/