From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Jonas Maebe'" <jonas.maebe@elis.ugent.be>
Cc: "'gdb-patches ml'" <gdb-patches@sourceware.org>,
"'FPC Core Developer List'" <core@freepascal.org>,
<gpc@gnu.de>
Subject: RE: [Commit] gdb/pascal language 2 or 4 byte char support in strings
Date: Tue, 10 Feb 2009 15:00:00 -0000 [thread overview]
Message-ID: <002801c98b90$2b9c60f0$82d522d0$@u-strasbg.fr> (raw)
In-Reply-To: <85964EC7-B6FF-4869-A5C1-B99D618FF69C@elis.ugent.be>
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Jonas Maebe
> Envoyé : Tuesday, February 10, 2009 3:32 PM
> À : Pierre Muller
> Cc : 'gdb-patches ml'; 'FPC Core Developer List'; gpc@gnu.de
> Objet : Re: [Commit] gdb/pascal language 2 or 4 byte char support in
> strings
>
>
> On 10 Feb 2009, at 01:15, Pierre Muller wrote:
>
> > I committed the patch below to add
> > support for fixed width chars
> > greater than 1 for pascal language.
> >
> > This works nicely for Free Pascal,
> > I couldn't test it for GPC
> > because I didn't find out if those kind of char are supported...
>
> Hi Pierre,
>
> A while ago I wrote a similar patch. I didn't submit it yet because I
> didn't find time to write explanations why I did everything and on
> writing test cases for all changes.
>
> Anyway, it's in attachment (it's against the p-*.c files before your
> patch though). Some comments:
> * pascal-dwarf-char.patch:
> This one is independent from and complementary to your patch : it
> properly sets the TYPE_CODE DW_ATE_signed_char/DW_ATE_unsigned_char to
> TYPE_CODE_CHAR in case of Pascal (rather than only for Ada and Modula-
> 2)
OK, I will submit this patch to the dwarf maintainer.
> * pascalchar.patch:
> a) I removed all situations in the Pascal string handling where
> "TYPE_CODE (elttype) == TYPE_CODE_INT" is interpreted as a character.
> I don't know the original reason for having it there though, but maybe
> it was because of the lack of a)? At least the stabs debug info of both
> FPC and GPC results in a char (negative type number -2, as mentioned at
> http://sourceware.org/gdb/current/onlinedocs/stabs_5.html#SEC35)
I agree with you with one exception:
I think that TYPE_CODE_INT should be accepted if the /s format option was
specified.
> , which gdb turns into a TYPE_CODE_CHAR. I don't know about GPC and
> Dwarf, but FPC and Dwarf results in DW_ATE_unsigned_char. The main
> problem with considering TYPE_CODE_INT as characters is that arrays of
> bytes (and now presumably also of words and cardinals) are printed as
> character arrays, which is quite annoying.
> b) my changes to p-lang.c were basically a copy/paste if all changes in
> the C version of print_string to support characters of different widths
I will try to modify the pascal code so that
only TYPE_CODE_CHAR and /s generated string output.
Pierre Muller
Pascal language support maintainer for GDB
prev parent reply other threads:[~2009-02-10 15:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-10 0:15 Pierre Muller
2009-02-10 14:33 ` Jonas Maebe
2009-02-10 15:00 ` Pierre Muller [this message]
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='002801c98b90$2b9c60f0$82d522d0$@u-strasbg.fr' \
--to=muller@ics.u-strasbg.fr \
--cc=core@freepascal.org \
--cc=gdb-patches@sourceware.org \
--cc=gpc@gnu.de \
--cc=jonas.maebe@elis.ugent.be \
/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