Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Markus Deuling <deuling@de.ibm.com>
To: GDB Patches <gdb-patches@sourceware.org>,
	hilfinger@gnat.com,
	        Joel Brobecker <brobecker@adacore.com>
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: [rfc] [06/17] Get rid of current_gdbarch in ada-lang.c
Date: Thu, 11 Oct 2007 08:55:00 -0000	[thread overview]
Message-ID: <470DE4A1.4090506@de.ibm.com> (raw)

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

Hi,

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

ChangeLog: 


	* ada-lang.c (ada_create_fundamental_type): Use objfile->gdbarch to get
	at the current architecture.
	(ada_language_arch_info): Replace current_gdbarch by gdbarch.


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






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

diff -urpN src/gdb/ada-lang.c dev/gdb/ada-lang.c
--- src/gdb/ada-lang.c	2007-09-23 18:25:03.000000000 +0200
+++ dev/gdb/ada-lang.c	2007-10-11 09:26:16.000000000 +0200
@@ -10203,7 +10203,7 @@ ada_create_fundamental_type (struct objf
          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 Ada fundamental type %d"), typeid);
       break;
@@ -10229,80 +10229,80 @@ ada_create_fundamental_type (struct objf
       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, "short_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, "short_integer", objfile);
       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, "unsigned short", 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, "integer", 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, "integer", 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, "unsigned int", 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_integer", 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_integer", objfile);
       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)
+			gdbarch_long_long_bit (objfile->gdbarch)
 			  / TARGET_CHAR_BIT,
 			0, "long_long_integer", objfile);
       break;
     case FT_SIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-			gdbarch_long_long_bit (current_gdbarch)
+			gdbarch_long_long_bit (objfile->gdbarch)
 			  / TARGET_CHAR_BIT,
 			0, "long_long_integer", objfile);
       break;
     case FT_UNSIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-			gdbarch_long_long_bit (current_gdbarch)
+			gdbarch_long_long_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, "long_float", 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, "long_long_float", objfile);
       break;
@@ -10327,24 +10327,24 @@ enum ada_primitive_types {
 };
 
 static void
-ada_language_arch_info (struct gdbarch *current_gdbarch,
+ada_language_arch_info (struct gdbarch *gdbarch,
 			struct language_arch_info *lai)
 {
-  const struct builtin_type *builtin = builtin_type (current_gdbarch);
+  const struct builtin_type *builtin = builtin_type (gdbarch);
   lai->primitive_type_vector
-    = GDBARCH_OBSTACK_CALLOC (current_gdbarch, nr_ada_primitive_types + 1,
+    = GDBARCH_OBSTACK_CALLOC (gdbarch, nr_ada_primitive_types + 1,
 			      struct type *);
   lai->primitive_type_vector [ada_primitive_type_int] =
     init_type (TYPE_CODE_INT,
-	       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+	       gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
 	       0, "integer", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_long] =
     init_type (TYPE_CODE_INT,
-	       gdbarch_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+	       gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT,
 	       0, "long_integer", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_short] =
     init_type (TYPE_CODE_INT,
-	       gdbarch_short_bit (current_gdbarch) / TARGET_CHAR_BIT,
+	       gdbarch_short_bit (gdbarch) / TARGET_CHAR_BIT,
 	       0, "short_integer", (struct objfile *) NULL);
   lai->string_char_type = 
     lai->primitive_type_vector [ada_primitive_type_char] =
@@ -10352,27 +10352,27 @@ ada_language_arch_info (struct gdbarch *
                0, "character", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_float] =
     init_type (TYPE_CODE_FLT,
-	       gdbarch_float_bit (current_gdbarch)/ TARGET_CHAR_BIT,
+	       gdbarch_float_bit (gdbarch)/ TARGET_CHAR_BIT,
                0, "float", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_double] =
     init_type (TYPE_CODE_FLT,
-	       gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT,
+	       gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT,
                0, "long_float", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_long_long] =
     init_type (TYPE_CODE_INT, 
-	       gdbarch_long_long_bit (current_gdbarch) / TARGET_CHAR_BIT,
+	       gdbarch_long_long_bit (gdbarch) / TARGET_CHAR_BIT,
                0, "long_long_integer", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_long_double] =
     init_type (TYPE_CODE_FLT,
-	       gdbarch_double_bit (current_gdbarch) / TARGET_CHAR_BIT,
+	       gdbarch_double_bit (gdbarch) / TARGET_CHAR_BIT,
                0, "long_long_float", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_natural] =
     init_type (TYPE_CODE_INT,
-	       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+	       gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
 	       0, "natural", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_positive] =
     init_type (TYPE_CODE_INT,
-	       gdbarch_int_bit (current_gdbarch) / TARGET_CHAR_BIT,
+	       gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT,
 	       0, "positive", (struct objfile *) NULL);
   lai->primitive_type_vector [ada_primitive_type_void] = builtin->builtin_void;
 





             reply	other threads:[~2007-10-11  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-11  8:55 Markus Deuling [this message]
2007-10-11 17:33 ` Joel Brobecker
2007-10-22  6:04   ` Markus Deuling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=470DE4A1.4090506@de.ibm.com \
    --to=deuling@de.ibm.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=hilfinger@gnat.com \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox