From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [commit/Ada] General ada-valprint improvements
Date: Thu, 09 Jan 2014 03:06:00 -0000 [thread overview]
Message-ID: <20140109030557.GS3802@adacore.com> (raw)
In-Reply-To: <87txdecwgc.fsf@fleche.redhat.com>
> I have an ancient branch where I took a stab at removing val_print.
> It's a reasonably large patch and still doesn't even compile:
>
> 30 files changed, 262 insertions(+), 486 deletions(-)
>
> It's quite a big job and due to the way that most languages wind up
> deferring to the C printer, I didn't see a nice way to do it
> incrementally.
I was afraid of that. For Ada, I have some hopes that I could
re-implement val_print on top of value_print if I split ada_value_print.
If that works out, and if we find we can transition all languages
that way, perhaps that'll simplify the transition.
While talking crazy-large cleanup projects, I have been having this idea
in the back of my mind that I'd like the value printing to be done
by a language-independent engine, with the language only providing
decorations and hints. This is still very vague, and will require
a lot of thinking before I can even start, but the triggering thought
is varobj: varobj is already a generic object printing engine where,
if you simplify a bit, the language only provides child access.
Ideally, couldn't we extend that API to do exactly what each
LANG-print.c does? For instance, the only difference between
C structs and Ada records could be sumarized as:
- C uses curly braces, while Ada uses parentheses
- Ada likes to see the names of the fields
So, if we could extract out the varobj engine, and then make varobj
one formatter, and CLI-valprint another formatter, it seems like
most of the valprint units such as ada-valprint could go away.
--
Joel
next prev parent reply other threads:[~2014-01-09 3:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-07 4:22 Joel Brobecker
2014-01-07 4:22 ` [commit/Ada 01/11] ada-valprint.c: Reorder functions to reduce advance declarations Joel Brobecker
2014-01-07 4:22 ` [commit/Ada 02/11] ada_val_print_1: Add language parameter Joel Brobecker
2014-01-07 4:22 ` [commit/Ada 03/11] ada_val_print_1: Go through val_print instead of recursive call to self Joel Brobecker
2014-01-07 4:22 ` [commit/Ada 08/11] move ada_val_print_array down within other ada_val_print* functions Joel Brobecker
2014-01-07 4:22 ` [commit/Ada 07/11] rewrite ada_val_print_ref to reduce if/else block nesting depth Joel Brobecker
2014-01-07 4:22 ` [commit/Ada 05/11] Split ada_val_print_1 into smaller functions Joel Brobecker
2014-01-07 4:22 ` [commit/Ada 06/11] ada-valprint.c: Inline print_record inside ada_val_print_struct_union Joel Brobecker
2014-01-07 4:22 ` [commit/Ada 09/11] Extract string-printing out of ada_val_print_array Joel Brobecker
2014-01-07 4:22 ` [commit/Ada 04/11] Remove call to gdb_flush at end of ada_val_print_1 Joel Brobecker
2014-01-07 4:23 ` [commit/Ada 10/11] ada_print_floating: Remove use of statically sized buffer Joel Brobecker
2014-01-07 4:23 ` [commit/Ada 11/11] Ada: Fix missing call to pretty-printer for fields of records Joel Brobecker
2014-01-07 17:29 ` [commit/Ada] General ada-valprint improvements Tom Tromey
2014-01-08 11:35 ` Joel Brobecker
2014-01-08 15:41 ` Tom Tromey
2014-01-09 3:06 ` Joel Brobecker [this message]
2014-01-09 16:14 ` Tom Tromey
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=20140109030557.GS3802@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).