From: Nick Clifton <nickc@cambridge.redhat.com>
To: gdb-patches@sources.redhat.com
Cc: Richard.Earnshaw@arm.com
Subject: Add support for target switches in simulator
Date: Thu, 16 May 2002 09:16:00 -0000 [thread overview]
Message-ID: <m3vg9o5aql.fsf@north-pole.nickc.cambridge.redhat.com> (raw)
In-Reply-To: <200205091111.MAA22264@cam-mail2.cambridge.arm.com>
Hi Guys,
I would like permission to apply the following patch. It adds the
ability for simulator backends to parse their own command line
switches, thus creating target specific simulator options.
I would like this facility in order to be able to add a new switch
to the ARM simulator - a switch to select which set(s) of SWI
emulations it should perform.
I have not worked out how this feature would be accessed from GDB.
My guess is that the switches could be added to the arguments passed
via sim_open(), but how would a GDB user tell GDB to add these
switches ?
Cheers
Nick
sim/common/ChangeLog
2002-05-16 Nick Clifton <nickc@cambridge.redhat.com>
* run.c (main): Call sim_target_parse_command_line if
SIM_TARGET_SWITCHES is defined.
(usage): Call sim_target_display_usage if SIM_TARGET_SWITCHES
is defined.
include/ChangeLog
2002-05-16 Nick Clifton <nickc@cambridge.redhat.com>
* remote-sim.h: Provide prototypes for
sim_target_parse_command_line and sim_target_display_usage
if SIM_TARGET_SWITCHES is defined.
Index: sim/common/run.c
===================================================================
RCS file: /cvs/src/src/sim/common/run.c,v
retrieving revision 1.7
diff -c -3 -p -w -r1.7 run.c
*** sim/common/run.c 21 Dec 2001 00:47:18 -0000 1.7
--- sim/common/run.c 16 May 2002 16:04:36 -0000
*************** main (ac, av)
*** 111,116 ****
--- 111,120 ----
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 ()
*** 334,338 ****
--- 338,346 ----
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);
}
Index: include/remote-sim.h
===================================================================
RCS file: /cvs/src/src/include/remote-sim.h,v
retrieving revision 1.4
diff -c -3 -p -w -r1.4 remote-sim.h
*** include/remote-sim.h 14 Mar 2001 02:27:43 -0000 1.4
--- include/remote-sim.h 16 May 2002 16:07:49 -0000
*************** void sim_set_profile_size PARAMS ((int n
*** 346,351 ****
--- 346,362 ----
multi-cpu simulators. */
void sim_kill PARAMS ((SIM_DESC sd));
+
+ #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
#ifdef __cplusplus
}
next prev parent reply other threads:[~2002-05-16 16:16 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 ` Nick Clifton [this message]
2002-05-16 9:25 ` Add support for target switches in simulator 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
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=m3vg9o5aql.fsf@north-pole.nickc.cambridge.redhat.com \
--to=nickc@cambridge.redhat.com \
--cc=Richard.Earnshaw@arm.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