This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] printcmd.c (ui_printf): make internalvar string can be printf and eval when inferior cannot alloc memory
- From: Tom Tromey <tromey at redhat dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Mon, 15 Aug 2011 13:06:14 -0600
- Subject: Re: [PATCH] printcmd.c (ui_printf): make internalvar string can be printf and eval when inferior cannot alloc memory
- References: <CANFwon0RttecHT1BrVx886NC6yCsojHm-MWfr7ttS8=CjoNEzg@mail.gmail.com> <m339hz1i9v.fsf@fleche.redhat.com> <CANFwon0wqsOirAz078-y+ti-WFNHGJ45F_-HfS89ViYM02UDFA@mail.gmail.com>
>>>>> ">" == Hui Zhu <teawater@gmail.com> writes:
>> Thanks for your help.
>> I make a new patch according to your mail.
>> 2011-08-14 Hui Zhu <teawater@gmail.com>
>> * printcmd.c (ui_printf): Add a handler for internalvar and
>> TYPE_CODE_ARRAY.
I still don't think this is correct.
This special-cases lval_internalvar, but IIUC this will still fail for
something like:
printf "hi %s\n", "bob"
In this code I don't think you need to call value_as_address for an
array; likewise reading from memory.
The patch also doesn't address the wide-string case, which it should.
Tom