public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dave Korn <dave.korn.cygwin@googlemail.com>
To: daniel tian <daniel.xntian@gmail.com>
Cc: Dave Korn <dave.korn.cygwin@googlemail.com>,
	gcc@gcc.gnu.org,   Ian Lance Taylor <iant@google.com>,
	 peng.zheng@mavrixtech.com
Subject: Re: DImode operations
Date: Thu, 24 Sep 2009 14:49:00 -0000	[thread overview]
Message-ID: <4ABB8A50.6070307@gmail.com> (raw)
In-Reply-To: <121fadb80909240005l3e6b5311s5740258ac411a999@mail.gmail.com>

daniel tian wrote:
> Thanks. I am working for it now.
> But I have a question about how to debug the cc1 with libgcc1.c.
> because if I run the cc1 to build the libgcc2.c, lots of errors
> occurred.
> 
> Run the cc1 with the command:
> ./cc1 -g -I../../rice-gcc-4.3.0/gcc
> -I../../rice-gcc-4.3.0/gcc/../include
> ../../rice-gcc-4.3.0/gcc/libgcc2.c
> 
> here is the error message:

> Did I do something wrong?

  Yes, it can't work that simply; the code in libgcc2.c needs a bunch of
macros defined and some other -I paths as well before it will work.  One way
is to

- in the gcc/ subdir of your build directory, delete one of the libgcc .o
files that you want to test your new compiler against
- run "make 2>&1 | tee build.log" to capture the xgcc command that the
makefile generates to rebuild that .o file.
- copy and paste the commandline from the build log and add "-v 2>&1 | tee
rebuild.log" at the end to capture the way the xgcc driver invokes cc1
- copy and paste /that/ commandline, and put "gdb --args" at the front of it
to debug your compiler.

  See also http://gcc.gnu.org/wiki/DebuggingGCC

    cheers,
      DaveK



      parent reply	other threads:[~2009-09-24 14:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-23 11:10 daniel tian
2009-09-23 13:02 ` Dave Korn
2009-09-24  7:05   ` daniel tian
2009-09-24  9:01     ` daniel tian
2009-09-24 14:54       ` Dave Korn
2009-09-28 10:50         ` daniel tian
2009-09-28 11:44           ` daniel tian
2009-09-28 13:07           ` Dave Korn
2009-09-29  2:00             ` daniel tian
2009-09-29  6:50               ` daniel tian
2009-09-29 14:56                 ` Ian Lance Taylor
2009-09-30 12:39                   ` daniel tian
2009-09-24 14:49     ` Dave Korn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ABB8A50.6070307@gmail.com \
    --to=dave.korn.cygwin@googlemail.com \
    --cc=daniel.xntian@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=iant@google.com \
    --cc=peng.zheng@mavrixtech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).