From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28101 invoked by alias); 7 Mar 2003 17:22:45 -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 28094 invoked from network); 7 Mar 2003 17:22:44 -0000 Received: from unknown (HELO localhost.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 7 Mar 2003 17:22:44 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id A970A2A9C; Fri, 7 Mar 2003 12:22:39 -0500 (EST) Message-ID: <3E68D55F.8010409@redhat.com> Date: Fri, 07 Mar 2003 17:22:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "D.Venkatasubramanian, Noida" , gdb-patches@sources.redhat.com Subject: Re: FW: [PATCH] Commandline Support for the H8300 Simulator. References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-03/txt/msg00170.txt.bz2 > 2003-02-22 D.Venkatasubramanian > > * 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