Re: GDB/MI reporting non-ASCII file names

Eli Zaretskii <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
> Date: Wed, 30 Sep 2015 15:49:42 +0100
> From: Pedro Alves <[email protected]>
> CC: [email protected]
> 
> >>  https://sourceware.org/ml/gdb/2010-08/msg00129.html
> > 
> > Thanks.  So it's hard-wired in MI, and the grammar requires that.  Too
> > bad.
> 
> We can always extend it.  Maybe we just need to document that ascii is
> the default, and that frontends should
> issue -gdb-set print sevenbit-strings off if they want non-ascii?
> Seems like Eclipse ended up doing that.

But "-gdb-set print sevenbit-strings off" doesn't seem to work: I get
spurious "\200" strings which disrupt the whole sequence.  I thought
that was because 7-bit strings were a requirement in MI, for some
reason.

But now I think the culprit is this part of printchar:

  if (c < 0x20 ||
      (c >= 0x7F && c < 0xA0) ||       <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
      (sevenbit_strings && c >= 0x80))

This produces octal escapes for characters in 0x7F..0x8F regardless of
the value of sevenbit_strings, which does the wrong thing with
non-leading bytes of UTF-8 sequences.

If you compile a program from a source file whose name includes
non-ASCII characters, then debug that program with -i=mi, do you see
the file names correctly, after turning 7 bits off?

Btw, I see valid non-ASCII file names when I use CLI and the
annotations instead.  So does this mean we don't use printchar for
emitting file names in that case?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.