From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6966 invoked by alias); 7 Apr 2002 17:06:14 -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 6954 invoked from network); 7 Apr 2002 17:06:11 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.240.27) by sources.redhat.com with SMTP; 7 Apr 2002 17:06:11 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 309163CBF; Sun, 7 Apr 2002 13:06:10 -0400 (EDT) Message-ID: <3CB07C82.3040902@cygnus.com> Date: Sun, 07 Apr 2002 10:06:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.9) Gecko/20020328 X-Accept-Language: en-us, en MIME-Version: 1.0 To: nickc@redhat.com Cc: Anthony Green , gdb-patches@sources.redhat.com Subject: [rfa] Add -m; Was: ARM sim patch: increase default target memory References: <200203171650.g2HGo8714138@louie.sfbay.redhat.com> Content-Type: multipart/mixed; boundary="------------050609080100050609040102" X-SW-Source: 2002-04/txt/msg00254.txt.bz2 This is a multi-part message in MIME format. --------------050609080100050609040102 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 236 Hello, The attatched patch (er, hack), adds support for the -m flag from the GDB command line (vis (gdb) target sim -m). It also sets the default memory size back to something consistent with the other simulators. ok? Andrew --------------050609080100050609040102 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1412 2002-04-07 Andrew Cagney * wrapper.c (sim_open): Add support for -m. (mem_size): Reduce to 2MB. Fix PR gdb/433. Index: wrapper.c =================================================================== RCS file: /cvs/src/src/sim/arm/wrapper.c,v retrieving revision 1.18 diff -u -r1.18 wrapper.c --- wrapper.c 18 Mar 2002 21:43:15 -0000 1.18 +++ wrapper.c 7 Apr 2002 16:59:18 -0000 @@ -47,7 +47,7 @@ static char *myname; /* Memory size in bytes. */ -static int mem_size = (1 << 23); +static int mem_size = (1 << 21); /* Non-zero to display start up banner, and maybe other things. */ static int verbosity; @@ -448,7 +448,7 @@ { int i; - /* Scan for endian-ness switch. */ + /* Scan for endian-ness and memory-size switches. */ for (i = 0; (argv[i] != NULL) && (argv[i][0] != 0); i++) if (argv[i][0] == '-' && argv[i][1] == 'E') { @@ -482,6 +482,23 @@ (sim_callback, "Unrecognised argument to -E option\n"); break; } + } + else if (argv[i][0] == '-' && argv[i][1] == 'm') + { + if (argv[i][2] != '\0') + sim_size (atoi (&argv[i][2])); + else if (argv[i + 1] != NULL) + { + sim_size (atoi (argv[i + 1])); + i++; + } + else + { + sim_callback->printf_filtered (sim_callback, + "Missing argument to -m option\n"); + return NULL; + } + } } --------------050609080100050609040102--