Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Add new language: "unsupported"
@ 2003-05-07  1:42 Joel Brobecker
  2003-05-07 11:01 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Joel Brobecker @ 2003-05-07  1:42 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1881 bytes --]

As promised to Elena, this is a followup on: 

    http://sources.redhat.com/ml/gdb-patches/2003-04/msg00209.html

Basically, I added a new "unsupported" language which support is
minimalistic (identical to what we do with the "asm" language).
I didn't fancy "partial":

        (gdb) show lang
        Current language:  auto; currently partial

I felt like it could confuse the user to think that "partial" is the
name of a real language :-). But I'm not such a big fan of "unsupported"
either, so all suggestions are welcome.

This new language will first be used by the dwarf2 reader, for objects
which language is currently not supported. What it does, at the moment,
is use the "unknown" language, which makes a lot of the GDB commands
fall flat. Like so, when debugging an Ada program:

    (gdb) list foo.adb:1
    internal error - unimplemented function unk_lang_create_fundamental_type called.
    (gdb) quit

With the attached patch, and also the little patch to dwarf2read.c
(attached too, will be submitted later, after this one is agreed on),
GDB behaves in a much more friendly way:

    (gdb) list foo.adb:1
    1       procedure Foo is
    2          A : Integer := 1;
    3       begin
    4          A := A + 1;
    5       end Foo;
    (gdb) b foo.adb:4
    Breakpoint 1 at 0x8049769: file foo.adb, line 4.
    (gdb) run
    Starting program: /lek.a/brobecke/ada_example/foo 
    
    Breakpoint 1, _ada_foo () at foo.adb:4
    4          A := A + 1;
    Current language:  auto; currently unsupported
    (gdb) p a
    $1 = 1

2003-05-06  J. Brobecker  <brobecker@gnat.com>

        * defs.h (language): Add language_unsupported enum value.
        * c-lang.c (unsupported_language_defn): New language definition.
        (_initialize_c_language): Add the new unsupported language to
        the list of languages known to GDB.

Ok to apply?

Thanks,
-- 
Joel

[-- Attachment #2: lang.diff --]
[-- Type: text/plain, Size: 2571 bytes --]

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.118
diff -c -3 -p -r1.118 defs.h
*** defs.h	10 Apr 2003 02:18:40 -0000	1.118
--- defs.h	7 May 2003 01:23:11 -0000
*************** enum language
*** 211,217 ****
      language_m2,		/* Modula-2 */
      language_asm,		/* Assembly language */
      language_scm,    		/* Scheme / Guile */
!     language_pascal		/* Pascal */
    };
  
  enum precision_type
--- 211,218 ----
      language_m2,		/* Modula-2 */
      language_asm,		/* Assembly language */
      language_scm,    		/* Scheme / Guile */
!     language_pascal,		/* Pascal */
!     language_unsupported	/* All other (unsupported) languages */
    };
  
  enum precision_type
Index: c-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.c,v
retrieving revision 1.18
diff -c -3 -p -r1.18 c-lang.c
*** c-lang.c	2 Apr 2003 03:02:46 -0000	1.18
--- c-lang.c	7 May 2003 01:23:04 -0000
*************** const struct language_defn asm_language_
*** 651,660 ****
--- 651,692 ----
    LANG_MAGIC
  };
  
