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] zero-terminate result of target_read_alloc


On Tuesday 18 July 2006 15:25, Mark Kettenis wrote:
> >  This patch makes result of target_read_alloc zero-terminated.
> >  The point is that often the object is not allowed to contain embedded
> >  zeros,
> >  and working with zero-terminated strings is much easier.
> >
> >  OK?
>
> This is wrong.  Either the terminating nul is part of the object you're
> reading or it is not.  GDB shouldn't at its own.

I'm sorry, I don't understand the problem. Some objects are binary in nature, 
can contain zeroes, and should be manipulated using length.

Some objects, for example XML memory map, are text ones. Embedded zero byte in 
such object is bug in remote side, and nothing else. And while it would not 
be overly complicate to pass length of such objects in my case, I don't see 
why we should impose this complication on everybody.

- Volodya


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