Re: [PATCH] printcmd.c (ui_printf): make internalvar string can be printf and eval when inferior cannot alloc memory

Tom Tromey
2011-08-15T19:06:38Z

>>>>> ">" == 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