This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB/MI reporting non-ASCII file names
- From: Pedro Alves <palves at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb at sourceware dot org
- Date: Fri, 09 Oct 2015 17:48:22 +0100
- Subject: Re: GDB/MI reporting non-ASCII file names
- Authentication-results: sourceware.org; auth=none
- References: <83a8s5d1nw dot fsf at gnu dot org> <560BCCF9 dot 2040202 at redhat dot com> <83bnckasck dot fsf at gnu dot org> <560BF686 dot 1030400 at redhat dot com> <83a8s3c3c3 dot fsf at gnu dot org> <5617A0FD dot 3020208 at redhat dot com> <83si5ktbgf dot fsf at gnu dot org>
On 10/09/2015 02:31 PM, Eli Zaretskii wrote:
>>
>> But with a file named "ÎÎÏÏÏÎ.c" + "set print sevenbit-strings off":
>>
>> *stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x00000000004004fb",func="main",args=[{name="argc",value="1"},{name="argv",value="0x7fffffffd808"}],file="ÎÎï\216ï\203ï\203Î.c",fullname="/home/pedro/gdb/tests/ÎÎï\216ï\203ï\203Î.c",line="5"},thread-id="1",stopped-threads="all",core="3"
>> =breakpoint-deleted,id="1"
>> (gdb)
>
> I think the 0x7F..0xA0 range is a left-over from the Latin-N era, and
> is a bad idea with the current UTF-8 default.
>
> Would something like the following be acceptable (if accompanied with
> the suitable changes to NEWS and the manual)?
>
I wonder whether we should we use isprint instead of removing
the condition entirely?
If this could be covered by a test it'd be great.
Thanks,
Pedro Alves
> diff --git a/gdb/utils.c b/gdb/utils.c
> index afeff12..56eb9d5 100644
> --- a/gdb/utils.c
> +++ b/gdb/utils.c
> @@ -1509,12 +1509,11 @@ printchar (int c, void (*do_fputs) (const char *, struct ui_file *),
> void (*do_fprintf) (struct ui_file *, const char *, ...)
> ATTRIBUTE_FPTR_PRINTF_2, struct ui_file *stream, int quoter)
> {
> - c &= 0xFF; /* Avoid sign bit follies */
> + c &= 0xFF; /* Avoid sign bit follies */
>
> - if (c < 0x20 || /* Low control chars */
> - (c >= 0x7F && c < 0xA0) || /* DEL, High controls */
> - (sevenbit_strings && c >= 0x80))
> - { /* high order bit set */
> + if (c < 0x20 || /* Low control chars */
> + (sevenbit_strings && c >= 0x80)) /* High order bit set */
> + {
> switch (c)
> {
> case '\n':
>