aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1999-05-05 14:45:51 +0000
committerStan Shebs <shebs@codesourcery.com>1999-05-05 14:45:51 +0000
commitb83266a0e1813b7f4891d5d6b0ed6b7302a3fe98 (patch)
treec59a94fbe917e0839329b872139198c2a7a05ab1 /gdb/gdbarch.c
parente1346c8d0969dad58ddc13c9c741cb0f4e6345a5 (diff)
downloadfsf-binutils-gdb-b83266a0e1813b7f4891d5d6b0ed6b7302a3fe98.zip
fsf-binutils-gdb-b83266a0e1813b7f4891d5d6b0ed6b7302a3fe98.tar.gz
fsf-binutils-gdb-b83266a0e1813b7f4891d5d6b0ed6b7302a3fe98.tar.bz2
import gdb-19990504 snapshot
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index b9ee310..87d1906 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -1,5 +1,5 @@
/* Semi-dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, Free Software Foundation, Inc.
+ Copyright 1998-1999, Free Software Foundation, Inc.
This file is part of GDB.
@@ -196,27 +196,36 @@ const struct bfd_arch_info *target_architecture = &bfd_default_arch_struct;
int (*target_architecture_hook) PARAMS ((const struct bfd_arch_info *ap));
/* Do the real work of changing the current architecture */
+
+static int arch_valid PARAMS ((const struct bfd_arch_info *arch));
+static int
+arch_ok (arch)
+ const struct bfd_arch_info *arch;
+{
+ /* Should be performing the more basic check that the binary is
+ compatible with GDB. */
+ /* Check with the target that the architecture is valid. */
+ return (target_architecture_hook == NULL
+ || target_architecture_hook (arch));
+}
+
enum set_arch { set_arch_auto, set_arch_manual };
+
static void
set_arch (arch, type)
const struct bfd_arch_info *arch;
enum set_arch type;
{
- /* FIXME: Should be performing the more basic check that the binary
- is compatible with GDB. */
- /* Check with the target that the architecture is valid. */
- int arch_valid = (target_architecture_hook != NULL
- && !target_architecture_hook (arch));
switch (type)
{
case set_arch_auto:
- if (!arch_valid)
+ if (!arch_ok (arch))
warning ("Target may not support %s architecture",
arch->printable_name);
target_architecture = arch;
break;
case set_arch_manual:
- if (!arch_valid)
+ if (!arch_ok (arch))
{
printf_unfiltered ("Target does not support `%s' architecture.\n",
arch->printable_name);