From: Michael Snyder <msnyder@vmware.com>
To: 明覺 <shi.minjue@gmail.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: how to debug this error by gdb?
Date: Mon, 11 May 2009 17:21:00 -0000 [thread overview]
Message-ID: <4A085EDE.3060803@vmware.com> (raw)
In-Reply-To: <6a8fced30905101934j2aa94d27i210484a99a523ce5@mail.gmail.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=Big5, Size: 1278 bytes --]
©úı wrote:
> I'm debugging a application, for it crashes at line 660 of file
> glxcmds.c, which is a file of mesa-7.4.1
> here is the source code at which it crashes:
> ---------------------------------------------------------------------------------------
> PUBLIC void glXWaitX(void)
> {
> ......
> if (psc->driScreen->waitX != NULL)
> [line 660] (*psc->driScreen->waitX)(pdraw);
> .....
> }
> ---------------------------------------------------------------------------------------
>
>
> and here is the gdb info:
> ---------------------------------------------------------------------------------------
> (gdb) break glxcmds.c:660
> Breakpoint 1 (glxcmds.c:660) pending.
> (gdb) run
> Breakpoint 1, glXWaitX () at glxcmds.c:660
> (gdb) print psc->driScreen->waitX
> $3 = (void (*)(__GLXDRIdrawable *)) 0x47206769666e6f63
> (gdb) print *psc->driScreen->waitX
> Cannot access memory at address
> (gdb) step
> Program received signal SIGSEGV, Segmentation fault.
> ---------------------------------------------------------------------------------------
First you need to "print psc", to see if that pointer is valid.
Then print psc->driScreen, to see if that pointer is valid.
Only then can you examine something pointed to by psc->driScreen.
next prev parent reply other threads:[~2009-05-11 17:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-11 2:35 明覺
2009-05-11 3:12 ` Eli Zaretskii
2009-05-11 4:55 ` 明覺
2009-05-11 6:24 ` Paul Pluzhnikov
2009-05-11 17:21 ` Michael Snyder [this message]
2009-05-12 14:42 ` Frank Ch. Eigler
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=4A085EDE.3060803@vmware.com \
--to=msnyder@vmware.com \
--cc=gdb@sourceware.org \
--cc=shi.minjue@gmail.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