From: Markus Deuling <deuling@de.ibm.com>
To: GDB Patches <gdb-patches@sourceware.org>
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: [rfc] [10/17] Get rid of current_gdbarch in p-lang.c
Date: Thu, 11 Oct 2007 08:56:00 -0000 [thread overview]
Message-ID: <470DE4AC.2020101@de.ibm.com> (raw)
[-- 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;
next reply other threads:[~2007-10-11 8:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-11 8:56 Markus Deuling [this message]
2007-10-11 13:36 ` Pierre Muller
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=470DE4AC.2020101@de.ibm.com \
--to=deuling@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--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