This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: I give up.
- From: Mike Stump <mrs at apple dot com>
- To: Jonathan Wilson <jonwil at tpgi dot com dot au>
- Cc: gcc <gcc at gcc dot gnu dot org>
- Date: Wed, 22 Oct 2003 15:12:37 -0700
- Subject: Re: I give up.
On Wednesday, October 22, 2003, at 03:55 AM, Jonathan Wilson wrote:
I cant find anything on google about the various RTL functions (like
gen_rtx_UNSPEC).
google isn't quite the right tool for this.
I cant find anything in the GCC docs.
Read an memorize them all, that way, you will trivially know everything
in them, and you won't have to find much. Seriously though, M-x grep,
then '\<unspec\>' doc/*.texi finds 6 hits in 1/2 second or less. And
from that, we can read up on unspec and what it does. After you step
around in code you want to work in, you start noticing things, like
function that start with gen_ usually generate things, what what they
generate is given by the rest of the name (and maybe in the arguments).
What you see this pattern, you will just know that gen_unspec
generates an unspec, and a quick glace at the texi file tells you in
rough terms what an unspec is.
Think of them as self-contained black boxes, into which the compiler
doesn't peer.
And I cant find anything in the source code for these specific
functions (I cant even FIND their code)
Standard technique 3:
Just fire up emacs, type M-x gdb, then gdb cc1, then set a breakpoint
just before the area you are interested in, then type step and you can
watch it go into the routine you're interested in. Emacs will just pull
up the source code for you automagically.
handy gcc specific knowledge:
In time, you realize all source code is in gcc/*.[ch] gcc/config/*.[ch]
gcc/config/*/*.[ch] and in the build directory in gcc/*.[ch], and that
make TAGS will build an index for you, and M-. in emacs will take you
to just about any of them, though not things in the build tree like
gen_rtx_UNSPEC.