From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25980 invoked by alias); 8 May 2003 17:37:41 -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 25962 invoked from network); 8 May 2003 17:37:39 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sources.redhat.com with SMTP; 8 May 2003 17:37:39 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id D2911D34B8; Thu, 8 May 2003 10:37:28 -0700 (PDT) Date: Thu, 08 May 2003 17:37:00 -0000 From: Joel Brobecker To: Elena Zannoni Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Add new language: "unsupported" Message-ID: <20030508173728.GR5349@gnat.com> References: <20030507014231.GA3156@gnat.com> <16057.6050.991104.721761@localhost.redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline In-Reply-To: <16057.6050.991104.721761@localhost.redhat.com> User-Agent: Mutt/1.4i X-SW-Source: 2003-05/txt/msg00117.txt.bz2 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 893 > > 2003-05-06 J. Brobecker > > > > * 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 * 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 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="lang.diff" Content-length: 2826 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); } --Q68bSM7Ycu6FN28Q--