From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10109 invoked by alias); 11 Mar 2008 19:32:59 -0000 Received: (qmail 10048 invoked by uid 22791); 11 Mar 2008 19:32:58 -0000 X-Spam-Check-By: sourceware.org Received: from qnxmail.qnx.com (HELO qnxmail.qnx.com) (209.226.137.76) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 11 Mar 2008 19:32:32 +0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.42.96.5]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id PAA25919 for ; Tue, 11 Mar 2008 15:13:52 -0400 Received: from [10.42.100.129] (dhcp-100-129 [10.42.100.129]) by smtp.ott.qnx.com (8.8.8/8.6.12) with ESMTP id OAA30510 for ; Tue, 11 Mar 2008 14:32:26 -0500 Message-ID: <47D6DE48.8090003@qnx.com> Date: Tue, 11 Mar 2008 19:32:00 -0000 From: Aleksandar Ristovski User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [RFC] gdb.mi tests Content-Type: multipart/mixed; boundary="------------080007060606080103060306" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-03/txt/msg00117.txt.bz2 This is a multi-part message in MIME format. --------------080007060606080103060306 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1152 Hello, By looking at gdb.mi I have noticed that (unfortunately) the way they are written, they do not allow baseboard files to override mi_* functions. gdb.base allows overriding which is great. For example, we override gdb_start and gdb_load. In overriden functions we call default_ versions and then we perform some additional tasks. For gdb.mi, that is not possible since mi-support.exp is going to be loaded after baseboard file. I would propose the following changes (only one test from gdb.mi is given as an example) and would ask you to, please, comment. Changes: 1. gdb.exp loads mi-support.exp 2. mi-support.exp to "export" overridable functions. By this I mean to have mi_cmd and default_mi_cmd pairs, where mi_cmd calls default_mi_cmd. Baseboard can override mi_cmd (well, it can override anything, but this would be meant to be overriden). 3. gdb.mi/* do not load explicitly mi-support.exp Something like the diffs attached (I manually removed some things from my diff so the diff may not be patchable, but it should be sufficient to illustrate what am I talking about. Thanks, Aleksandar Ristovski QNX Software Systems --------------080007060606080103060306 Content-Type: text/plain; name="mitests.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mitests.diff" Content-length: 1837 Index: lib/mi-support.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v retrieving revision 1.51 diff -u -p -r1.51 mi-support.exp --- lib/mi-support.exp 29 Jan 2008 19:36:58 -0000 1.51 +++ lib/mi-support.exp 11 Mar 2008 19:20:13 -0000 @@ -84,7 +84,7 @@ proc mi_uncatched_gdb_exit {} { } # -# mi_gdb_start [INFERIOR_PTY] -- start gdb running, default procedure +# default_mi_gdb_start [INFERIOR_PTY] -- start gdb running, default procedure # # INFERIOR_PTY should be set to separate-inferior-tty to have the inferior work # with it's own PTY. If set to same-inferior-tty, the inferior shares GDB's PTY. @@ -94,7 +94,7 @@ proc mi_uncatched_gdb_exit {} { # tests on different hosts all using the same server, things can # get really slow. Give gdb at least 3 minutes to start up. # -proc mi_gdb_start { args } { +proc default_mi_gdb_start { args } { global verbose global GDB global GDBFLAGS @@ -230,6 +230,14 @@ proc mi_gdb_start { args } { return 0; } +# +# Overridable function. You can override this function in your +# baseboard file. +# +proc mi_gdb_start { args } { + return [default_mi_gdb_start $args] +} + # Many of the tests depend on setting breakpoints at various places and # running until that breakpoint is reached. At times, we want to start # with a clean-slate with respect to breakpoints, so this utility proc Index: lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.96 diff -u -p -r1.96 gdb.exp --- lib/gdb.exp 23 Jan 2008 06:20:34 -0000 1.96 +++ lib/gdb.exp 11 Mar 2008 19:20:24 -0000 @@ -27,6 +27,7 @@ if {$tool == ""} { } load_lib libgloss.exp +load_lib mi-support.exp global GDB --------------080007060606080103060306 Content-Type: text/plain; name="gdb669.exp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb669.exp.diff" Content-length: 440 Index: gdb.mi/gdb669.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/gdb669.exp,v retrieving revision 1.9 diff -u -p -r1.9 gdb669.exp --- gdb.mi/gdb669.exp 1 Jan 2008 22:53:20 -0000 1.9 +++ gdb.mi/gdb669.exp 11 Mar 2008 19:28:38 -0000 @@ -25,7 +25,7 @@ if {![isnative]} { return } -load_lib mi-support.exp +# load_lib mi-support.exp set MIFLAGS "-i=mi" gdb_exit --------------080007060606080103060306--