+ const struct language_defn unsupported_language_defn =
+ {
+   "unsupported",			/* Language name */
+   language_unsupported,
+   c_builtin_types,
+   range_check_off,
+   type_check_off,
+   case_sensitive_on,
+   c_preprocess_and_parse,
+   c_error,
+   evaluate_subexp_standard,
+   c_printchar,			/* Print a character constant */
+   c_printstr,			/* Function to print string constant */
+   c_emit_char,			/* Print a single char */
+   c_create_fundamental_type,	/* Create fundamental type in this language */
+   c_print_type,			/* Print a type using appropriate syntax */
+   c_val_print,			/* Print a value using appropriate syntax */
+   c_value_print,		/* Print a top-level value */
+   NULL,				/* Language specific skip_trampoline */
+   NULL,				/* Language specific symbol demangler */
+   {"", "", "", ""},		/* Binary format info */
+   {"0%lo", "0", "o", ""},	/* Octal format info */
+   {"%ld", "", "d", ""},		/* Decimal format info */
+   {"0x%lx", "0x", "x", ""},	/* Hex format info */
+   c_op_print_tab,		/* expression operators for printing */
+   1,				/* c-style arrays */
+   0,				/* String lower bound */
+   &builtin_type_char,		/* Type of string elements */
+   LANG_MAGIC
+ };
+ 
  void
  _initialize_c_language (void)
  {
    add_language (&c_language_defn);
    add_language (&cplus_language_defn);
    add_language (&asm_language_defn);
+   add_language (&unsupported_language_defn);
  }

[-- Attachment #3: dw2.diff --]
[-- Type: text/plain, Size: 748 bytes --]

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.90
diff -c -3 -p -r1.90 dwarf2read.c
*** dwarf2read.c	15 Apr 2003 23:07:11 -0000	1.90
--- dwarf2read.c	7 May 2003 01:23:14 -0000
*************** set_cu_language (unsigned int lang)
*** 4548,4554 ****
      case DW_LANG_Pascal83:
      case DW_LANG_Modula2:
      default:
!       cu_language = language_unknown;
        break;
      }
    cu_language_defn = language_def (cu_language);
--- 4548,4554 ----
      case DW_LANG_Pascal83:
      case DW_LANG_Modula2:
      default:
!       cu_language = language_unsupported;
        break;
      }
    cu_language_defn = language_def (cu_language);


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFA] Add new language: "unsupported"
  2003-05-07  1:42 [RFA] Add new language: "unsupported" Joel Brobecker
@ 2003-05-07 11:01 ` Eli Zaretskii
  2003-05-07 14:21 ` Elena Zannoni
  2003-05-07 15:01 ` Daniel Berlin
  2 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2003-05-07 11:01 UTC (permalink / raw)
  To: brobecker; +Cc: gdb-patches

> Date: Tue, 6 May 2003 18:42:31 -0700
> From: Joel Brobecker <brobecker@gnat.com>
> 
> Basically, I added a new "unsupported" language which support is
> minimalistic (identical to what we do with the "asm" language).

Thanks.

I think we need to say something about this in the manual.  A user
who sees "currently unsupported" should be able to understand what
that means, in practice.

> But I'm not such a big fan of "unsupported"
> either, so all suggestions are welcome.

How about "unknown" or "generic"?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFA] Add new language: "unsupported"
  2003-05-07  1:42 [RFA] Add new language: "unsupported" Joel Brobecker
  2003-05-07 11:01 ` Eli Zaretskii
@ 2003-05-07 14:21 ` Elena Zannoni
  2003-05-07 14:24   ` Daniel Jacobowitz
  2003-05-08 17:37   ` Joel Brobecker
  2003-05-07 15:01 ` Daniel Berlin
  2 siblings, 2 replies; 9+ messages in thread
From: Elena Zannoni @ 2003-05-07 14:21 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

Joel Brobecker writes:
 > As promised to Elena, this is a followup on: 
 > 
 >     http://sources.redhat.com/ml/gdb-patches/2003-04/msg00209.html
 > 
 > Basically, I added a new "unsupported" language which support is
 > minimalistic (identical to what we do with the "asm" language).
 > I didn't fancy "partial":
 > 
 >         (gdb) show lang
 >         Current language:  auto; currently partial
 > 
 > I felt like it could confuse the user to think that "partial" is the
 > name of a real language :-). But I'm not such a big fan of "unsupported"
 > either, so all suggestions are welcome.
 > 

minimal? I would think of 'basic' but that's obviously not good :-)
'unsupported' to me would imply that you still get the errors.

Looking up on a thesaurus:
primitive, primary, nominal, trivial, sparse


 > This new language will first be used by the dwarf2 reader, for objects
 > which language is currently not supported. What it does, at the moment,
 > is use the "unknown" language, which makes a lot of the GDB commands
 > fall flat. Like so, when debugging an Ada program:
 > 
 >     (gdb) list foo.adb:1
 >     internal error - unimplemented function unk_lang_create_fundamental_type called.
 >     (gdb) quit
 > 
 > With the attached patch, and also the little patch to dwarf2read.c
 > (attached too, will be submitted later, after this one is agreed on),
 > GDB behaves in a much more friendly way:
 > 
 >     (gdb) list foo.adb:1
 >     1       procedure Foo is
 >     2          A : Integer := 1;
 >     3       begin
 >     4          A := A + 1;
 >     5       end Foo;
 >     (gdb) b foo.adb:4
 >     Breakpoint 1 at 0x8049769: file foo.adb, line 4.
 >     (gdb) run
 >     Starting program: /lek.a/brobecke/ada_example/foo 
 >     
 >     Breakpoint 1, _ada_foo () at foo.adb:4
 >     4          A := A + 1;
 >     Current language:  auto; currently unsupported
 >     (gdb) p a
 >     $1 = 1
 > 
 > 2003-05-06  J. Brobecker  <brobecker@gnat.com>
 > 
 >         * defs.h (language): Add language_unsupported enum value.
 >         * c-lang.c (unsupported_language_defn): New language definition.
 >         (_initialize_c_language): Add the new unsupported language to
 >         the list of languages known to GDB.
 > 
 > Ok to apply?

Yes, modulus the name choice. Could you add a few more comments on
what this new language is suitable for, etc?  I wonder if we could add
a mini test case, that maybe set the language to this new one, and
tries something simple, if possible. We cannot add a test that uses
Ada code, because that will eventually become obsolete when we get
full ada support. But maybe we can still use a C program, and see what
happens with 'set laguage <whatever>'.

thanks for doing this.
elena



 > 
 > Thanks,
 > -- 
 > Joel
 > Index: defs.h
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/defs.h,v
 > retrieving revision 1.118
 > diff -c -3 -p -r1.118 defs.h
 > *** defs.h	10 Apr 2003 02:18:40 -0000	1.118
 > --- defs.h	7 May 2003 01:23:11 -0000
 > *************** enum language
 > *** 211,217 ****
 >       language_m2,		/* Modula-2 */
 >       language_asm,		/* Assembly language */
 >       language_scm,    		/* Scheme / Guile */
 > !     language_pascal		/* Pascal */
 >     };
 >   
 >   enum precision_type
 > --- 211,218 ----
 >       language_m2,		/* Modula-2 */
 >       language_asm,		/* Assembly language */
 >       language_scm,    		/* Scheme / Guile */
 > !     language_pascal,		/* Pascal */
 > !     language_unsupported	/* All other (unsupported) languages */
 >     };
 >   
 >   enum precision_type
 > Index: c-lang.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/c-lang.c,v
 > retrieving revision 1.18
 > diff -c -3 -p -r1.18 c-lang.c
 > *** c-lang.c	2 Apr 2003 03:02:46 -0000	1.18
 > --- c-lang.c	7 May 2003 01:23:04 -0000
 > *************** const struct language_defn asm_language_
 > *** 651,660 ****
 > --- 651,692 ----
 >     LANG_MAGIC
 >   };
 >   
 > + const struct language_defn unsupported_language_defn =
 > + {
 > +   "unsupported",			/* Language name */
 > +   language_unsupported,
 > +   c_builtin_types,
 > +   range_check_off,
 > +   type_check_off,
 > +   case_sensitive_on,
 > +   c_preprocess_and_parse,
 > +   c_error,
 > +   evaluate_subexp_standard,
 > +   c_printchar,			/* Print a character constant */
 > +   c_printstr,			/* Function to print string constant */
 > +   c_emit_char,			/* Print a single char */
 > +   c_create_fundamental_type,	/* Create fundamental type in this language */
 > +   c_print_type,			/* Print a type using appropriate syntax */
 > +   c_val_print,			/* Print a value using appropriate syntax */
 > +   c_value_print,		/* Print a top-level value */
 > +   NULL,				/* Language specific skip_trampoline */
 > +   NULL,				/* Language specific symbol demangler */
 > +   {"", "", "", ""},		/* Binary format info */
 > +   {"0%lo", "0", "o", ""},	/* Octal format info */
 > +   {"%ld", "", "d", ""},		/* Decimal format info */
 > +   {"0x%lx", "0x", "x", ""},	/* Hex format info */
 > +   c_op_print_tab,		/* expression operators for printing */
 > +   1,				/* c-style arrays */
 > +   0,				/* String lower bound */
 > +   &builtin_type_char,		/* Type of string elements */
 > +   LANG_MAGIC
 > + };
 > + 
 >   void
 >   _initialize_c_language (void)
 >   {
 >     add_language (&c_language_defn);
 >     add_language (&cplus_language_defn);
 >     add_language (&asm_language_defn);
 > +   add_language (&unsupported_language_defn);
 >   }
 > Index: dwarf2read.c
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/dwarf2read.c,v
 > retrieving revision 1.90
 > diff -c -3 -p -r1.90 dwarf2read.c
 > *** dwarf2read.c	15 Apr 2003 23:07:11 -0000	1.90
 > --- dwarf2read.c	7 May 2003 01:23:14 -0000
 > *************** set_cu_language (unsigned int lang)
 > *** 4548,4554 ****
 >       case DW_LANG_Pascal83:
 >       case DW_LANG_Modula2:
 >       default:
 > !       cu_language = language_unknown;
 >         break;
 >       }
 >     cu_language_defn = language_def (cu_language);
 > --- 4548,4554 ----
 >       case DW_LANG_Pascal83:
 >       case DW_LANG_Modula2:
 >       default:
 > !       cu_language = language_unsupported;
 >         break;
 >       }
 >     cu_language_defn = language_def (cu_language);
 > 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFA] Add new language: "unsupported"
  2003-05-07 14:21 ` Elena Zannoni
@ 2003-05-07 14:24   ` Daniel Jacobowitz
  2003-05-08 17:37   ` Joel Brobecker
  1 sibling, 0 replies; 9+ messages in thread
From: Daniel Jacobowitz @ 2003-05-07 14:24 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: Joel Brobecker, gdb-patches

On Wed, May 07, 2003 at 10:26:42AM -0400, Elena Zannoni wrote:
> Joel Brobecker writes:
>  > As promised to Elena, this is a followup on: 
>  > 
>  >     http://sources.redhat.com/ml/gdb-patches/2003-04/msg00209.html
>  > 
>  > Basically, I added a new "unsupported" language which support is
>  > minimalistic (identical to what we do with the "asm" language).
>  > I didn't fancy "partial":
>  > 
>  >         (gdb) show lang
>  >         Current language:  auto; currently partial
>  > 
>  > I felt like it could confuse the user to think that "partial" is the
>  > name of a real language :-). But I'm not such a big fan of "unsupported"
>  > either, so all suggestions are welcome.
>  > 
> 
> minimal? I would think of 'basic' but that's obviously not good :-)
> 'unsupported' to me would imply that you still get the errors.

Minimal sounds like a good idea to me.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFA] Add new language: "unsupported"
  2003-05-07  1:42 [RFA] Add new language: "unsupported" Joel Brobecker
  2003-05-07 11:01 ` Eli Zaretskii
  2003-05-07 14:21 ` Elena Zannoni
@ 2003-05-07 15:01 ` Daniel Berlin
  2003-05-07 17:27   ` Elena Zannoni
  2 siblings, 1 reply; 9+ messages in thread
From: Daniel Berlin @ 2003-05-07 15:01 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches


On Tuesday, May 6, 2003, at 09:42  PM, Joel Brobecker wrote:

> As promised to Elena, this is a followup on:
>
>     http://sources.redhat.com/ml/gdb-patches/2003-04/msg00209.html
>
> Basically, I added a new "unsupported" language which support is
> minimalistic (identical to what we do with the "asm" language).
> I didn't fancy "partial":
>
>         (gdb) show lang
>         Current language:  auto; currently partial
>
> I felt like it could confuse the user to think that "partial" is the
> name of a real language :-). But I'm not such a big fan of 
> "unsupported"
> either, so all suggestions are welcome.
>
> This new language will first be used by the dwarf2 reader, for objects
> which language is currently not supported. What it does, at the moment,
> is use the "unknown" language, which makes a lot of the GDB commands
> fall flat. Like so, when debugging an Ada program:
>
>     (gdb) list foo.adb:1
>     internal error - unimplemented function 
> unk_lang_create_fundamental_type called.
>     (gdb) quit
>
> With the attached patch, and also the little patch to dwarf2read.c
> (attached too, will be submitted later, after this one is agreed on),
> GDB behaves in a much more friendly way:
>
>     (gdb) list foo.adb:1
>     1       procedure Foo is
>     2          A : Integer := 1;
>     3       begin
>     4          A := A + 1;
>     5       end Foo;
>     (gdb) b foo.adb:4
>     Breakpoint 1 at 0x8049769: file foo.adb, line 4.
>     (gdb) run
>     Starting program: /lek.a/brobecke/ada_example/foo
>
>     Breakpoint 1, _ada_foo () at foo.adb:4
>     4          A := A + 1;
>     Current language:  auto; currently unsupported
>     (gdb) p a
>     $1 = 1



It should probably warn (I guess it has to be in the reader, since we 
have no hook for when you switch to a language, right?) when it is 
switching to the unsupported language.

Something like "Warning: The current language is unsupported by GDB. 
Name lookups and printouts may not look like what you expect as a 
result".

That way, nobody files bugs because the unsupported language does what 
C would do, when they expect what <insert other language here> would do.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFA] Add new language: "unsupported"
  2003-05-07 15:01 ` Daniel Berlin
