aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2006-11-28 22:10:26 +0000
committerDaniel Jacobowitz <drow@false.org>2006-11-28 22:10:26 +0000
commit424163ea1524c5823612a24284cb900cd70e2e2b (patch)
tree5904b83f46fcb044c58f6fefa6f720d578d6bfce /gdb/gdbarch.c
parent979894f2c29bdd6ce92b9588e308dbaeaf9ac819 (diff)
downloadgdb-424163ea1524c5823612a24284cb900cd70e2e2b.zip
gdb-424163ea1524c5823612a24284cb900cd70e2e2b.tar.gz
gdb-424163ea1524c5823612a24284cb900cd70e2e2b.tar.bz2
* Makefile.in (SFILES): Add new and missed files.
(target_descriptions_h): New. (COMMON_OBS): Add target-descriptions.o. (arch-utils.o, infcmd.o, remote.o, target.o): Update. (target-descriptions.o): New. * arch-utils.c (gdbarch_info_fill): Check for a target description. * target-descriptions.c, target-descriptions.h: New files. * gdbarch.sh: Add target_desc to info. Declare it in gdbarch.h. Correct typos. (gdbarch_list_lookup_by_info): Check target_desc. * gdbarch.c, gdbarch.h: Regenerated. * target.c (update_current_target): Mention to_read_description. (target_pre_inferior): Call target_clear_description. (target_read_description): New. * target.h (struct target_ops): Add to_read_description. (target_read_description): New prototype. * infcmd.c (post_create_inferior): Call target_find_description. * remote.c (remote_open_1): Likewise. (extended_remote_create_inferior): Add a comment. (extended_remote_async_create_inferior): Likewise.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 784816f..6939312 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -2,8 +2,8 @@
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free
- Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This file is part of GDB.
@@ -92,6 +92,7 @@ struct gdbarch
const struct bfd_arch_info * bfd_arch_info;
int byte_order;
enum gdb_osabi osabi;
+ const struct target_desc * target_desc;
/* target specific vector. */
struct gdbarch_tdep *tdep;
@@ -250,6 +251,7 @@ struct gdbarch startup_gdbarch =
&bfd_default_arch_struct, /* bfd_arch_info */
BFD_ENDIAN_BIG, /* byte_order */
GDB_OSABI_UNKNOWN, /* osabi */
+ 0, /* target_desc */
/* target specific vector and its dump routine */
NULL, NULL,
/*per-architecture data-pointers and swap regions */
@@ -394,6 +396,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->bfd_arch_info = info->bfd_arch_info;
current_gdbarch->byte_order = info->byte_order;
current_gdbarch->osabi = info->osabi;
+ current_gdbarch->target_desc = info->target_desc;
/* Force the explicit initialization of these. */
current_gdbarch->short_bit = 2*TARGET_CHAR_BIT;
@@ -1563,6 +1566,9 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
"gdbarch_dump: store_return_value = <0x%lx>\n",
(long) current_gdbarch->store_return_value);
fprintf_unfiltered (file,
+ "gdbarch_dump: target_desc = %s\n",
+ paddr_d ((long) current_gdbarch->target_desc));
+ fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
gdbarch_unwind_dummy_id_p (current_gdbarch));
fprintf_unfiltered (file,
@@ -1647,6 +1653,15 @@ gdbarch_osabi (struct gdbarch *gdbarch)
return gdbarch->osabi;
}
+const struct target_desc *
+gdbarch_target_desc (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_target_desc called\n");
+ return gdbarch->target_desc;
+}
+
int
gdbarch_short_bit (struct gdbarch *gdbarch)
{
@@ -3961,8 +3976,7 @@ register_gdbarch_init (enum bfd_architecture bfd_architecture,
}
-/* Look for an architecture using gdbarch_info. Base search on only
- BFD_ARCH_INFO and BYTE_ORDER. */
+/* Look for an architecture using gdbarch_info. */
struct gdbarch_list *
gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
@@ -3976,6 +3990,8 @@ gdbarch_list_lookup_by_info (struct gdbarch_list *arches,
continue;
if (info->osabi != arches->gdbarch->osabi)
continue;
+ if (info->target_desc != arches->gdbarch->target_desc)
+ continue;
return arches;
}
return NULL;