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: Enhanced language support for Modula-2


On Sat, Feb 25, 2006 at 09:37:05PM -0800, Jim Blandy wrote:
> On 25 Feb 2006 12:31:05 +0000, Gaius Mulley <gaius@glam.ac.uk> wrote:
> > I guess the Modula-2 mode can use a different method. Would it be
> > allowable for me to extend the
> >
> >     #define TYPE_FLAG_xxx
> >
> > sequence (currently bits 0..15 are used).  So for example:
> >
> >     #define TYPE_FLAG_LANG_CHAR (1 << 16)
> >
> > and set this flag if we see DW_ATE_signed_char or
> > DW_ATE_unsigned_char.  Later in the Modula-2 language section this bit
> > could be tested and the appropriate action taken. Obviously I'd need
> > to set this bit in stabsread.c as well. This would also allow Pascal
> > to utilise CHAR rather than see a tiny integer.
> 
> If Modula-2 has a genuinely distinct character type, then I think
> TYPE_CODE_CHAR is the right type for you to use.  It's just that it
> isn't for C.  So the code in dwarf2read.c needs to choose the type
> code for a given DWARF base type based on the language of the
> compilation unit that contains the die.  I think you'll need to test
> cu->language, and set the type code appropriately in each case.

We already use a language hook for read_base_type when the type has no
name.  Maybe we should regardless of whether the type has a name?
I've always been a bit confused by the "fundamental type" code.

-- 
Daniel Jacobowitz
CodeSourcery


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