Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc] [10/17] Get rid of current_gdbarch in p-lang.c
@ 2007-10-11  8:56 Markus Deuling
  2007-10-11 13:36 ` Pierre Muller
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Deuling @ 2007-10-11  8:56 UTC (permalink / raw)
  To: GDB Patches; +Cc: Ulrich Weigand

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Hi,

this patch gets rid of some of the current_gdbarch's in p-lang.c
Is this ok to commit?

ChangeLog: 


	* p-lang.c: Add new include objfiles.h.
	(pascal_create_fundamental_type): Use objfile->gdbarch to get
	at the current architecture.
	* Makefile.in (p-lang.o): Add dependency on objfile.h.



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





[-- Attachment #2: diff-p-lang --]
[-- Type: text/plain, Size: 5033 bytes --]

diff -urpN src/gdb/Makefile.in dev/gdb/Makefile.in
--- src/gdb/Makefile.in	2007-10-11 08:30:21.000000000 +0200
+++ dev/gdb/Makefile.in	2007-10-11 09:30:33.000000000 +0200
@@ -2442,7 +2442,7 @@ p-exp.o: p-exp.c $(defs_h) $(gdb_string_
 	$(objfiles_h) $(block_h)
 p-lang.o: p-lang.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
 	$(expression_h) $(parser_defs_h) $(language_h) $(p_lang_h) \
-	$(valprint_h) $(value_h)
+	$(valprint_h) $(value_h) $(objfiles_h)
 posix-hdep.o: posix-hdep.c $(defs_h) $(gdb_string_h) $(gdb_select_h)
 ppcbug-rom.o: ppcbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
 	$(serial_h) $(regcache_h)
diff -urpN src/gdb/p-lang.c dev/gdb/p-lang.c
--- src/gdb/p-lang.c	2007-10-09 11:33:24.000000000 +0200
+++ dev/gdb/p-lang.c	2007-10-11 09:32:35.000000000 +0200
@@ -31,7 +31,8 @@
 #include "valprint.h"
 #include "value.h"
 #include <ctype.h>
- 
+#include "objfiles.h"
+
 extern void _initialize_pascal_language (void);
 
 
@@ -335,7 +336,7 @@ pascal_create_fundamental_type (struct o
          name "<?type?>".  When all the dust settles from the type
          reconstruction work, this should probably become an error. */
       type = init_type (TYPE_CODE_INT,
-			gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_int_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			0, "<?type?>", objfile);
       warning (_("internal error: no Pascal fundamental type %d"), typeid);
       break;
@@ -361,80 +362,80 @@ pascal_create_fundamental_type (struct o
       break;
     case FT_SHORT:
       type = init_type (TYPE_CODE_INT,
-			gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_short_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			0, "integer", objfile);
       break;
     case FT_SIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-			gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_short_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			0, "integer", objfile);		/* FIXME-fnf */
       break;
     case FT_UNSIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-			gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_short_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			TYPE_FLAG_UNSIGNED, "word", objfile);
       break;
     case FT_INTEGER:
       type = init_type (TYPE_CODE_INT,
-			gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_int_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			0, "longint", objfile);
       break;
     case FT_SIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
-			gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_int_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			0, "longint", objfile);		/* FIXME -fnf */
       break;
     case FT_UNSIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
-			gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_int_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			TYPE_FLAG_UNSIGNED, "cardinal", objfile);
       break;
     case FT_LONG:
       type = init_type (TYPE_CODE_INT,
-			gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_long_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			0, "long", objfile);
       break;
     case FT_SIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-			gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_long_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			0, "long", objfile);	/* FIXME -fnf */
       break;
     case FT_UNSIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-			gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_long_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
       break;
     case FT_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
 			gdbarch_long_long_bit
-			  (current_gdbarch) / TARGET_CHAR_BIT,
+			  (objfile->gdbarch) / TARGET_CHAR_BIT,
 			0, "long long", objfile);
       break;
     case FT_SIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
 			gdbarch_long_long_bit
-			  (current_gdbarch) / TARGET_CHAR_BIT,
+			  (objfile->gdbarch) / TARGET_CHAR_BIT,
 			0, "signed long long", objfile);
       break;
     case FT_UNSIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
 			gdbarch_long_long_bit
-			  (current_gdbarch) / TARGET_CHAR_BIT,
+			  (objfile->gdbarch) / TARGET_CHAR_BIT,
 			TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
       break;
     case FT_FLOAT:
       type = init_type (TYPE_CODE_FLT,
-			gdbarch_float_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_float_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			0, "float", objfile);
       break;
     case FT_DBL_PREC_FLOAT:
       type = init_type (TYPE_CODE_FLT,
-			gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT,
+			gdbarch_double_bit (objfile->gdbarch) / TARGET_CHAR_BIT,
 			0, "double", objfile);
       break;
     case FT_EXT_PREC_FLOAT:
       type = init_type (TYPE_CODE_FLT,
-			gdbarch_long_double_bit (current_gdbarch)
+			gdbarch_long_double_bit (objfile->gdbarch)
 			  / TARGET_CHAR_BIT,
 			0, "extended", objfile);
       break;



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-11 10:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-11  8:56 [rfc] [10/17] Get rid of current_gdbarch in p-lang.c Markus Deuling
2007-10-11 13:36 ` Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox