From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32250 invoked by alias); 7 May 2003 17:27:15 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32230 invoked from network); 7 May 2003 17:27:15 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 7 May 2003 17:27:15 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h47HRFH17510 for ; Wed, 7 May 2003 13:27:15 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h47HREI25365 for ; Wed, 7 May 2003 13:27:14 -0400 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h47HRDj03940 for ; Wed, 7 May 2003 13:27:14 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 74FC22C43D; Wed, 7 May 2003 13:32:17 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16057.17185.314587.221650@localhost.redhat.com> Date: Wed, 07 May 2003 17:27:00 -0000 To: Daniel Berlin Cc: Joel Brobecker , gdb-patches@sources.redhat.com Subject: Re: [RFA] Add new language: "unsupported" In-Reply-To: References: <20030507014231.GA3156@gnat.com> X-SW-Source: 2003-05/txt/msg00088.txt.bz2 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 would do. that's not a bad idea, actually. This must be the lawyer talking :-)