Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] sim/ppc/psim.c: ignore architecture param
@ 2002-06-17 11:59 Elena Zannoni
  2002-06-17 12:27 ` Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: Elena Zannoni @ 2002-06-17 11:59 UTC (permalink / raw)
  To: gdb-patches


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  <ezannoni@redhat.com>

        * 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;
     }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFA] sim/ppc/psim.c: ignore architecture param
  2002-06-17 11:59 [RFA] sim/ppc/psim.c: ignore architecture param Elena Zannoni
@ 2002-06-17 12:27 ` Andrew Cagney
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2002-06-17 12:27 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: gdb-patches

> 2002-06-17  Elena Zannoni  <ezannoni@redhat.com>
> 
>         * psim.c (psim_options): Don't choke when gdb invokes us with
>         the --architecture option, just ignore it.
> 
> 

Ah! Yes.  (mutter something about desperatly needing a gdb.base/sim.exp 
test case :-)

Andrew



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-17 19:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-17 11:59 [RFA] sim/ppc/psim.c: ignore architecture param Elena Zannoni
2002-06-17 12:27 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox