From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21376 invoked by alias); 17 Jun 2002 18:59:43 -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 21365 invoked from network); 17 Jun 2002 18:59:39 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 17 Jun 2002 18:59:39 -0000 Received: from localhost.redhat.com (romulus.sfbay.redhat.com [172.16.27.251]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id LAA11686 for ; Mon, 17 Jun 2002 11:59:38 -0700 (PDT) Received: by localhost.redhat.com (Postfix, from userid 469) id 2E7AE107D4; Mon, 17 Jun 2002 14:58:57 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15630.12657.25468.88513@localhost.redhat.com> Date: Mon, 17 Jun 2002 11:59:00 -0000 To: gdb-patches@sources.redhat.com Subject: [RFA] sim/ppc/psim.c: ignore architecture param X-SW-Source: 2002-06/txt/msg00305.txt.bz2 With the PPC simulator, if you do the following, you get an error, and the session is aborted: (gdb) set architecture Requires an argument. Valid arguments are rs6000:6000, rs6000:rs1, rs6000:rsc, rs6000:rs2, powerpc:common, auto. (gdb) set architecture powerpc:common The target architecture is assumed to be powerpc:common (gdb) tar sim Usage: [usage message...] With the proposed patch, instead you would get this behavior: [ezannoni@localhost gdb]$ ./gdb -nw GNU gdb 2002-06-17-cvs Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i686-pc-linux-gnu --target=powerpc-eabi". Setting up the environment for debugging gdb. .gdbinit:5: Error in sourced command file: No symbol table is loaded. Use the "file" command. (gdb) set architecture powerpc:7400 The target architecture is assumed to be powerpc:7400 (gdb) tar sim Warning - architecture parameter ignored Connected to the simulator. (gdb) q When gdb sees that the architecture has been set manually, it passes the name of the architecture to the simulator as a parameter: --architecture=powerpc:7400 (for instance). Psim doesn't digest this one. All I did was tolerate the option, ignoring it, and continue the connection. Elena 2002-06-17 Elena Zannoni * psim.c (psim_options): Don't choke when gdb invokes us with the --architecture option, just ignore it. Index: psim.c =================================================================== RCS file: /cvs/src/src/sim/ppc/psim.c,v retrieving revision 1.1.1.2 diff -u -p -r1.1.1.2 psim.c --- psim.c 26 Apr 1999 18:33:32 -0000 1.1.1.2 +++ psim.c 17 Jun 2002 18:55:35 -0000 @@ -341,6 +341,19 @@ psim_options(device *root, else tree_parse(root, "/openprom/trace/%s 1", param); break; + case '-': + /* it's a long option of the form --optionname=optionvalue. + Such options can be passed through if we are invoked by + gdb. */ + if (strstr(argv[argp], "architecture") != NULL) { + /* we must consume the argument here, so that we get out + of the loop. */ + p = argv[argp] + strlen(argv[argp]) - 1; + printf_filtered("Warning - architecture parameter ignored\n"); + } + else + error("Unrecognized option"); + break; } p += 1; }