This is the mail archive of the gdb-patches@sources.redhat.com 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]

[RFA] Add new language: "unsupported"


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: lang.diff
Description: Text document

Attachment: dw2.diff
Description: Text document


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