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] Make target_read_string faster over high-latency links.


On Fri, Jul 22, 2011 at 12:52 PM, Paul Pluzhnikov
<ppluzhnikov@google.com> wrote:
> On Fri, Jul 22, 2011 at 9:43 AM, Joel Brobecker <brobecker@adacore.com> wrote:
>
>>> Paul> 1. is it ok to read strings 128 bytes at a time, or are there
>>> Paul> scenarios (JTAG?) where the latency is low but throughput is also
>>> Paul> low (and so reading "unnecessary" data is expensive) ?
>>>
>>> I don't know, but I assume so.
>>
>> I think that the risk is to attempt a read that gets past the
>> readable memory region.
>
> That shouldn't be a risk (I think): target_read will (is supposed to)
> return partial results.

The problem's the other way around; you can't always rely on the
target to know what areas of memory not to read.  If you read a big
chunk of a string off of the stack on uClinux (e.g. auxv or
environment), you'll wander up into unmapped memory - and who knows
what will happen then!  (More recent versions of uClinux manage to
catch this in ptrace, thankfully).

-- 
Thanks,
Daniel


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