aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:42:36 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:42:36 +0000
commit48319d1fc01f55ca319e760b82f4527f8ab62476 (patch)
tree135815f419acb4b705b5eecc8ba0e91ed904e36e
parent22601c155deb926f6bd8ffa2faa04f80b52fc676 (diff)
downloadgdb-48319d1fc01f55ca319e760b82f4527f8ab62476.zip
gdb-48319d1fc01f55ca319e760b82f4527f8ab62476.tar.gz
gdb-48319d1fc01f55ca319e760b82f4527f8ab62476.tar.bz2
* gdbtypes.h (builtin_type_void): Remove.
* gdbtypes.c (builtin_type_void): Remove. (_initialize_gdbtypes): Do not initialize it. (safe_parse_type): Add GDBARCH argument. Use it to construct void return type. (check_stub_method): Update call. * infcall.c (call_function_by_hand): Use platform-specific type instead of builtin_type_void. * valops.c (value_cast): Use input void type instead of builtin_type_void.
-rw-r--r--gdb/ChangeLog15
-rw-r--r--gdb/gdbtypes.c16
-rw-r--r--gdb/gdbtypes.h4
-rw-r--r--gdb/infcall.c2
-rw-r--r--gdb/valops.c2
5 files changed, 22 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f7daf3a..b616d5a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,20 @@
2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+ * gdbtypes.h (builtin_type_void): Remove.
+ * gdbtypes.c (builtin_type_void): Remove.
+ (_initialize_gdbtypes): Do not initialize it.
+
+ (safe_parse_type): Add GDBARCH argument. Use it to construct
+ void return type.
+ (check_stub_method): Update call.
+
+ * infcall.c (call_function_by_hand): Use platform-specific type
+ instead of builtin_type_void.
+ * valops.c (value_cast): Use input void type instead of
+ builtin_type_void.
+
+2009-07-02 Ulrich Weigand <uweigand@de.ibm.com>
+
* ada-lang.c (assign_component): Use platform-specific integer type
instead of builtin_type_int32 type.
(ada_evaluate_subexp) [OP_ATR_SIZE]: Likewise.
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index f9c04f1..7a44716 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -108,9 +108,6 @@ struct type *builtin_type_arm_ext;
struct type *builtin_type_ia64_spill;
struct type *builtin_type_ia64_quad;
-/* Platform-neutral void type. */
-struct type *builtin_type_void;
-
/* Platform-neutral character types. */
struct type *builtin_type_true_char;
struct type *builtin_type_true_unsigned_char;
@@ -1525,10 +1522,10 @@ check_typedef (struct type *type)
}
/* Parse a type expression in the string [P..P+LENGTH). If an error
- occurs, silently return builtin_type_void. */
+ occurs, silently return a void type. */
static struct type *
-safe_parse_type (char *p, int length)
+safe_parse_type (struct gdbarch *gdbarch, char *p, int length)
{
struct ui_file *saved_gdb_stderr;
struct type *type;
@@ -1539,7 +1536,7 @@ safe_parse_type (char *p, int length)
/* Call parse_and_eval_type() without fear of longjmp()s. */
if (!gdb_parse_and_eval_type (p, length, &type))
- type = builtin_type_void;
+ type = builtin_type (gdbarch)->builtin_void;
/* Stop suppressing error messages. */
ui_file_delete (gdb_stderr);
@@ -1561,6 +1558,7 @@ safe_parse_type (char *p, int length)
static void
check_stub_method (struct type *type, int method_id, int signature_id)
{
+ struct gdbarch *gdbarch = current_gdbarch;
struct fn_field *f;
char *mangled_name = gdb_mangle_name (type, method_id, signature_id);
char *demangled_name = cplus_demangle (mangled_name,
@@ -1634,7 +1632,7 @@ check_stub_method (struct type *type, int method_id, int signature_id)
&& strncmp (argtypetext, "void", p - argtypetext) != 0)
{
argtypes[argcount].type =
- safe_parse_type (argtypetext, p - argtypetext);
+ safe_parse_type (gdbarch, argtypetext, p - argtypetext);
argcount += 1;
}
argtypetext = p + 1;
@@ -3432,10 +3430,6 @@ _initialize_gdbtypes (void)
builtin_type_ia64_quad =
build_flt (-1, "builtin_type_ia64_quad", floatformats_ia64_quad);
- builtin_type_void =
- init_type (TYPE_CODE_VOID, 1,
- 0,
- "void", (struct objfile *) NULL);
builtin_type_true_char =
init_type (TYPE_CODE_CHAR, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
0,
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 78a1229..f2f339d 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1085,10 +1085,6 @@ extern struct type *builtin_type_arm_ext;
extern struct type *builtin_type_ia64_spill;
extern struct type *builtin_type_ia64_quad;
-/* Platform-neutral void type. Never attempt to construct a pointer
- or reference type to this, because those cannot be platform-neutral.
- You must use builtin_type (...)->builtin_void in those cases. */
-extern struct type *builtin_type_void;
/* Platform-neutral character types.
We use these for the '/c' print format, because c_char is just a
diff --git a/gdb/infcall.c b/gdb/infcall.c
index e364f01..85ccb82 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -562,7 +562,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
/* Tell the target specific argument pushing routine not to
expect a value. */
- target_values_type = builtin_type_void;
+ target_values_type = builtin_type (gdbarch)->builtin_void;
}
else
{
diff --git a/gdb/valops.c b/gdb/valops.c
index 1f71a14..5066367 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -511,7 +511,7 @@ value_cast (struct type *type, struct value *arg2)
return value_at_lazy (type, value_address (arg2));
else if (code1 == TYPE_CODE_VOID)
{
- return value_zero (builtin_type_void, not_lval);
+ return value_zero (type, not_lval);
}
else
{