From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] problem with read_memory_string (reads 8 bytes at a time)
Date: Wed, 08 Apr 2009 22:18:00 -0000 [thread overview]
Message-ID: <1239229104.8871.164.camel@localhost.localdomain> (raw)
In-Reply-To: <20090408212609.GG7535@adacore.com>
El mié, 08-04-2009 a las 14:26 -0700, Joel Brobecker escribió:
> > I suggest using target_read_string. If I understand its code correctly,
> > it handles the corner case you hit.
>
> Thanks for the tip!
>
> It looks like it does, indeed - although a little ineffectively:
> Once it failed to read a 4byte block, it tries reading 1 byte.
> If that works, then it tries 3bytes, which won't work again,
> and thus try 1 byte one more time. If that works, then it'll read
> 2 bytes, etc. I don't think this is a big deal, though.
Well, it's not efficient for your case, but it's efficient for the case
where three bytes out of a 4 byte "bite" were good. The next try will
read those 3 bytes and off you go...
> That being said, I am wondering why we have more than 1 routine
> to read strings... Is there something we should do?
Yes, I wondered the same when I was implementing LA_GET_STRING. I
believe we can consolidate those routines. I just added a new item to
the ProjectIdeas wiki page, under the "Internals" section.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
prev parent reply other threads:[~2009-04-08 22:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-08 18:27 Joel Brobecker
2009-04-08 19:01 ` Thiago Jung Bauermann
2009-04-08 21:26 ` Joel Brobecker
2009-04-08 22:18 ` Thiago Jung Bauermann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1239229104.8871.164.camel@localhost.localdomain \
--to=bauerman@br.ibm.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox