From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14474 invoked by alias); 20 May 2002 13:11:19 -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 14429 invoked from network); 20 May 2002 13:11:16 -0000 Received: from unknown (HELO dell-pe2450-3.cambridge.redhat.com) (195.224.55.225) by sources.redhat.com with SMTP; 20 May 2002 13:11:16 -0000 Received: from north-pole.nickc.cambridge.redhat.com (host217-39-2-165.in-addr.btopenworld.com [217.39.2.165]) by dell-pe2450-3.cambridge.redhat.com (Postfix) with ESMTP id E011F844A8 for ; Mon, 20 May 2002 14:11:15 +0100 (BST) Received: from north-pole.nickc.cambridge.redhat.com.nickc.cambridge.redhat.com (localhost [127.0.0.1]) by north-pole.nickc.cambridge.redhat.com (Postfix) with ESMTP id 771391C39D; Mon, 20 May 2002 14:11:06 +0100 (BST) To: Andrew Cagney Cc: gdb-patches@sources.redhat.com, Richard.Earnshaw@arm.com Subject: Re: Add support for target switches in simulator References: <200205091111.MAA22264@cam-mail2.cambridge.arm.com> <3CE54CDD.6070001@cygnus.com> From: Nick Clifton Date: Mon, 20 May 2002 06:11:00 -0000 In-Reply-To: <3CE54CDD.6070001@cygnus.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-05/txt/msg00813.txt.bz2 HI Guys, > Andrew Cagney writes: > I think a better place would be a new file sim/common/sim-run.h to > indicate that this is part of the interface that run.c uses. OK - an adjusted patch is attached below. > As for converting Arm to use the new framework, I would recommend > creating a change-request :-) I think that would be best. I certainly feel that it is outside the scope of this patch, so I hope that continuing to use the old interface (ie not sim-options.[ch]) will not stop the patch from being accepted. Is this version OK ? Cheers Nick 2002-05-20 Nick Clifton * run.h: New header. Provide prototypes for functions used between run() and libsim.a which are not used by GDB. * run.c: Include run.h. (main): If SIM_TARGET_SWITCHES is defined call sim_target_parse_command_line. (usage): If SIM_TARGET_SWITCHES is defined call sim_target_display_usage. Index: sim/common/run.c =================================================================== RCS file: /cvs/src/src/sim/common/run.c,v retrieving revision 1.8 diff -c -3 -p -w -r1.8 run.c *** sim/common/run.c 17 May 2002 19:09:12 -0000 1.8 --- sim/common/run.c 20 May 2002 13:06:02 -0000 *************** with this program; if not, write to the *** 46,51 **** --- 46,52 ---- #include "callback.h" #include "remote-sim.h" #include "ansidecl.h" + #include "run.h" static void usage PARAMS ((void)); extern int optind; *************** main (ac, av) *** 111,116 **** --- 112,121 ---- default_callback.init (&default_callback); sim_set_callbacks (&default_callback); + #ifdef SIM_TARGET_SWITCHES + ac = sim_target_parse_command_line (ac, av); + #endif + /* FIXME: This is currently being rewritten to have each simulator do all argv processing. */ *************** usage () *** 338,342 **** --- 343,351 ---- fprintf (stderr, "\n"); fprintf (stderr, "program args Arguments to pass to simulated program.\n"); fprintf (stderr, " Note: Very few simulators support this.\n"); + #ifdef SIM_TARGET_SWITCHES + fprintf (stderr, "\nTarget specific options:\n"); + sim_target_display_usage (); + #endif exit (1); } *** /dev/null Thu Aug 30 21:30:55 2001 --- sim/common/run.h Mon May 20 14:03:14 2002 *************** *** 0 **** --- 1,32 ---- + /* This file defines the part of the interface between the standalone + simaulator program - run - and simulator library - libsim.a - that + is not used by GDB. The GDB part is described in include/remote-sim.h. + + Copyright 2002 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + #ifdef SIM_TARGET_SWITCHES + /* Parse the command line, extracting any target specific switches + before the generic simulator code gets a chance to complain + about them. Returns the adjusted value of argc. */ + int sim_target_parse_command_line PARAMS ((int, char **)); + + /* Display a list of target specific switches supported by this + target. */ + void sim_target_display_usage PARAMS ((void)); + #endif