public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Lars Segerlund <lars.segerlund@comsys.se>
To: Fergus Henderson <fjh@cs.mu.OZ.AU>
Cc: gcc@gcc.gnu.org
Subject: Re: Synthetic register related: Seg fault
Date: Wed, 15 Jan 2003 20:01:00 -0000	[thread overview]
Message-ID: <3E252188.3060606@comsys.se> (raw)
In-Reply-To: <20030115194943.A16830@hg.cs.mu.OZ.AU>

Thanks, this is tremendously good info, it will make some things much 
more easy for me :-) ... I have been needing something like this for a time.

  / regards, Lars Segerlund.

Fergus Henderson wrote:
> On 15-Jan-2003, Andy Walker <ja_walker@earthlink.net> wrote:
> 
>>What would be the best approach to hunting down flaws that cause things like 
>>this Segmentation fault?
> 
> 
> Configure GCC with --enable-checking.
> Compile it with `-g' so that you can use gdb.
> 
> Compile your test case with `-v -da -Q'.
> `-Q' will show which function in the test case is causing it to crash.
> `-v' shows how `cc1' was invoked (useful for invoking cc1 manually in
> gdb).  `-da' dumps the RTL to a file after each stage.
> 
> Use gdb to get a stack trace.
> Compile the compiler with debugging enabled (-g),
> use the `-v' option to see how cc1 is getting invoked,
> and then do
> 
> 	bash$ gdb cc1
> 	gdb> run <arguments>
> 	... (it will stop at the Seg fault)
> 	gdb> where
> 	...
> 	gdb> list
> 
> Print out the values of interesting variables (e.g. the ones
> in the statement which got a segmentation fault).
> You can use the `pt' and `pr' macros from the gdbinit.in file to
> display them.  For example, if there is a value of type `tree' named
> `t', and a value of type `rtx' named `r', you can use these commands:
> 
> 	gdb> source .gdbinit
> 	gdb> print t
> 	gdb> pt
> 	gdb> print r
> 	gdb> pr
> 	gdb> pt
> 

  reply	other threads:[~2003-01-15  8:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-15 18:43 Andy Walker
2003-01-15 19:46 ` Fergus Henderson
2003-01-15 20:01   ` Lars Segerlund [this message]
2003-01-16 18:03   ` [wwwdocs] segfault.html (was Synthetic register related: Seg fault) - segfault.html [1/1] Kelley Cook
2003-01-16 19:33     ` Janis Johnson
2003-01-16 20:06       ` Joseph S. Myers
2003-01-16 21:03         ` Janis Johnson

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=3E252188.3060606@comsys.se \
    --to=lars.segerlund@comsys.se \
    --cc=fjh@cs.mu.OZ.AU \
    --cc=gcc@gcc.gnu.org \
    /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).