Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Wu Zhou <woodzltc@cn.ibm.com>
To: gdb@sources.redhat.com
Subject: Re: Program terminated with SIGSEGV when trying to print an array element
Date: Thu, 09 Jun 2005 02:47:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.63.0506091037270.17300@plinuxt18.cn.ibm.com> (raw)
In-Reply-To: <20050608130715.GA4861@nevyn.them.org>

On Wed, 8 Jun 2005, Daniel Jacobowitz wrote:

> On Wed, Jun 08, 2005 at 02:52:20PM +0800, Wu Zhou wrote:
> > Sure.  But now I am having difficulty in one problem: given an struct value 
> > with the type being TYPE_CODE_PTR, how to get the value of the array (or 
> > string or whatever) it refer to?  We need to know this to go on with the 
> > following evaluation.  I had thought that function "value_from_pointer" 
> > will do this, but it turn out to be false.  Anyone could help on this? 
> 
> Usually, value_ind.  Do you have a pointer to a TYPE_CODE_ARRAY, or has
> the array decayed into a pointer (like in C)?

Thank you, Daniel! "value_ind" worked.  I will clean up a patch for this 
later and send to gdb-patches for review.  

BTW, to answer your question, what I have is a pointer to a value with the
type being TYPE_CODE_ARRAY.  It is not like that in C.

Cheers
- Wu Zhou 


      reply	other threads:[~2005-06-09  2:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-07  8:14 Wu Zhou
2005-06-07  9:03 ` Wu Zhou
2005-06-07 13:14   ` Daniel Jacobowitz
2005-06-08  6:57     ` Wu Zhou
2005-06-08 13:07       ` Daniel Jacobowitz
2005-06-09  2:47         ` Wu Zhou [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=Pine.LNX.4.63.0506091037270.17300@plinuxt18.cn.ibm.com \
    --to=woodzltc@cn.ibm.com \
    --cc=gdb@sources.redhat.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