This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/RFA] Cleaner handling of character entities ?


This is an old patch that, for some reason, I forgot to commit:

> So, Joel, I think that a patch along the lines of that changelog entry
> above is probably the way to go,

So I took the opportunity to add some comments, and do a minor
reformatting...

2007-12-24  Joel Brobecker  <brobecker@adacore.com>

        * dwarf2read.c (read_base_type): Set code to TYPE_CODE_CHAR
        for char and unsigned char types of Ada compilation units.
        * ada-lang.c (ada_is_character_type): Always return true if
        the type code is TYPE_CODE_CHAR.

Tested on x86-linux with DWARF and stabs. Checked in.

You also said:

> you may want to audit uses of TYPE_CODE_INT and TYPE_CODE_CHAR in
> backends or else calling Ada procedures which take chars may not work
> well.
> [Sounds like a new testcase, doesn't it?]

That's a good idea. I will write one ASAP.

Incidentally, that reminded me of a recent change that Daniel made
regarding handling of (unsigned?) characters. Perhaps one day we
won't have to set TYPE_CODE_CHAR only for Ada and M2...

-- 
Joel

Attachment: char-ada.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]