@ 2003-05-07 17:27   ` Elena Zannoni
  2003-05-07 18:10     ` Joel Brobecker
  2003-05-08 17:55     ` Joel Brobecker
  0 siblings, 2 replies; 9+ messages in thread
From: Elena Zannoni @ 2003-05-07 17:27 UTC (permalink / raw)
  To: Daniel Berlin; +Cc: Joel Brobecker, gdb-patches

Daniel Berlin writes:
 > 
 > On Tuesday, May 6, 2003, at 09:42  PM, Joel Brobecker wrote:
 > 
 > > As promised to Elena, this is a followup on:
 > >
 > >     http://sources.redhat.com/ml/gdb-patches/2003-04/msg00209.html
 > >
 > > Basically, I added a new "unsupported" language which support is
 > > minimalistic (identical to what we do with the "asm" language).
 > > I didn't fancy "partial":
 > >
 > >         (gdb) show lang
 > >         Current language:  auto; currently partial
 > >
 > > I felt like it could confuse the user to think that "partial" is the
 > > name of a real language :-). But I'm not such a big fan of 
 > > "unsupported"
 > > either, so all suggestions are welcome.
 > >
 > > This new language will first be used by the dwarf2 reader, for objects
 > > which language is currently not supported. What it does, at the moment,
 > > is use the "unknown" language, which makes a lot of the GDB commands
 > > fall flat. Like so, when debugging an Ada program:
 > >
 > >     (gdb) list foo.adb:1
 > >     internal error - unimplemented function 
 > > unk_lang_create_fundamental_type called.
 > >     (gdb) quit
 > >
 > > With the attached patch, and also the little patch to dwarf2read.c
 > > (attached too, will be submitted later, after this one is agreed on),
 > > GDB behaves in a much more friendly way:
 > >
 > >     (gdb) list foo.adb:1
 > >     1       procedure Foo is
 > >     2          A : Integer := 1;
 > >     3       begin
 > >     4          A := A + 1;
 > >     5       end Foo;
 > >     (gdb) b foo.adb:4
 > >     Breakpoint 1 at 0x8049769: file foo.adb, line 4.
 > >     (gdb) run
 > >     Starting program: /lek.a/brobecke/ada_example/foo
 > >
 > >     Breakpoint 1, _ada_foo () at foo.adb:4
 > >     4          A := A + 1;
 > >     Current language:  auto; currently unsupported
 > >     (gdb) p a
 > >     $1 = 1
 > 
 > 
 > 
 > It should probably warn (I guess it has to be in the reader, since we 
 > have no hook for when you switch to a language, right?) when it is 
 > switching to the unsupported language.
 > 
 > Something like "Warning: The current language is unsupported by GDB. 
 > Name lookups and printouts may not look like what you expect as a 
 > result".
 > 
 > That way, nobody files bugs because the unsupported language does what 
 > C would do, when they expect what <insert other language here> would do.

that's not a bad idea, actually. This must be the lawyer talking :-)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFA] Add new language: "unsupported"
  2003-05-07 17:27   ` Elena Zannoni
