From: Andrew Cagney <ac131313@redhat.com>
To: "D.Venkatasubramanian, Noida" <dvenkat@noida.hcltech.com>,
gdb-patches@sources.redhat.com
Subject: Re: FW: [PATCH] Commandline Support for the H8300 Simulator.
Date: Fri, 07 Mar 2003 17:22:00 -0000 [thread overview]
Message-ID: <3E68D55F.8010409@redhat.com> (raw)
In-Reply-To: <E04CF3F88ACBD5119EFE00508BBB212107F155C0@exch-01.noida.hcltech.com>
> 2003-02-22 D.Venkatasubramanian <dvenkat@noida.hcltech.com>
>
> * compile.c: Added #define SET_CMDLINE_LOCATION to
> set the location of 8-bit (256 locations) where the
> Command Line arguments would be stored.
> (decode): Added a TRAP to 0xcc for Commandline
> processing using pseudo opcode O_SYS_CMDLINE.
> (sim_resume): Added handling of O_SYS_CMDLINE Trap.
> (sim_create_inferior): Setting a pointer to
> Commandline Args array.
> * inst.h: Added a new variable ptr_CommandLine for
> storing pointer to Commandline array.
>
>
>
> *** sim/h8300/inst.h.original Wed Feb 19 15:28:24 2003
> --- sim/h8300/inst.h.modified Sat Feb 22 19:50:51 2003
> *************** enum h8300_sim_state {
> *** 66,71 ****
> --- 66,74 ----
> SIM_STATE_RUNNING, SIM_STATE_EXITED, SIM_STATE_SIGNALLED, SIM_STATE_STOPPED
> };
>
> + /* For Command Line. */
> + char **ptr_CommandLine; /* Pointer to command Line Arguments. */
Please call the variable:
ptr_command_line
(gnu coding standards don't like edit case variables)
> typedef struct
> {
> enum h8300_sim_state state;
>
>
>
> *** sim/h8300/compile.c.original Wed Feb 19 15:28:09 2003
> --- sim/h8300/compile.c.modified Sat Feb 22 19:50:43 2003
> *************** void sim_set_simcache_size PARAMS ((int)
> *** 119,124 ****
> --- 119,132 ----
> #define UEXTSHORT(x) ((x) & 0xffff)
> #define SEXTSHORT(x) ((short) (x))
>
> + #define SET_CMDLINE_LOCATION \
> + if (h8300smode) \
> + addr_cmdline = 0xffff00L; \
> + else if (h8300hmode) \
> + addr_cmdline = 0x2ff00L; \
> + else \
> + addr_cmdline = 0xff00L;
> +
Please write the above as a function cmdline_location() that returns the
address.
> + ptr_CommandLine = argv;
I'd change that to strdup (argv) (freeing the old value if necessary).
that way the code can't run foul of GDB freeing up the parameter.
Otherwize, approved.
Andrew
next prev parent reply other threads:[~2003-03-07 17:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-05 14:07 D.Venkatasubramanian, Noida
2003-03-07 17:11 ` Andrew Cagney
2003-03-07 17:22 ` Andrew Cagney [this message]
2003-03-11 8:51 D.Venkatasubramanian, Noida
2003-03-17 9:34 D.Venkatasubramanian, Noida
2003-03-17 9:36 D.Venkatasubramanian, Noida
2003-03-17 14:28 ` Andrew Cagney
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=3E68D55F.8010409@redhat.com \
--to=ac131313@redhat.com \
--cc=dvenkat@noida.hcltech.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