This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]