@ 2003-05-07 18:10     ` Joel Brobecker
  2003-05-08 17:55     ` Joel Brobecker
  1 sibling, 0 replies; 9+ messages in thread
From: Joel Brobecker @ 2003-05-07 18:10 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: Daniel Berlin, gdb-patches

>  > It should probably warn (I guess it has to be in the reader, since we 
>  > have no hook for when you switch to a language, right?) when it is 
>  > switching to the unsupported language.
>  > 
>  > Something like "Warning: The current language is unsupported by GDB. 
>  > Name lookups and printouts may not look like what you expect as a 
>  > result".
>  > 
>  > That way, nobody files bugs because the unsupported language does what 
>  > C would do, when they expect what <insert other language here> would do.
> 
> that's not a bad idea, actually. This must be the lawyer talking :-)

Ok, I'll do that, but that'll be a separate patch.

-- 
Joel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFA] Add new language: "unsupported"
  2003-05-07 14:21 ` Elena Zannoni
  2003-05-07 14:24   ` Daniel Jacobowitz
@ 2003-05-08 17:37   ` Joel Brobecker
  1 sibling, 0 replies; 9+ messages in thread
From: Joel Brobecker @ 2003-05-08 17:37 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

>  > 2003-05-06  J. Brobecker  <brobecker@gnat.com>
>  > 
>  >         * defs.h (language): Add language_unsupported enum value.
>  >         * c-lang.c (unsupported_language_defn): New language definition.
>  >         (_initialize_c_language): Add the new unsupported language to
>  >         the list of languages known to GDB.
>  > 
>  > Ok to apply?
> 
> Yes, modulus the name choice. Could you add a few more comments on
> what this new language is suitable for, etc? 

Thanks. Below is what I ended up comitting.

A test-case is coming up. I will also have a look at the documentation.

2003-05-08  J. Brobecker  <brobecker@gnat.com>

        * defs.h (language): Add language_minimal enum value.
        * c-lang.c (minimal_language_defn): New language definition.
        (_initialize_c_language): Add the new minimal language to the list
        of languages known to GDB.

-- 
Joel

[-- Attachment #2: lang.diff --]
[-- Type: text/plain, Size: 2826 bytes --]

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.118
diff -c -3 -p -r1.118 defs.h
*** defs.h	10 Apr 2003 02:18:40 -0000	1.118
--- defs.h	8 May 2003 17:29:20 -0000
*************** enum language
*** 211,217 ****
      language_m2,		/* Modula-2 */
      language_asm,		/* Assembly language */
      language_scm,    		/* Scheme / Guile */
!     language_pascal		/* Pascal */
    };
  
  enum precision_type
--- 211,218 ----
      language_m2,		/* Modula-2 */
      language_asm,		/* Assembly language */
      language_scm,    		/* Scheme / Guile */
!     language_pascal,		/* Pascal */
!     language_minimal		/* All other languages, minimal support only */
    };
  
  enum precision_type
Index: c-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/c-lang.c,v
retrieving revision 1.18
diff -c -3 -p -r1.18 c-lang.c
*** c-lang.c	2 Apr 2003 03:02:46 -0000	1.18
--- c-lang.c	8 May 2003 17:29:21 -0000
*************** const struct language_defn asm_language_
*** 651,660 ****
--- 651,697 ----
    LANG_MAGIC
  };
  
+ /* The following language_defn does not represent a real language.
+    It just provides a minimal support a-la-C that should allow users
+    to do some simple operations when debugging applications that use
+    a language currently not supported by GDB.  */
+ 
+ const struct language_defn minimal_language_defn =
+ {
+   "minimal",			/* Language name */
+   language_minimal,
+   c_builtin_types,
+   range_check_off,
+   type_check_off,
+   case_sensitive_on,
+   c_preprocess_and_parse,
+   c_error,
+   evaluate_subexp_standard,
+   c_printchar,			/* Print a character constant */
+   c_printstr,			/* Function to print string constant */
+   c_emit_char,			/* Print a single char */
+   c_create_fundamental_type,	/* Create fundamental type in this language */
+   c_print_type,			/* Print a type using appropriate syntax */
+   c_val_print,			/* Print a value using appropriate syntax */
+   c_value_print,		/* Print a top-level value */
+   NULL,				/* Language specific skip_trampoline */
+   NULL,				/* Language specific symbol demangler */
+   {"", "", "", ""},		/* Binary format info */
+   {"0%lo", "0", "o", ""},	/* Octal format info */
+   {"%ld", "", "d", ""},		/* Decimal format info */
+   {"0x%lx", "0x", "x", ""},	/* Hex format info */
+   c_op_print_tab,		/* expression operators for printing */
+   1,				/* c-style arrays */
+   0,				/* String lower bound */
+   &builtin_type_char,		/* Type of string elements */
+   LANG_MAGIC
+ };
+ 
  void
  _initialize_c_language (void)
  {
    add_language (&c_language_defn);
    add_language (&cplus_language_defn);
    add_language (&asm_language_defn);
+   add_language (&minimal_language_defn);
  }

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFA] Add new language: "unsupported"
  2003-05-07 17:27   ` Elena Zannoni
  2003-05-07 18:10     ` Joel Brobecker
@ 2003-05-08 17:55     ` Joel Brobecker
  1 sibling, 0 replies; 9+ messages in thread
