This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC debug
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: daniel tian <daniel dot xntian at gmail dot com>
- Cc: gcc at gcc dot gnu dot org, Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- Date: Mon, 28 Sep 2009 14:21:58 +0100
- Subject: Re: GCC debug
- References: <121fadb80909280444o7ffc255y4ce27c3ffcb26e8d@mail.gmail.com>
daniel tian wrote:
> And this is the debug problem. And hope somebody can give me a clue.
> command:
> gdb --args $(./xgcc -###
> -B/home/daniel.tian/gcc_rice_dev/rice-binutils/build-gcc/./gcc/
> -B/usr/local/cross/rice-elf/rice-elf/bin/
> -B/usr/local/cross/rice-elf/rice-elf/lib/ -isystem
> /usr/local/cross/rice-elf/rice-elf/include -isystem
> /usr/local/cross/rice-elf/rice-elf/sys-include -O2 -g -g -O2 -O2 -O2
> -g -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall
> -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
> -Wold-style-definition -isystem ./include -g -DIN_LIBGCC2
> -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../.././gcc
> -I../../../rice-gcc-4.3.0/libgcc -I../../../rice-gcc-4.3.0/libgcc/.
> -I../../../rice-gcc-4.3.0/libgcc/../gcc
> -I../../../rice-gcc-4.3.0/libgcc/../include -DHAVE_CC_TLS -o
> _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c
> ../../../rice-gcc-4.3.0/libgcc/../gcc/libgcc2.c 2>&1 | fgrep cc1)
> gdb: `--args' specified but no program specified.
>
It appears that gdb is getting an empty command-line after the "--args"
option. Are you maybe using a non-bash shell (or some old version of bash)
that doesn't support the "$(...)" syntax? You could try using backticks
instead. You could also try running just the part inside "$(...)" separately
to make sure that your fgrep is working. And, as Andrew says, you can run the
xgcc command yourself with -v and copy-paste the cc1 invocation.
cheers,
DaveK