Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@cambridge.redhat.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sources.redhat.com, Richard.Earnshaw@arm.com
Subject: Re: Add support for target switches in simulator
Date: Mon, 20 May 2002 06:11:00 -0000	[thread overview]
Message-ID: <m3hel3ufpy.fsf@north-pole.nickc.cambridge.redhat.com> (raw)
In-Reply-To: <3CE54CDD.6070001@cygnus.com>

HI Guys,

> Andrew Cagney <ac131313@cygnus.com> 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  <nickc@cambridge.redhat.com>

	* 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


  reply	other threads:[~2002-05-20 13:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-09  3:09 Add support for RedBoot SWIs to ARM Simulator Nick Clifton
2002-05-09  3:22 ` Richard Earnshaw
2002-05-09  4:00   ` Nick Clifton
2002-05-09  4:11     ` Richard Earnshaw
2002-05-16  9:16       ` Add support for target switches in simulator Nick Clifton
2002-05-16  9:25         ` Richard Earnshaw
2002-05-17  1:58           ` Nick Clifton
2002-05-17  5:37             ` Richard Earnshaw
2002-05-17  6:46               ` Nick Clifton
2002-05-17 10:17                 ` Andrew Cagney
2002-05-17  7:33             ` Frank Ch. Eigler
2002-05-17 10:29             ` Andrew Cagney
2002-05-16  9:36         ` Frank Ch. Eigler
2002-05-16 11:08         ` Michael Snyder
2002-05-17 11:32         ` Andrew Cagney
2002-05-20  6:11           ` Nick Clifton [this message]
2002-05-20  7:12             ` Andrew Cagney
2002-05-20  7:19             ` Richard Earnshaw
2002-05-20  7:26               ` Nick Clifton
2002-05-09  7:35     ` Add support for RedBoot SWIs to ARM Simulator Frank Ch. Eigler
2002-05-20  7:49 Add support for target switches in simulator Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3hel3ufpy.fsf@north-pole.nickc.cambridge.redhat.com \
    --to=nickc@cambridge.redhat.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox