This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: New gdb 31 & 64 bit patches for S/390


Hello,

I'm trying to understand the code:

+void
+_initialize_s390_tdep ()
+{
+  const bfd_arch_info_type *s390_arch_ptr =
+    bfd_lookup_arch (bfd_arch_s390, 0);
+
+#if GDB_MULTI_ARCH
+  /* Hook us into the gdbarch mechanism.  */
+  register_gdbarch_init (bfd_arch_s390, s390_gdbarch_init);
+#endif
+  if (!tm_print_insn)          /* Someone may have already set it */
+    tm_print_insn = gdb_print_insn_s390;
+  if (s390_arch_ptr)
+    tm_print_insn_info.mach = s390_arch_ptr->mach;
+  else
+    internal_error (__FILE__, __LINE__,
+                   "_initialize_s390_tdep: bfd_lookup_arch failed for ....
+}

but don't understand the reason for the call to bfd_lookup_arch().

printcmd.c:print_insn() will set the ->mach to the target architectures 
machine regardless of the above.

	Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]