From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7708 invoked by alias); 9 Apr 2002 08:21:00 -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 7652 invoked from network); 9 Apr 2002 08:20:58 -0000 Received: from unknown (HELO dell-paw-2.cambridge.redhat.com) (195.224.55.226) by sources.redhat.com with SMTP; 9 Apr 2002 08:20:58 -0000 Received: from north-pole.nickc.cambridge.redhat.com (host217-35-25-247.in-addr.btopenworld.com [217.35.25.247]) by dell-paw-2.cambridge.redhat.com (Postfix) with ESMTP id 6BE302B53B; Tue, 9 Apr 2002 09:20:57 +0100 (BST) Received: from north-pole.nickc.cambridge.redhat.com.nickc.cambridge.redhat.com (localhost [127.0.0.1]) by north-pole.nickc.cambridge.redhat.com (Postfix) with ESMTP id BF2311C34D; Tue, 9 Apr 2002 09:20:33 +0100 (BST) To: Andrew Cagney Cc: Anthony Green , gdb-patches@sources.redhat.com Subject: Re: [rfa] Add -m; Was: ARM sim patch: increase default target memory References: <200203171650.g2HGo8714138@louie.sfbay.redhat.com> <3CB07C82.3040902@cygnus.com> <3CB25A74.1080308@cygnus.com> From: Nick Clifton Date: Tue, 09 Apr 2002 01:21:00 -0000 In-Reply-To: <3CB25A74.1080308@cygnus.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-04/txt/msg00350.txt.bz2 Hi Andrew, > > I would also suggest that you consider adding support for a > > megabyte postfix so that the user could do: > > -m 6M > > Good idea, all the sims should do this. Any pointers for the code? Nope - it was just an idea that popped into my head whilst reading your code. It should be very straightforward though. Something like the code attached to the end of this email maybe ? > >> It also sets the default memory size back to something consistent > >> with the other simulators. > > This will stop the java tests from running, so maybe you should also > > add the new switch to the java test harness so that they do not fail. > > Do you know which file? Umm, not sure - libjava.exp maybe ? Anthony ? Cheers Nick ------------------------------------------------------------------------- else if (argv[i][0] == '-' && argv[i][1] == 'm') { char * end_ptr; const char * ptr; unsigned long size; if (argv[i][2] != '\0') ptr = argv[i] + 2; else { ptr = argv [++i]; if (ptr == NULL) { sim_callback->printf_filtered (sim_callback, "Missing argument to -m option\n"); return NULL; } } size = strtoul (ptr, & end_ptr, 0); if (end_ptr != ptr) { switch (* end_ptr) { case 'k': case 'K': size *= 1024; break; case 'm': case 'M': size *= 1024 * 1024; break; case 'g': case 'G': size *= 1024 * 1024 * 1024; break; case 0: break; default: sim_callback->printf_filtered (sim_callback, "Unexpected characters at end of -m option\n"); break; } } sim_size (size); }