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: [RFC] problem with read_memory_string (reads 8 bytes at a time)


El miÃ, 08-04-2009 a las 11:26 -0700, Joel Brobecker escribiÃ:
>     b. Read 8 bytes from 0x1002e0 + 8 = 0x1002e8:
>          i. The section ends at 0x001102ec, so bfd returns only 4 bytes read.
>         ii. We find out that only 4 bytes were read, so we still need to
>             read another 4 bytes for the 8byte read to be complete
>        iii. the next 4byte read doesn't find a section from which to
>             read the 4bytes, and so returns 0 signifying an error.
> 
> I don't really know how to fix this issue except by reading the string
> one byte at a time :-(. Any suggestion?

I suggest using target_read_string. If I understand its code correctly,
it handles the corner case you hit.

I thought that valprint.c:read_string also handled that, but now that I
read the code again, it looks like it would fail too. :-(
-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


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