Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Hui Zhu <teawater@gmail.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [PATCH] printcmd.c (ui_printf): make internalvar string can be printf and eval when inferior cannot alloc memory
Date: Thu, 21 Jul 2011 20:43:00 -0000	[thread overview]
Message-ID: <m339hz1i9v.fsf@fleche.redhat.com> (raw)
In-Reply-To: <CANFwon0RttecHT1BrVx886NC6yCsojHm-MWfr7ttS8=CjoNEzg@mail.gmail.com>	(Hui Zhu's message of "Wed, 20 Jul 2011 14:09:03 +0800")

>>>>> ">" == Hui Zhu <teawater@gmail.com> writes:

>> So I make a patch to handle the error from value_as_address.  If
>> value_as_address get error and this is a internalvar, call
>> value_contents to get the address of the val.

I don't think this is the best approach to solve this problem.

It seems to me that if the value is already an array, the data might
already exist in gdb, and then you don't have to even try to coerce it
to memory.  (However, for a pointer or integer value, using
value_as_address is still the best thing.)

I would suggest looking to see how valprint handles this situation, then
do the same thing here.

Tom


  reply	other threads:[~2011-07-21 20:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-20 10:37 Hui Zhu
2011-07-21 20:43 ` Tom Tromey [this message]
2011-08-14 15:10   ` Hui Zhu
2011-08-15 19:06     ` Tom Tromey
2011-08-16  4:58       ` Hui Zhu
2011-08-17 14:38         ` Tom Tromey
2011-08-18  2:54           ` Hui Zhu
2011-08-19 14:15             ` Tom Tromey
2011-09-06  8:50               ` Hui Zhu
2011-09-06 13:44                 ` Jan Kratochvil
2011-09-07  9:27                   ` Hui Zhu
2011-09-07 10:02                     ` Jan Kratochvil
2011-09-09  7:59                       ` Hui Zhu
2011-09-09 12:32                         ` Jan Kratochvil

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=m339hz1i9v.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=teawater@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