public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC debug
@ 2009-09-28 11:52 daniel tian
       [not found] ` <4AC0A269.5080304@starynkevitch.net>
  2009-09-28 14:25 ` Dave Korn
  0 siblings, 2 replies; 5+ messages in thread
From: daniel tian @ 2009-09-28 11:52 UTC (permalink / raw)
  To: gcc; +Cc: Dave Korn

I follow the instructions from this
website:http://gcc.gnu.org/wiki/DebuggingGCC.
but things is not going to be correct.


bacause when cc1 build libgcc2.c, some error occurred. I have debug
cc1. But If I have to build libgcc2.c,  some complex parameter have to
pass.
I don't know what's xgcc is, but it seems mandatory.  Maybe xgcc will
trigger the cc1, after xgcc processes some preprocessing.
Anyway, I don't know.
Does  anybody have some relevant materials or website, which can give
me an overview.

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.

Any body who can help me.

Thank you very much.

                                                         daniel.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GCC debug
       [not found] ` <4AC0A269.5080304@starynkevitch.net>
@ 2009-09-28 12:08   ` daniel tian
       [not found]     ` <4AC0A4E8.1030205@starynkevitch.net>
  0 siblings, 1 reply; 5+ messages in thread
From: daniel tian @ 2009-09-28 12:08 UTC (permalink / raw)
  To: Basile STARYNKEVITCH; +Cc: gcc

Thanks.
But how to debug cc1. Because now I port the gcc to my RISC target.
But when build the libgcc2.c.  Some error occurred. So i have to debug
it.
Any advice about how to debug?

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.

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Fwd: GCC debug
       [not found]       ` <121fadb80909280507v38ffc685id222096ac846fd44@mail.gmail.com>
@ 2009-09-28 12:14         ` daniel tian
  2009-09-28 13:01           ` Andrew Haley
  0 siblings, 1 reply; 5+ messages in thread
From: daniel tian @ 2009-09-28 12:14 UTC (permalink / raw)
  To: gcc

2009/9/28 Basile STARYNKEVITCH <basile@starynkevitch.net>:
> daniel tian wrote:
>>
>> Thanks.
>> But how to debug cc1. Because now I port the gcc to my RISC target.
>> But when build the libgcc2.c.  Some error occurred. So i have to debug
>> it.
>> Any advice about how to debug?
>
>
> Start gdb from the build directory (more precisely from $BUILDIR/gcc)
>
> BTW, I am not sure your question belongs to gcc@gcc.gnu.org - it is really a
> beginner's question, and there are several documents about it.
>
> This is why I reply to you only, not to the list.
>
Thanks.
You didn't get my point.
If I just start up gdb to debug cc1, cc1 will return with message that
it did't know the parameter I pass to it.
The parameter should preprocess by xgcc first. then cc1 continue to
go. But I start up with xgcc, I can't debug cc1.
The website in my first letter, some steps mentioned about how to
debug cc1 and xgcc. I could't follow. So I ask the question here.
I am sure there are some guy also seen this problem before.

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fwd: GCC debug
  2009-09-28 12:14         ` Fwd: " daniel tian
@ 2009-09-28 13:01           ` Andrew Haley
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Haley @ 2009-09-28 13:01 UTC (permalink / raw)
  To: daniel tian; +Cc: gcc

daniel tian wrote:
> 2009/9/28 Basile STARYNKEVITCH <basile@starynkevitch.net>:
>> daniel tian wrote:
>>> Thanks.
>>> But how to debug cc1. Because now I port the gcc to my RISC target.
>>> But when build the libgcc2.c.  Some error occurred. So i have to debug
>>> it.
>>> Any advice about how to debug?
>>
>> Start gdb from the build directory (more precisely from $BUILDIR/gcc)
>>
>> BTW, I am not sure your question belongs to gcc@gcc.gnu.org - it is really a
>> beginner's question, and there are several documents about it.
>>
>> This is why I reply to you only, not to the list.
>>
> Thanks.
> You didn't get my point.
> If I just start up gdb to debug cc1, cc1 will return with message that
> it did't know the parameter I pass to it.

"gcc -v" shows you all the parameters that are passed to cc1.  You need to
use these in gdb.

Andrew.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GCC debug
  2009-09-28 11:52 GCC debug daniel tian
       [not found] ` <4AC0A269.5080304@starynkevitch.net>
@ 2009-09-28 14:25 ` Dave Korn
  1 sibling, 0 replies; 5+ messages in thread
From: Dave Korn @ 2009-09-28 14:25 UTC (permalink / raw)
  To: daniel tian; +Cc: gcc, Dave Korn

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-28 13:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-28 11:52 GCC debug daniel tian
     [not found] ` <4AC0A269.5080304@starynkevitch.net>
2009-09-28 12:08   ` daniel tian
     [not found]     ` <4AC0A4E8.1030205@starynkevitch.net>
     [not found]       ` <121fadb80909280507v38ffc685id222096ac846fd44@mail.gmail.com>
2009-09-28 12:14         ` Fwd: " daniel tian
2009-09-28 13:01           ` Andrew Haley
2009-09-28 14:25 ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).