This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Refine read_string
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 23 Nov 2014 06:56:06 +0400
- Subject: Re: [PATCH] Refine read_string
- Authentication-results: sourceware.org; auth=none
- References: <1408586943-24077-1-git-send-email-yao at codesourcery dot com>
Hi Yao,
> In read_string, we have this line
>
> chunksize = (len == -1 ? min (8, fetchlimit) : fetchlimit);
>
> but chunksize is only used in the block that lne == -1, so IWBN to
> move chunksize to the block in which it is used, and simplify the
> condition setting chunksize. This patch also moves 'found_nul' to
> inner block. This patch also splits a paragraph of comment into two,
> and move them to different condition blocks (len > 0 and len == -1)
> respectively.
>
> Rebuild GDB on x86-linux. Is it OK?
>
> gdb:
>
> 2014-08-21 Yao Qi <yao@codesourcery.com>
>
> * valprint.c (read_string): Move local variables 'found_nul',
> 'chunksize' and 'limit' to inner scope. Update comments.
Sorry for the delay in reviewing this.
I like this small improvement. Would you mind applying it?
--
Joel