From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7681 invoked by alias); 5 Aug 2004 09:20:49 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 7673 invoked from network); 5 Aug 2004 09:20:47 -0000 Received: from unknown (HELO smtp10.atl.mindspring.net) (207.69.200.246) by sourceware.org with SMTP; 5 Aug 2004 09:20:47 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by smtp10.atl.mindspring.net with esmtp (Exim 3.33 #1) id 1BseQR-0004Rm-00; Thu, 05 Aug 2004 05:20:39 -0400 Received: from mindspring.com (localhost [127.0.0.1]) by berman.michael-chastain.com (Postfix) with SMTP id 186154B102; Thu, 5 Aug 2004 05:21:08 -0400 (EDT) Date: Thu, 05 Aug 2004 09:20:00 -0000 From: Michael Chastain To: jimb@redhat.com, cagney@redhat.com, ezannoni@redhat.com Subject: gdb.mi/*.exp and absolute line numbers Cc: gdb@sources.redhat.com Message-ID: <4111FC04.nailD7G1U3QKS@mindspring.com> User-Agent: nail 10.8 6/28/04 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00059.txt.bz2 Ouch! I'm pulling on this loose thread, and a whole yard of the test suite unravelled! I need some help. Here is the situation: (1) gcc HEAD has a new warning: incompatible implicit declaration of built-in function. (2) gcc warnings make the callers of gdb_compile bomb out. (3) the way to fix the warning is to add the right #include <...> lines. (4) i fixed all the instances in gdb.base/*.c. (5) the problem is also in: gdb.mi/basics.c gdb.mi/gdb701.c gdb.mi/var-cmd.c (6) none of those files have a copyright notice So I try adding a copyright notice to gdb.mi/basics.c. Boom, twenty gdb.mi/*.exp scripts regress because they depend on absolute line numbers: mi-break.exp mi-cli.exp mi-diassemble.exp mi-eval.exp mi-file.exp mi-return.exp mi-simplerun.exp mi-stack.exp mi-stepi.exp mi-watch.exp mi2-break.exp mi2-cli.exp mi2-disassemble.exp mi2-eval.exp mi2-file.exp mi2-return.exp mi2-simplerun.exp mi2-stack.exp mi2-stepi.exp mi2-watch.exp I'm disconcerted. The natural fix is to use gdb_get_line_number in gdb.mi/*.exp. However, gdb_get_line_number uses the CLI commands "list" and "search". I can't find any MI equivalents. But I don't see why gdb_get_line_number has to talk to gdb at all. I think it could just be implemented in native tcl: open the file, read each line, match the search string. Then gdb_get_line_number would work with all user interfaces. Can you remember the reason that gdb_get_line_number talks to gdb rather than doing its own scanning? Perhaps the reason was just "it's easier to talk to gdb than to write a bunch of tcl". So my proposal is: rewrite gdb_get_line_number in tcl (either clone the function or rewrite existing implementation) add gdb_get_line_number to gdb.mi/*.exp add copyright notices to gdb.mi/{basics.c,gdb701.c,var-cmd.c} add #include lines to gdb.mi/{basics.c,gdb701.c,var-cmd.c} ... so the the gdb test suite will work with gcc HEAD Another way out. Less work, but cheesier: put the copyright notices for basics.c, gdb701.c, and var-cmd.c in a separate COPYRIGHT file, with a note that these files have absolute line numbers and cannot easily be edited. Ideas? Michael C