Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Hadron <rileyrg@googlemail.com>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: Jim Blandy <jimb@codesourcery.com>,
	 Hadron <hadronquark@googlemail.com>,
	 gdb@sourceware.org
Subject: Re: argc - cant access memory
Date: Tue, 10 Jul 2007 12:13:00 -0000	[thread overview]
Message-ID: <87hcoc5uef.fsf@gmail.com> (raw)
In-Reply-To: <18066.47080.812496.129394@kahikatea.snap.net.nz>


Nick Roberts <nickrob@snap.net.nz> writes:

>  > > I recently compiled and executed an opengl programming guide (redbook)
>  > > example, hello.c, successfully. However, when I try to debug it under
>  > > GUD I get
>  > >
>  > > ,----
>  > > | #0  main (argc=Cannot access memory at address 0x2d
>  > > | ) at hello.c:93
>  > > `----
>  > 
>  > The code you labeled "hello.c" has no line 93.  Are you sure you're
>  > debugging the program you intended to?
>
> Aside from that, I think it just means that the arguments have been optimised
> away.  I think current GCC does this now even if the user doesn't specify
> optimisation.  It doesn't stop you from debugging does it?

There is no 93 you are right as I
clipped the header. Mea culpa.

As for optimizing the arguments away, wouldn't this be the case for all
the lines referencing argc in the main()? But is this the typical
"error" for such a case?

I get the message after stepping over the first line in main and then
when I get to line 3 (in main) then I get

#0  main (argc=191860, argv=0xb7f49850) at hello.c:94

(94 is the line "glutInitWindowSize (250, 250);" in main)

If you say this is normal behaviour then fine, but I haven't experienced
it before. I would be interested to hear if you get the same.


 


  reply	other threads:[~2007-07-10 12:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-09 13:26 Hadron
2007-07-09 21:04 ` Jim Blandy
2007-07-09 22:34   ` Nick Roberts
2007-07-10 12:13     ` Hadron [this message]
2007-07-10 19:41       ` Dave Korn
2007-07-10 19:46         ` Daniel Jacobowitz
2007-07-10 19:50           ` Dave Korn
2007-07-11 21:13         ` Jim Blandy
2007-07-11 17:41       ` Jim Blandy

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=87hcoc5uef.fsf@gmail.com \
    --to=rileyrg@googlemail.com \
    --cc=gdb@sourceware.org \
    --cc=hadronquark@googlemail.com \
    --cc=jimb@codesourcery.com \
    --cc=nickrob@snap.net.nz \
    /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