From: Elena Zannoni <ezannoni@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] sim/ppc/psim.c: ignore architecture param
Date: Mon, 17 Jun 2002 11:59:00 -0000 [thread overview]
Message-ID: <15630.12657.25468.88513@localhost.redhat.com> (raw)
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;
}
next reply other threads:[~2002-06-17 18:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-17 11:59 Elena Zannoni [this message]
2002-06-17 12:27 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15630.12657.25468.88513@localhost.redhat.com \
--to=ezannoni@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox