This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

[rfc] [01/17] Get rid of current_gdbarch in exec.c



Hi,


this patch gets rid of some of the current_gdbarch's in exec.c

Is this ok to commit?

ChangeLog:


* exec.c (arch-utils.h): New include. (print_section_info): Use gdbarch_from_bfd to get at the current architecture. Makefile.in (exec.o): Add new dependency to arch-utils.h.



--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com




diff -urpN src/gdb/exec.c dev/gdb/exec.c
--- src/gdb/exec.c	2007-08-23 20:08:28.000000000 +0200
+++ dev/gdb/exec.c	2007-10-11 07:56:14.000000000 +0200
@@ -41,6 +41,7 @@
 #include "gdb_stat.h"
 
 #include "xcoffsolib.h"
+#include "arch-utils.h"
 
 struct vmap *map_vmap (bfd *, bfd *);
 
@@ -531,7 +532,7 @@ print_section_info (struct target_ops *t
 {
   struct section_table *p;
   /* FIXME: 16 is not wide enough when gdbarch_addr_bit > 64.  */
-  int wid = gdbarch_addr_bit (current_gdbarch) <= 32 ? 8 : 16;
+  int wid = gdbarch_addr_bit (gdbarch_from_bfd (abfd)) <= 32 ? 8 : 16;
 
   printf_filtered ("\t`%s', ", bfd_get_filename (abfd));
   wrap_here ("        ");
diff -urpN src/gdb/Makefile.in dev/gdb/Makefile.in
--- src/gdb/Makefile.in	2007-10-09 11:33:24.000000000 +0200
+++ dev/gdb/Makefile.in	2007-10-11 07:57:16.000000000 +0200
@@ -1992,7 +1992,7 @@ exceptions.o: exceptions.c $(defs_h) $(e
 exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \
 	$(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \
 	$(exec_h) $(readline_h) $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) \
-	$(xcoffsolib_h) $(observer_h)
+	$(xcoffsolib_h) $(observer_h) $(arch_utils_h)
 expprint.o: expprint.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(expression_h) \
 	$(value_h) $(language_h) $(parser_defs_h) $(user_regs_h) $(target_h) \
 	$(gdb_string_h) $(block_h) $(objfiles_h) $(gdb_assert_h)




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