+2000-08-10 Andrew Cagney <cagney@ops1.cygnus.com>
+
+ * rs6000-nat.c (set_host_arch): Check value returned by
+ gdbarch_update_p.
+ * gdbarch.sh (gdbarch_update_p): Rename gdbarch_update.
+ * gdbarch.h, gdbarch.c: Regenerate
+ * arch-utils.c (set_gdbarch_from_file,
+ initialize_current_architecture, set_endian): Update.
+
2000-08-10 Jimmy Guo <guo@cup.hp.com>
* c-lang.c: Set case sensitivity on for c_language_defn,
struct gdbarch_info info;
memset (&info, 0, sizeof info);
info.byte_order = LITTLE_ENDIAN;
- gdbarch_update (info);
+ if (! gdbarch_update_p (info))
+ {
+ printf_unfiltered ("Little endian target not supported by GDB\n");
+ }
}
else
{
struct gdbarch_info info;
memset (&info, 0, sizeof info);
info.byte_order = BIG_ENDIAN;
- gdbarch_update (info);
+ if (! gdbarch_update_p (info))
+ {
+ printf_unfiltered ("Big endian target not supported by GDB\n");
+ }
}
else
{
info.bfd_arch_info = bfd_scan_arch (set_architecture_string);
if (info.bfd_arch_info == NULL)
internal_error ("set_architecture: bfd_scan_arch failed");
- if (gdbarch_update (info))
+ if (gdbarch_update_p (info))
target_architecture_auto = 0;
else
printf_unfiltered ("Architecture `%s' not reconized.\n",
struct gdbarch_info info;
memset (&info, 0, sizeof info);
info.abfd = abfd;
- gdbarch_update (info);
+ if (! gdbarch_update_p (info))
+ error ("Architecture of file not reconized.\n");
}
else
{
if (GDB_MULTI_ARCH)
{
- gdbarch_update (info);
+ if (! gdbarch_update_p (info))
+ {
+ internal_error ("initialize_current_architecture: Selection of initial architecture failed");
+ }
}
/* Create the ``set architecture'' command appending ``auto'' to the
failed. */
int
-gdbarch_update (struct gdbarch_info info)
+gdbarch_update_p (struct gdbarch_info info)
{
struct gdbarch *new_gdbarch;
struct gdbarch_list **list;
architecture manipulation commands.
The INFO parameter shall be fully initialized (``memset (&INFO,
- sizeof (info), 0)'' set relevant fields) before gdbarch_update() is
- called. gdbarch_update() shall initialize any ``default'' fields
- using information obtained from the previous architecture or
+ sizeof (info), 0)'' set relevant fields) before gdbarch_update_p()
+ is called. gdbarch_update_p() shall initialize any ``default''
+ fields using information obtained from the previous architecture or
INFO.ABFD (if specified) before calling the corresponding
- architectures INIT function. */
+ architectures INIT function.
-extern int gdbarch_update (struct gdbarch_info info);
+ Returns non-zero if the update succeeds */
+
+extern int gdbarch_update_p (struct gdbarch_info info);
architecture manipulation commands.
The INFO parameter shall be fully initialized (\`\`memset (&INFO,
- sizeof (info), 0)'' set relevant fields) before gdbarch_update() is
- called. gdbarch_update() shall initialize any \`\`default'' fields
- using information obtained from the previous architecture or
+ sizeof (info), 0)'' set relevant fields) before gdbarch_update_p()
+ is called. gdbarch_update_p() shall initialize any \`\`default''
+ fields using information obtained from the previous architecture or
INFO.ABFD (if specified) before calling the corresponding
- architectures INIT function. */
+ architectures INIT function.
-extern int gdbarch_update (struct gdbarch_info info);
+ Returns non-zero if the update succeeds */
+
+extern int gdbarch_update_p (struct gdbarch_info info);
failed. */
int
-gdbarch_update (struct gdbarch_info info)
+gdbarch_update_p (struct gdbarch_info info)
{
struct gdbarch *new_gdbarch;
struct gdbarch_list **list;
memset (&info, 0, sizeof info);
info.bfd_arch_info = bfd_get_arch_info (&abfd);
- gdbarch_update (info);
+ if (!gdbarch_update_p (info))
+ {
+ internal_error ("set_host_arch: failed to select architecture");
+ }
}
\f