From: Joel Brobecker @ 2003-05-08 17:55 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: Daniel Berlin, gdb-patches

>  > It should probably warn (I guess it has to be in the reader, since we 
>  > have no hook for when you switch to a language, right?) when it is 
>  > switching to the unsupported language.
>  > 
>  > Something like "Warning: The current language is unsupported by GDB. 
>  > Name lookups and printouts may not look like what you expect as a 
>  > result".
> 
> that's not a bad idea, actually. This must be the lawyer talking :-)

I can place a warning in set_language(). But I think the warning should
only be printed once. Opinions? 

I'm also wondering how useful such a warning is going to be. I think
that the new language name, "minimal", is pretty clear as to what
capabilities it provides (or doesn't thereof)... Since GDB clearly
prints the new language name when auto-switching, I don't think there is
any risk of confusion anymore.

-- 
Joel


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-05-08 17:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-07  1:42 [RFA] Add new language: "unsupported" Joel Brobecker
2003-05-07 11:01 ` Eli Zaretskii
2003-05-07 14:21 ` Elena Zannoni
2003-05-07 14:24   ` Daniel Jacobowitz
2003-05-08 17:37   ` Joel Brobecker
2003-05-07 15:01 ` Daniel Berlin
2003-05-07 17:27   ` Elena Zannoni
2003-05-07 18:10     ` Joel Brobecker
2003-05-08 17:55     ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox