Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb@sourceware.org
Subject: Re: Using XML in GDB?
Date: Sat, 28 Jan 2006 05:24:00 -0000	[thread overview]
Message-ID: <20060127185739.GA16811@nevyn.them.org> (raw)
In-Reply-To: <u64o5edeh.fsf@gnu.org>

On Fri, Jan 27, 2006 at 08:25:42PM +0200, Eli Zaretskii wrote:
> Can we at least have a pipe-dream list of things we think GDB would
> ideally like to know about targets, and how structured each one of
> them is?

Well, I don't think I can.  I haven't a clue; every time I think I've
got a handle on the set, people come up with creative new ones.  For
instance I hadn't considered that we might want memory-mapped I/O
devices to be explicitly explained to GDB.

> > If we're going to do that, it would be a real shame not to consider
> > localization; most ARM system programmers can probably manage the
> > English names of the registers, but if we want to offer help text,
> > being able to provide it in Japanese is a big win.  So that means
> > character encodings, and in turn that means we need to be somewhat
> > careful with the contents of descriptions.
> 
> That part is something I never understood in your reasoning: XML does
> not do anything special to allow UTF-8, nor help you deal with the
> resulting non-ASCII text on the GDB side.  If the underlying libc
> supports UTF-8, you have that now; if it doesn't, you won't be better
> off even if the target speaks XML.

The mere existance of character encodings isn't the issue; the
issue is encoding free-form text, possibly containing strange
"characters", within a structured element.  In particular, within a
structured element that a client may not recognize and support.

We've got field separators - colon and semicolon in my working copy,
and the status of newlines is fuzzy.  If they may validly occur within
free-form text we need to have an alternate way to escape them. In
ASCII how to do this is quite clear-cut.  In UTF-8 it's a little less
clear-cut although still pretty simple - but it does require knowing
something about the contents of UTF-8 when defining the encoding, if
you want the encoded result to still be valid UTF-8.  And I do, because
otherwise it will become awkward to edit the descriptions in a text
editor.

If you want to optionally support other encodings rather than UTF-8 it
becomes even trickier.  You have to know, eventually, how fields are
encoded.  For us I don't think that's necessary; we can define all
encoded text as UTF-8.  But there's a similar problem if someone wants
to add a descriptive element transfered as a binary blob for some
reason - I don't have an example for this, but I can certainly accept
that someone will come up with one someday.  Maybe bytecode!

XML's already considered this and solved it.  There are defined ways
to express a document's encoding, and to escape characters that
would otherwise serve as syntax elements.  You can store arbitrary text
or byte sequences in an element (e.g OpenDocument).

> > The biggest win of XML, for me, is that there are standard answers to
> > all of these problems and standard tools for editing and
> > checking XML files.
> 
> Is XML the only widely used standard that supports what we want?

I'm sure it isn't, but I think it's the most standardized.  You could
do something similar in an RFC-822 style format, for instance (Header:
value as in email, in case any of the list readers aren't familiar with
RFC-822; it also does handle multiline values, but I'm not sure how it
is on encoded text).

I'm not a die-hard XML advocate.  In fact I've never used it before
for a new project, although I'm fairly familiar with it.  If someone
has an alternate representation that they believe is superior, I'm
listening.  What I want to do, however, is draw the line past which
we should use standardized representations instead of ad-hoc.

-- 
Daniel Jacobowitz
CodeSourcery


  parent reply	other threads:[~2006-01-27 18:57 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-26  7:01 Daniel Jacobowitz
2006-01-26 12:45 ` Andrew STUBBS
2006-01-26 13:41   ` Daniel Jacobowitz
2006-01-26 16:24     ` Andrew STUBBS
2006-01-26 16:41       ` Daniel Jacobowitz
2006-01-26 17:34         ` Paul Koning
2006-01-26 17:44         ` Andrew STUBBS
2006-01-26 18:55           ` Daniel Jacobowitz
2006-01-26 21:05         ` Mark Kettenis
2006-01-26 21:26           ` Daniel Jacobowitz
2006-01-26 21:57             ` Mark Kettenis
2006-01-26 22:02               ` Daniel Jacobowitz
2006-01-26 22:32                 ` Bob Rossi
2006-01-26 20:39 ` Mark Kettenis
2006-01-26 20:43   ` Bob Rossi
2006-01-26 21:41     ` Mark Kettenis
2006-01-26 20:52   ` Daniel Jacobowitz
2006-01-26 21:12     ` Bob Rossi
2006-01-27  0:47 ` Bob Rossi
2006-01-27 18:04 ` Eli Zaretskii
2006-01-27 18:41   ` Daniel Jacobowitz
2006-01-27 18:57     ` Eli Zaretskii
2006-01-27 19:06       ` Paul Koning
2006-01-28  6:33         ` Daniel Jacobowitz
2006-01-28 13:54           ` Jim Blandy
2006-01-29  4:09             ` Eli Zaretskii
2006-01-29  4:27             ` Paul Koning
2006-01-28  5:24       ` Daniel Jacobowitz [this message]
2006-01-29  4:33 Paul Schlie
2006-01-29  6:18 ` Jim Blandy
2006-01-29 23:21   ` Daniel Jacobowitz
2006-01-29 23:24   ` Paul Schlie

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=20060127185739.GA16811@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb@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