* [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct
@ 2012-02-20 14:53 Siddhesh Poyarekar
2012-02-21 20:46 ` Tom Tromey
2012-02-21 21:39 ` [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct Jan Kratochvil
0 siblings, 2 replies; 70+ messages in thread
From: Siddhesh Poyarekar @ 2012-02-20 14:53 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 4269 bytes --]
Hi,
If a struct member is at an offset greater than or equal to
0x10000000, the resulting bit position within the struct overflows and
causes an invalid access. The following program demonstrates this
problem:
-----------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BSIZE (0x10000000)
struct s {
char buf1[BSIZE];
char buf2[8];
char buf3[8];
char buf4[8];
};
int main()
{
struct s *p = malloc(sizeof(struct s));
memset(p,0,sizeof(struct s));
printf("%p %x\n", &p->buf2[0], p->buf2[0]);
return(0);
}
-----------------------------------------------
Compile and run the program under gdb:
(gdb) b 18
Breakpoint 1 at 0x400554: file test.c, line 18.
(gdb) run
Starting program: /root/gdb/a.out
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x2aaaaaac7000
Breakpoint 1, main () at test.c:18
18 printf("%p %x\n", &p->buf2[0], p->buf2[0]);
(gdb) p p->buf2
Cannot access memory at address 0x2aaa9b022010
-----------------------------------------------
This happens because the bitpos in field_location within the struct
main_type.field is declared as an int, limiting it to just 4 bytes. I
have attached a patch that expands this to LONGEST and adjusted this
change in the code. The testsuite does not report any regressions due
to this patch and it fixes the problem.
Regards,
Siddhesh
gdb/ChangeLog:
2012-02-20 Siddhesh Poyarekar <siddhesh@redhat.com>
* gdbtypes.h (struct main_type.field.field_location): Expand
bitpos to LONGEST.
* value.h (modify_field): Adjust to accept LONGEST as bitpos.
(value_primitive_field, val_print): Adjust to accept LONGEST as
offset.
* value.c (modify_field, value_primitive_field, val_print): Ditto.
(value_bits_synthetic_pointer, value_bits_valid): Ditto.
(unpack_value_bits_as_long_1): Ditto.
* valprint.c (val_print_scalar_formatted, val_print): Ditto.
* valprint.h (val_print_scalar_formatted): Ditto.
* valops.c (search_struct_field, search_struct_method): Ditto.
(value_struct_elt_for_reference, find_method_list): Ditto.
* regcache.h (regcache_cooked_read_part): Ditto.
(regcache_cooked_write_part): Ditto.
* regcache.c (regcache_cooked_read_part): Ditto.
(regcache_cooked_write_part, regcache_xfer_part): Ditto.
* ax-gdb.c (gen_offset, gen_bitfield_ref):Ditto.
(gen_primitive_ref, gen_struct_ref_recursive): Ditto.
* ada-lang.c (ada_value_primitive_packed_val): Ditto.
(ada_value_primitive_field, find_struct_field): Ditto.
(ada_search_struct_field, ada_template_to_fixed_record_type_1):
Ditto.
* p-lang.c (is_pascal_string_type): Ditto.
* mips-tdep.c (mips_xfer_register): Adjust to accept LONGEST as
offset. Adjust format specifier for bitpos.
(mips_n32n64_fp_arg_chunk_p): Adjust to accept LONGEST as offset.
(mips_n32n64_return_value): Store bitpos in LONGEST.
* sparc64-tdep.c (sparc64_store_floating_fields): Adjust to accept
LONGEST as bitpos.
(sparc64_extract_floating_fields): Ditto.
* gdbtypes.c (recursive_dump_type): Adjust format specifier to
print bitpos.
* ada-typeprint.c (print_enum_type): Ditto.
* c-typeprint.c (c_type_print_base): Ditto.
* m2-typeprint.c (m2_enum): Ditto.
* p-typeprint.c (pascal_type_print_base): Ditto.
* language.h (struct language_defn): Adjust la_val_print to accept
LONGEST as embedded_offset.
* language.c (unk_lang_val_print): Adjust for change in
la_val_print.
* ada-lang.h (ada_val_print): Ditto.
* ada-valprint.c (ada_val_print, ada_val_print_1): Ditto.
(print_variant_part, print_field_values): Ditto.
* c-lang.h (c_val_print): Ditto.
* c-valprint.c (c_val_print): Ditto.
* d-lang.h (d_val_print): Ditto.
* d-valprint.c (d_val_print): Ditto.
* f-lang.h (f_val_print): Ditto.
* f-valprint.c (f_val_print): Ditto.
* jv-lang.h (java_val_print): Ditto.
* jv-valprint.c (java_val_print, java_print_value_fields): Ditto.
* m2-lang.h (m2_val_print): Ditto.
* m2-valprint.c (m2_print_array_contents, m2_val_print):Ditto.
(m2_print_unbounded_array, m2_print_array_contents): Ditto.
(m2_print_long_set): Ditto.
* p-lang.h (pascal_val_print, is_pascal_string_type): Ditto.
* p-valprint.c (pascal_val_print): Ditto.
* eval.c (evaluate_struct_tuple): Expand bitsize and bitpos to
LONGEST.
[-- Attachment #2: gdb-longest-bitpos.patch --]
[-- Type: text/plain, Size: 41016 bytes --]
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 107df93..c032a7e 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -2218,7 +2218,7 @@ has_negatives (struct type *type)
struct value *
ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
- long offset, int bit_offset, int bit_size,
+ LONGEST offset, int bit_offset, int bit_size,
struct type *type)
{
struct value *v;
@@ -6340,7 +6340,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0)
{
- int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
+ LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
return ada_value_primitive_packed_val (arg1, value_contents (arg1),
@@ -6387,7 +6387,7 @@ find_struct_field (const char *name, struct type *type, int offset,
for (i = 0; i < TYPE_NFIELDS (type); i += 1)
{
- int bit_pos = TYPE_FIELD_BITPOS (type, i);
+ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
int fld_offset = offset + bit_pos / 8;
const char *t_field_name = TYPE_FIELD_NAME (type, i);
@@ -6491,7 +6491,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset,
int j;
struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type,
i));
- int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
+ LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
for (j = 0; j < TYPE_NFIELDS (field_type); j += 1)
{
@@ -7305,7 +7305,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
struct type *rtype;
int nfields, bit_len;
int variant_field;
- long off;
+ LONGEST off;
int fld_bit_len;
int f;
@@ -7377,7 +7377,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
that follow this one. */
if (ada_is_aligner_type (field_type))
{
- long field_offset = TYPE_FIELD_BITPOS (field_type, f);
+ LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f);
field_valaddr = cond_offset_host (field_valaddr, field_offset);
field_address = cond_offset_target (field_address, field_offset);
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index 2a6cd57..1e62a50 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -164,7 +164,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int,
extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
struct ui_file *stream);
-extern int ada_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
+extern int ada_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR,
struct ui_file *, int,
const struct value *,
const struct value_print_options *);
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index 5599278..42fe3e6 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -274,7 +274,7 @@ static void
print_enum_type (struct type *type, struct ui_file *stream)
{
int len = TYPE_NFIELDS (type);
- int i, lastval;
+ LONGEST i, lastval;
fprintf_filtered (stream, "(");
wrap_here (" ");
@@ -289,7 +289,7 @@ print_enum_type (struct type *type, struct ui_file *stream)
fputs_filtered (ada_enum_name (TYPE_FIELD_NAME (type, i)), stream);
if (lastval != TYPE_FIELD_BITPOS (type, i))
{
- fprintf_filtered (stream, " => %d", TYPE_FIELD_BITPOS (type, i));
+ fprintf_filtered (stream, " => %ld", TYPE_FIELD_BITPOS (type, i));
lastval = TYPE_FIELD_BITPOS (type, i);
}
lastval += 1;
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index f43f3e3..6ad0931 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -42,7 +42,7 @@ static void print_record (struct type *, const gdb_byte *, int,
const struct value_print_options *);
static int print_field_values (struct type *, const gdb_byte *,
- int,
+ LONGEST,
struct ui_file *, int,
const struct value *,
const struct value_print_options *,
@@ -50,7 +50,7 @@ static int print_field_values (struct type *, const gdb_byte *,
static void adjust_type_signedness (struct type *);
-static int ada_val_print_1 (struct type *, const gdb_byte *, int, CORE_ADDR,
+static int ada_val_print_1 (struct type *, const gdb_byte *, LONGEST, CORE_ADDR,
struct ui_file *, int,
const struct value *,
const struct value_print_options *);
@@ -571,7 +571,7 @@ ada_printstr (struct ui_file *stream, struct type *type,
int
ada_val_print (struct type *type, const gdb_byte *valaddr,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options)
@@ -667,7 +667,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr,
static int
ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
- int offset, CORE_ADDR address,
+ LONGEST offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value *original_value,
const struct value_print_options *options)
@@ -936,7 +936,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
static int
print_variant_part (struct type *type, int field_num,
- const gdb_byte *valaddr, int offset,
+ const gdb_byte *valaddr, LONGEST offset,
struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options,
@@ -1048,7 +1048,7 @@ print_record (struct type *type, const gdb_byte *valaddr,
static int
print_field_values (struct type *type, const gdb_byte *valaddr,
- int offset, struct ui_file *stream, int recurse,
+ LONGEST offset, struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options,
int comma_needed,
@@ -1133,7 +1133,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr,
}
else
{
- int bit_pos = TYPE_FIELD_BITPOS (type, i);
+ LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i);
int bit_size = TYPE_FIELD_BITSIZE (type, i);
struct value_print_options opts;
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 739677f..c4fcc1c 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -85,7 +85,7 @@ static void gen_left_shift (struct agent_expr *, int);
static void gen_frame_args_address (struct gdbarch *, struct agent_expr *);
static void gen_frame_locals_address (struct gdbarch *, struct agent_expr *);
-static void gen_offset (struct agent_expr *ax, int offset);
+static void gen_offset (struct agent_expr *ax, LONGEST offset);
static void gen_sym_offset (struct agent_expr *, struct symbol *);
static void gen_var_ref (struct gdbarch *, struct agent_expr *ax,
struct axs_value *value, struct symbol *var);
@@ -135,15 +135,15 @@ static void gen_deref (struct agent_expr *, struct axs_value *);
static void gen_address_of (struct agent_expr *, struct axs_value *);
static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
struct axs_value *value,
- struct type *type, int start, int end);
+ struct type *type, LONGEST start, LONGEST end);
static void gen_primitive_field (struct expression *exp,
struct agent_expr *ax,
struct axs_value *value,
- int offset, int fieldno, struct type *type);
+ LONGEST offset, int fieldno, struct type *type);
static int gen_struct_ref_recursive (struct expression *exp,
struct agent_expr *ax,
struct axs_value *value,
- char *field, int offset,
+ char *field, LONGEST offset,
struct type *type);
static void gen_struct_ref (struct expression *exp, struct agent_expr *ax,
struct axs_value *value,
@@ -621,7 +621,7 @@ gen_frame_locals_address (struct gdbarch *gdbarch, struct agent_expr *ax)
programming in ML, it would be clearer why these are the same
thing. */
static void
-gen_offset (struct agent_expr *ax, int offset)
+gen_offset (struct agent_expr *ax, LONGEST offset)
{
/* It would suffice to simply push the offset and add it, but this
makes it easier to read positive and negative offsets in the
@@ -1283,7 +1283,7 @@ gen_address_of (struct agent_expr *ax, struct axs_value *value)
static void
gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
struct axs_value *value, struct type *type,
- int start, int end)
+ LONGEST start, LONGEST end)
{
/* Note that ops[i] fetches 8 << i bits. */
static enum agent_op ops[]
@@ -1318,13 +1318,13 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
/* The first and one-after-last bits in the field, but rounded down
and up to byte boundaries. */
- int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
- int bound_end = (((end + TARGET_CHAR_BIT - 1)
+ LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT;
+ LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1)
/ TARGET_CHAR_BIT)
* TARGET_CHAR_BIT);
/* current bit offset within the structure */
- int offset;
+ LONGEST offset;
/* The index in ops of the opcode we're considering. */
int op;
@@ -1443,7 +1443,7 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax,
static void
gen_primitive_field (struct expression *exp,
struct agent_expr *ax, struct axs_value *value,
- int offset, int fieldno, struct type *type)
+ LONGEST offset, int fieldno, struct type *type)
{
/* Is this a bitfield? */
if (TYPE_FIELD_PACKED (type, fieldno))
@@ -1468,7 +1468,7 @@ gen_primitive_field (struct expression *exp,
static int
gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax,
struct axs_value *value,
- char *field, int offset, struct type *type)
+ char *field, LONGEST offset, struct type *type)
{
int i, rslt;
int nbases = TYPE_N_BASECLASSES (type);
diff --git a/gdb/c-lang.h b/gdb/c-lang.h
index e8c632f..edc62ce 100644
--- a/gdb/c-lang.h
+++ b/gdb/c-lang.h
@@ -72,7 +72,7 @@ extern void c_print_typedef (struct type *,
struct ui_file *);
extern int c_val_print (struct type *, const gdb_byte *,
- int, CORE_ADDR,
+ LONGEST, CORE_ADDR,
struct ui_file *, int,
const struct value *,
const struct value_print_options *);
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 21887c6..e47b4e5 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -717,7 +717,7 @@ c_type_print_base (struct type *type, struct ui_file *stream,
{
int i;
int len, real_len;
- int lastval;
+ LONGEST lastval;
enum
{
s_none, s_public, s_private, s_protected
@@ -1206,7 +1206,7 @@ c_type_print_base (struct type *type, struct ui_file *stream,
fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
if (lastval != TYPE_FIELD_BITPOS (type, i))
{
- fprintf_filtered (stream, " = %d",
+ fprintf_filtered (stream, " = %ld",
TYPE_FIELD_BITPOS (type, i));
lastval = TYPE_FIELD_BITPOS (type, i);
}
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index 82551e9..f034a88 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -147,7 +147,7 @@ c_textual_element_type (struct type *type, char format)
int
c_val_print (struct type *type, const gdb_byte *valaddr,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value *original_value,
const struct value_print_options *options)
@@ -416,7 +416,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
/* Print vtable entry - we only get here if NOT using
-fvtable_thunks. (Otherwise, look under
TYPE_CODE_PTR.) */
- int offset = (embedded_offset
+ LONGEST offset = (embedded_offset
+ TYPE_FIELD_BITPOS (type,
VTBL_FNADDR_OFFSET) / 8);
struct type *field_type = TYPE_FIELD_TYPE (type,
diff --git a/gdb/d-lang.h b/gdb/d-lang.h
index 67ca14c..e2cda03 100644
--- a/gdb/d-lang.h
+++ b/gdb/d-lang.h
@@ -25,7 +25,7 @@
extern char *d_demangle (const char *mangled, int options);
extern int d_val_print (struct type *type, const gdb_byte *valaddr,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options);
diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c
index 527c087..6c7921e 100644
--- a/gdb/d-valprint.c
+++ b/gdb/d-valprint.c
@@ -70,7 +70,7 @@ dynamic_array_type (struct type *type, const gdb_byte *valaddr,
/* Implements the la_val_print routine for language D. */
int
-d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
+d_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset,
CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options)
diff --git a/gdb/eval.c b/gdb/eval.c
index 9913a72..0922596 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -319,7 +319,8 @@ evaluate_struct_tuple (struct value *struct_val,
int pc = *pos;
struct value *val = NULL;
int nlabels = 0;
- int bitpos, bitsize;
+ int bitsize;
+ LONGEST bitpos;
bfd_byte *addr;
/* Skip past the labels, and count them. */
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
index 4e5563d..e6407b7 100644
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -28,7 +28,7 @@ extern void f_error (char *); /* Defined in f-exp.y */
extern void f_print_type (struct type *, const char *, struct ui_file *, int,
int);
-extern int f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
+extern int f_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR,
struct ui_file *, int,
const struct value *,
const struct value_print_options *);
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index 17f747f..3b55640 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -247,7 +247,7 @@ Type node corrupt! F77 arrays cannot have %d subscripts (%d Max)"),
also identical to val_print. */
int
-f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
+f_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset,
CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value *original_value,
const struct value_print_options *options)
@@ -498,7 +498,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
fprintf_filtered (stream, "( ");
for (index = 0; index < TYPE_NFIELDS (type); index++)
{
- int offset = TYPE_FIELD_BITPOS (type, index) / 8;
+ LONGEST offset = TYPE_FIELD_BITPOS (type, index) / 8;
val_print (TYPE_FIELD_TYPE (type, index), valaddr,
embedded_offset + offset,
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index b6e8b4c..7f4d1ef 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -3198,7 +3198,7 @@ recursive_dump_type (struct type *type, int spaces)
for (idx = 0; idx < TYPE_NFIELDS (type); idx++)
{
printfi_filtered (spaces + 2,
- "[%d] bitpos %d bitsize %d type ",
+ "[%d] bitpos %ld bitsize %d type ",
idx, TYPE_FIELD_BITPOS (type, idx),
TYPE_FIELD_BITSIZE (type, idx));
gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout);
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index cddd2d0..3f4e849 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -514,7 +514,7 @@ struct main_type
the LSB. For a range bound or enum value, this is the
value itself. */
- int bitpos;
+ LONGEST bitpos;
/* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr
is the location (in the target) of the static field.
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index 18a7c19..9323c0b 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -438,7 +438,7 @@ java_link_class_type (struct gdbarch *gdbarch,
for (i = TYPE_N_BASECLASSES (type); i < nfields; i++)
{
int accflags;
- int boffset;
+ LONGEST boffset;
if (fields == NULL)
{
diff --git a/gdb/jv-lang.h b/gdb/jv-lang.h
index d061096..4380a42 100644
--- a/gdb/jv-lang.h
+++ b/gdb/jv-lang.h
@@ -42,7 +42,7 @@ struct builtin_java_type
extern const struct builtin_java_type *builtin_java_type (struct gdbarch *);
-extern int java_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
+extern int java_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR,
struct ui_file *, int,
const struct value *,
const struct value_print_options *);
diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c
index d430ba0..914d871 100644
--- a/gdb/jv-valprint.c
+++ b/gdb/jv-valprint.c
@@ -261,7 +261,7 @@ java_value_print (struct value *val, struct ui_file *stream,
static void
java_print_value_fields (struct type *type, const gdb_byte *valaddr,
- int offset,
+ LONGEST offset,
CORE_ADDR address, struct ui_file *stream,
int recurse,
const struct value *val,
@@ -480,7 +480,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
int
java_val_print (struct type *type, const gdb_byte *valaddr,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options)
diff --git a/gdb/language.c b/gdb/language.c
index 49ba21a..1850880 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -849,7 +849,7 @@ unk_lang_print_type (struct type *type, const char *varstring,
static int
unk_lang_val_print (struct type *type, const gdb_byte *valaddr,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options)
diff --git a/gdb/language.h b/gdb/language.h
index a47a44d..c20c581 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -242,7 +242,7 @@ struct language_defn
int (*la_val_print) (struct type *type,
const gdb_byte *contents,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options);
diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h
index 2803e63..865e8fb 100644
--- a/gdb/m2-lang.h
+++ b/gdb/m2-lang.h
@@ -32,7 +32,7 @@ extern void m2_print_typedef (struct type *, struct symbol *,
extern int m2_is_long_set (struct type *type);
extern int m2_is_unbounded_array (struct type *type);
-extern int m2_val_print (struct type *, const gdb_byte *, int, CORE_ADDR,
+extern int m2_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR,
struct ui_file *, int,
const struct value *,
const struct value_print_options *);
diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c
index 9735d7f..6c5dc43 100644
--- a/gdb/m2-typeprint.c
+++ b/gdb/m2-typeprint.c
@@ -587,7 +587,8 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
void
m2_enum (struct type *type, struct ui_file *stream, int show, int level)
{
- int lastval, i, len;
+ LONGEST lastval;
+ int i, len;
if (show < 0)
{
@@ -609,7 +610,7 @@ m2_enum (struct type *type, struct ui_file *stream, int show, int level)
fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
if (lastval != TYPE_FIELD_BITPOS (type, i))
{
- fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i));
+ fprintf_filtered (stream, " = %ld", TYPE_FIELD_BITPOS (type, i));
lastval = TYPE_FIELD_BITPOS (type, i);
}
lastval++;
diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c
index 4378b00..4a7977f 100644
--- a/gdb/m2-valprint.c
+++ b/gdb/m2-valprint.c
@@ -36,7 +36,7 @@ static int print_unpacked_pointer (struct type *type,
struct ui_file *stream);
static void
m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options,
@@ -89,7 +89,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high)
static void
m2_print_long_set (struct type *type, const gdb_byte *valaddr,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream)
{
int empty_set = 1;
@@ -180,7 +180,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr,
static void
m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value_print_options *options)
{
@@ -277,7 +277,7 @@ print_variable_at_address (struct type *type,
static void
m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options,
@@ -315,7 +315,7 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
also identical to val_print. */
int
-m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
+m2_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset,
CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value *original_value,
const struct value_print_options *options)
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index a670cd3..68f8e70 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -289,7 +289,7 @@ static void
mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
int reg_num, int length,
enum bfd_endian endian, gdb_byte *in,
- const gdb_byte *out, int buf_offset)
+ const gdb_byte *out, LONGEST buf_offset)
{
int reg_offset = 0;
@@ -312,7 +312,7 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
}
if (mips_debug)
fprintf_unfiltered (gdb_stderr,
- "xfer $%d, reg offset %d, buf offset %d, length %d, ",
+ "xfer $%d, reg offset %d, buf offset %ld, length %d, ",
reg_num, reg_offset, buf_offset, length);
if (mips_debug && out != NULL)
{
@@ -3221,7 +3221,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct type *func_type,
static int
mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type,
- int offset)
+ LONGEST offset)
{
int i;
@@ -3236,7 +3236,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type,
for (i = 0; i < TYPE_NFIELDS (arg_type); i++)
{
- int pos;
+ LONGEST pos;
struct type *field_type;
/* We're only looking at normal fields. */
@@ -3630,10 +3630,10 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type,
: MIPS_V0_REGNUM);
field < TYPE_NFIELDS (type); field++, regnum += 2)
{
- int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
+ LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field])
/ TARGET_CHAR_BIT);
if (mips_debug)
- fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
+ fprintf_unfiltered (gdb_stderr, "Return float struct+%ld\n",
offset);
if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16)
{
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 826d24f..80c1c68 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -96,8 +96,8 @@ pascal_main_name (void)
are not multiple of TARGET_CHAR_BIT then the results are wrong
but this does not happen for Free Pascal nor for GPC. */
int
-is_pascal_string_type (struct type *type,int *length_pos,
- int *length_size, int *string_pos,
+is_pascal_string_type (struct type *type,LONGEST *length_pos,
+ int *length_size, LONGEST *string_pos,
struct type **char_type,
const char **arrayname)
{
diff --git a/gdb/p-lang.h b/gdb/p-lang.h
index 180c544..350af71 100644
--- a/gdb/p-lang.h
+++ b/gdb/p-lang.h
@@ -35,7 +35,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *,
extern void pascal_print_typedef (struct type *, struct symbol *,
struct ui_file *);
-extern int pascal_val_print (struct type *, const gdb_byte *, int,
+extern int pascal_val_print (struct type *, const gdb_byte *, LONGEST,
CORE_ADDR, struct ui_file *, int,
const struct value *,
const struct value_print_options *);
@@ -49,7 +49,7 @@ extern void pascal_type_print_method_args (const char *, const char *,
/* These are in p-lang.c: */
extern int
- is_pascal_string_type (struct type *, int *, int *, int *,
+ is_pascal_string_type (struct type *, LONGEST *, int *, LONGEST *,
struct type **, const char **);
extern void pascal_printchar (int, struct type *, struct ui_file *);
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index ab82d90..096776d 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -443,7 +443,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
{
int i;
int len;
- int lastval;
+ LONGEST lastval;
enum
{
s_none, s_public, s_private, s_protected
@@ -754,7 +754,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
if (lastval != TYPE_FIELD_BITPOS (type, i))
{
fprintf_filtered (stream,
- " := %d", TYPE_FIELD_BITPOS (type, i));
+ " := %ld", TYPE_FIELD_BITPOS (type, i));
lastval = TYPE_FIELD_BITPOS (type, i);
}
lastval++;
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 39eff10..f80e58f 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -47,7 +47,7 @@
int
pascal_val_print (struct type *type, const gdb_byte *valaddr,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value *original_value,
const struct value_print_options *options)
@@ -59,7 +59,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
LONGEST low_bound, high_bound;
struct type *elttype;
unsigned eltlen;
- int length_pos, length_size, string_pos;
+ LONGEST length_pos, string_pos;
+ int length_size;
struct type *char_type;
LONGEST val;
CORE_ADDR addr;
diff --git a/gdb/regcache.c b/gdb/regcache.c
index c716280..12ed8fa 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -902,7 +902,7 @@ typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum,
static enum register_status
regcache_xfer_part (struct regcache *regcache, int regnum,
- int offset, int len, void *in, const void *out,
+ LONGEST offset, int len, void *in, const void *out,
enum register_status (*read) (struct regcache *regcache,
int regnum,
gdb_byte *buf),
@@ -968,7 +968,7 @@ regcache_raw_write_part (struct regcache *regcache, int regnum,
enum register_status
regcache_cooked_read_part (struct regcache *regcache, int regnum,
- int offset, int len, gdb_byte *buf)
+ LONGEST offset, int len, gdb_byte *buf)
{
struct regcache_descr *descr = regcache->descr;
@@ -979,7 +979,7 @@ regcache_cooked_read_part (struct regcache *regcache, int regnum,
void
regcache_cooked_write_part (struct regcache *regcache, int regnum,
- int offset, int len, const gdb_byte *buf)
+ LONGEST offset, int len, const gdb_byte *buf)
{
struct regcache_descr *descr = regcache->descr;
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 93b4499..81ccda6 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -129,10 +129,10 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache,
write style operations. */
enum register_status regcache_cooked_read_part (struct regcache *regcache,
- int regnum, int offset,
+ int regnum, LONGEST offset,
int len, gdb_byte *buf);
void regcache_cooked_write_part (struct regcache *regcache, int regnum,
- int offset, int len, const gdb_byte *buf);
+ LONGEST offset, int len, const gdb_byte *buf);
/* Special routines to read/write the PC. */
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 327eefe..1fe0cd7 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -639,7 +639,7 @@ sparc64_16_byte_align_p (struct type *type)
static void
sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
- const gdb_byte *valbuf, int element, int bitpos)
+ const gdb_byte *valbuf, int element, LONGEST bitpos)
{
int len = TYPE_LENGTH (type);
@@ -681,7 +681,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
for (i = 0; i < TYPE_NFIELDS (type); i++)
{
struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
+ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
sparc64_store_floating_fields (regcache, subtype, valbuf,
element, subpos);
@@ -713,7 +713,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
static void
sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
- gdb_byte *valbuf, int bitpos)
+ gdb_byte *valbuf, LONGEST bitpos)
{
if (sparc64_floating_p (type))
{
@@ -750,7 +750,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
for (i = 0; i < TYPE_NFIELDS (type); i++)
{
struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
- int subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
+ LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i);
sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos);
}
diff --git a/gdb/valops.c b/gdb/valops.c
index fca601f..d4c567a 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -53,11 +53,11 @@ static int typecmp (int staticp, int varargs, int nargs,
struct field t1[], struct value *t2[]);
static struct value *search_struct_field (const char *, struct value *,
- int, struct type *, int);
+ LONGEST, struct type *, int);
static struct value *search_struct_method (const char *, struct value **,
struct value **,
- int, int *, struct type *);
+ LONGEST, int *, struct type *);
static int find_oload_champ_namespace (struct value **, int,
const char *, const char *,
@@ -85,7 +85,7 @@ oload_classification classify_oload_match (struct badness_vector *,
int, int);
static struct value *value_struct_elt_for_reference (struct type *,
- int, struct type *,
+ LONGEST, struct type *,
char *,
struct type *,
int, enum noside);
@@ -102,7 +102,7 @@ static CORE_ADDR allocate_space_in_inferior (int);
static struct value *cast_into_complex (struct type *, struct value *);
static struct fn_field *find_method_list (struct value **, const char *,
- int, struct type *, int *,
+ LONGEST, struct type *, int *,
struct type **, int *);
void _initialize_valops (void);
@@ -1993,7 +1993,7 @@ typecmp (int staticp, int varargs, int nargs,
fields, look for a baseclass named NAME. */
static struct value *
-search_struct_field (const char *name, struct value *arg1, int offset,
+search_struct_field (const char *name, struct value *arg1, LONGEST offset,
struct type *type, int looking_for_baseclass)
{
int i;
@@ -2051,7 +2051,7 @@ search_struct_field (const char *name, struct value *arg1, int offset,
<variant field>. */
struct value *v;
- int new_offset = offset;
+ LONGEST new_offset = offset;
/* This is pretty gross. In G++, the offset in an
anonymous union is relative to the beginning of the
@@ -2152,7 +2152,7 @@ search_struct_field (const char *name, struct value *arg1, int offset,
static struct value *
search_struct_method (const char *name, struct value **arg1p,
- struct value **args, int offset,
+ struct value **args, LONGEST offset,
int *static_memfuncp, struct type *type)
{
int i;
@@ -2216,7 +2216,7 @@ search_struct_method (const char *name, struct value **arg1p,
for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
{
- int base_offset;
+ LONGEST base_offset;
int skip = 0;
int this_offset;
@@ -2394,7 +2394,7 @@ value_struct_elt (struct value **argp, struct value **args,
static struct fn_field *
find_method_list (struct value **argp, const char *method,
- int offset, struct type *type, int *num_fns,
+ LONGEST offset, struct type *type, int *num_fns,
struct type **basetype, int *boffset)
{
int i;
@@ -2428,7 +2428,7 @@ find_method_list (struct value **argp, const char *method,
/* Not found in object, check in base subobjects. */
for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
{
- int base_offset;
+ LONGEST base_offset;
if (BASETYPE_VIA_VIRTUAL (type, i))
{
@@ -3263,7 +3263,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial)
the form "DOMAIN::NAME". */
static struct value *
-value_struct_elt_for_reference (struct type *domain, int offset,
+value_struct_elt_for_reference (struct type *domain, LONGEST offset,
struct type *curtype, char *name,
struct type *intype,
int want_address,
@@ -3300,7 +3300,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
if (want_address)
return value_from_longest
(lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain),
- offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3));
+ offset + (TYPE_FIELD_BITPOS (t, i) >> 3));
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
return allocate_value (TYPE_FIELD_TYPE (t, i));
else
@@ -3443,7 +3443,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--)
{
struct value *v;
- int base_offset;
+ LONGEST base_offset;
if (BASETYPE_VIA_VIRTUAL (t, i))
base_offset = 0;
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 325cf40..9544720 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -336,7 +336,7 @@ val_print_invalid_address (struct ui_file *stream)
characters printed. */
int
-val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
+val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset,
CORE_ADDR address, struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options,
@@ -556,7 +556,7 @@ val_print_type_code_flags (struct type *type, const gdb_byte *valaddr,
void
val_print_scalar_formatted (struct type *type,
- const gdb_byte *valaddr, int embedded_offset,
+ const gdb_byte *valaddr, LONGEST embedded_offset,
const struct value *val,
const struct value_print_options *options,
int size,
diff --git a/gdb/valprint.h b/gdb/valprint.h
index a34d09b..319e8e7 100644
--- a/gdb/valprint.h
+++ b/gdb/valprint.h
@@ -127,7 +127,7 @@ extern void val_print_type_code_flags (struct type *type,
struct ui_file *stream);
extern void val_print_scalar_formatted (struct type *,
- const gdb_byte *, int,
+ const gdb_byte *, LONGEST,
const struct value *,
const struct value_print_options *,
int,
diff --git a/gdb/value.c b/gdb/value.c
index 583be33..49a6f43 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -308,7 +308,7 @@ struct value
`type', and `embedded_offset' is zero, so everything works
normally. */
struct type *enclosing_type;
- int embedded_offset;
+ LONGEST embedded_offset;
int pointed_to_offset;
/* Values are stored in a chain, so that they can be deleted easily
@@ -1019,7 +1019,7 @@ value_entirely_optimized_out (const struct value *value)
}
int
-value_bits_valid (const struct value *value, int offset, int length)
+value_bits_valid (const struct value *value, LONGEST offset, int length)
{
if (!value->optimized_out)
return 1;
@@ -1032,7 +1032,7 @@ value_bits_valid (const struct value *value, int offset, int length)
int
value_bits_synthetic_pointer (const struct value *value,
- int offset, int length)
+ LONGEST offset, int length)
{
if (value->lval != lval_computed
|| !value->location.computed.funcs->check_synthetic_pointer)
@@ -2496,7 +2496,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type)
FIELDNO says which field. */
struct value *
-value_primitive_field (struct value *arg1, int offset,
+value_primitive_field (struct value *arg1, LONGEST offset,
int fieldno, struct type *arg_type)
{
struct value *v;
@@ -2526,7 +2526,7 @@ value_primitive_field (struct value *arg1, int offset,
bit. Assume that the address, offset, and embedded offset
are sufficiently aligned. */
- int bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno);
+ LONGEST bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno);
int container_bitsize = TYPE_LENGTH (type) * 8;
v = allocate_value_lazy (type);
@@ -2674,7 +2674,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f,
static int
unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr,
- int embedded_offset, int bitpos, int bitsize,
+ LONGEST embedded_offset, int bitpos, int bitsize,
const struct value *original_value,
LONGEST *result)
{
@@ -2774,7 +2774,7 @@ unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr,
int embedded_offset, int fieldno,
const struct value *val, LONGEST *result)
{
- int bitpos = TYPE_FIELD_BITPOS (type, fieldno);
+ LONGEST bitpos = TYPE_FIELD_BITPOS (type, fieldno);
int bitsize = TYPE_FIELD_BITSIZE (type, fieldno);
struct type *field_type = TYPE_FIELD_TYPE (type, fieldno);
@@ -2849,12 +2849,12 @@ value_field_bitfield (struct type *type, int fieldno,
void
modify_field (struct type *type, gdb_byte *addr,
- LONGEST fieldval, int bitpos, int bitsize)
+ LONGEST fieldval, LONGEST bitpos, int bitsize)
{
enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
ULONGEST oword;
ULONGEST mask = (ULONGEST) -1 >> (8 * sizeof (ULONGEST) - bitsize);
- int bytesize;
+ LONGEST bytesize;
/* Normalize BITPOS. */
addr += bitpos / 8;
diff --git a/gdb/value.h b/gdb/value.h
index 2a2274d..3ab523b 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -367,13 +367,13 @@ extern struct value *coerce_array (struct value *value);
bits in the given range are valid, zero if any bit is invalid. */
extern int value_bits_valid (const struct value *value,
- int offset, int length);
+ LONGEST offset, int length);
/* Given a value, determine whether the bits starting at OFFSET and
extending for LENGTH bits are a synthetic pointer. */
extern int value_bits_synthetic_pointer (const struct value *value,
- int offset, int length);
+ LONGEST offset, int length);
/* Given a value, determine whether the contents bytes starting at
OFFSET and extending for LENGTH bytes are available. This returns
@@ -610,7 +610,7 @@ extern int find_overload_match (struct value **args, int nargs,
extern struct value *value_field (struct value *arg1, int fieldno);
-extern struct value *value_primitive_field (struct value *arg1, int offset,
+extern struct value *value_primitive_field (struct value *arg1, LONGEST offset,
int fieldno,
struct type *arg_type);
@@ -775,7 +775,7 @@ extern void release_value_or_incref (struct value *val);
extern int record_latest_value (struct value *val);
extern void modify_field (struct type *type, gdb_byte *addr,
- LONGEST fieldval, int bitpos, int bitsize);
+ LONGEST fieldval, LONGEST bitpos, int bitsize);
extern void type_print (struct type *type, const char *varstring,
struct ui_file *stream, int show);
@@ -805,7 +805,7 @@ extern void value_print_array_elements (struct value *val,
extern struct value *value_release_to_mark (struct value *mark);
extern int val_print (struct type *type, const gdb_byte *valaddr,
- int embedded_offset, CORE_ADDR address,
+ LONGEST embedded_offset, CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value *val,
const struct value_print_options *options,
^ permalink raw reply [flat|nested] 70+ messages in thread* Re: [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct 2012-02-20 14:53 [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct Siddhesh Poyarekar @ 2012-02-21 20:46 ` Tom Tromey 2012-02-22 7:44 ` Siddhesh Poyarekar 2012-02-29 13:55 ` Siddhesh Poyarekar 2012-02-21 21:39 ` [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct Jan Kratochvil 1 sibling, 2 replies; 70+ messages in thread From: Tom Tromey @ 2012-02-21 20:46 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches >>>>> "Siddhesh" == Siddhesh Poyarekar <siddhesh@redhat.com> writes: Siddhesh> If a struct member is at an offset greater than or equal to Siddhesh> 0x10000000, the resulting bit position within the struct Siddhesh> overflows and causes an invalid access. The following program Siddhesh> demonstrates this problem: Thanks for doing this. It is a long-needed fix. Siddhesh> This happens because the bitpos in field_location within the struct Siddhesh> main_type.field is declared as an int, limiting it to just 4 bytes. I Siddhesh> have attached a patch that expands this to LONGEST and adjusted this Siddhesh> change in the code. The testsuite does not report any regressions due Siddhesh> to this patch and it fixes the problem. I think this should fix http://sourceware.org/bugzilla/show_bug.cgi?id=7259. If so, at the top of the ChangeLog, write 'PR symtab/7259:'. If it does fix this PR then this suggests a simple test case that doesn't require a huge allocation. Most of the patch seems perfectly fine -- just the logical consequence of the core change. However there are a few issues, mostly minor. Siddhesh> printfi_filtered (spaces + 2, Siddhesh> - "[%d] bitpos %d bitsize %d type ", Siddhesh> + "[%d] bitpos %ld bitsize %d type ", Siddhesh> idx, TYPE_FIELD_BITPOS (type, idx), You can't really rely on the size of LONGEST. Instead you have to use %s and 'plongest'. There are a few instances of this in the patch. Siddhesh> diff --git a/gdb/value.c b/gdb/value.c Siddhesh> index 583be33..49a6f43 100644 Siddhesh> --- a/gdb/value.c Siddhesh> +++ b/gdb/value.c Siddhesh> @@ -308,7 +308,7 @@ struct value Siddhesh> `type', and `embedded_offset' is zero, so everything works Siddhesh> normally. */ Siddhesh> struct type *enclosing_type; Siddhesh> - int embedded_offset; Siddhesh> + LONGEST embedded_offset; Siddhesh> int pointed_to_offset; I think you also have to widen the 'offset' field, and probably also 'pointed_to_offset'. This will probably have other consequences, e.g., value_offset will have a different return type. Tom ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct 2012-02-21 20:46 ` Tom Tromey @ 2012-02-22 7:44 ` Siddhesh Poyarekar 2012-02-29 13:55 ` Siddhesh Poyarekar 1 sibling, 0 replies; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-02-22 7:44 UTC (permalink / raw) To: Tom Tromey; +Cc: gdb-patches, Jan Kratochvil On Tue, Feb 21, 2012 at 01:42:23PM -0700, Tom Tromey wrote: > I think this should fix http://sourceware.org/bugzilla/show_bug.cgi?id=7259. > If so, at the top of the ChangeLog, write 'PR symtab/7259:'. > > If it does fix this PR then this suggests a simple test case that > doesn't require a huge allocation. Yes, it does. I'll update the ChangeLog entry. > > Most of the patch seems perfectly fine -- just the logical consequence > of the core change. However there are a few issues, mostly minor. > Thanks for your feedback. I'll work on these and send an updated patch. On Tue, Feb 21, 2012 at 10:02:35PM +0100, Jan Kratochvil wrote: > On top of Tom's comments - have you verified you caught all the cases? > In these cases I use some > typedef struct { LONGEST x; } LONGESTT; > > which is compatible for assignment only with itself catching all the cases. > Unfortunately one needs to adjust by hand all the arithmetic operations just > for the purpose of this verification. > > I guess there exist better static analysis tools for that. > I relied mostly on manual code inspection for this and for gcc to tell me if something is getting truncated. I'll look for a more formal method to make sure I have caught all cases. Thanks, Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct 2012-02-21 20:46 ` Tom Tromey 2012-02-22 7:44 ` Siddhesh Poyarekar @ 2012-02-29 13:55 ` Siddhesh Poyarekar 2012-02-29 13:59 ` Siddhesh Poyarekar 2012-03-01 22:45 ` Jan Kratochvil 1 sibling, 2 replies; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-02-29 13:55 UTC (permalink / raw) To: Tom Tromey; +Cc: gdb-patches, Jan Kratochvil [-- Attachment #1: Type: text/plain, Size: 8557 bytes --] Hi, I have updated my patch with Tom and Jan's suggestions. In addition to that, ran splint on the sources to check if the changes introduced any new mismatched assignments or arguments. I did this iteratively, i.e.: 1. run splint 2. fix reported problems 3. repeat until no new warnings reported. I generated an output of splint without my changes to determine the baseline. I obviously fixed older problems that were related to this one too, so that the bitpos (and related offset) problems are fixed with this. For reference, the splint command I used with each source: splint -warnposix -Dsigjmp_buf=int -I. -I../../gdb/gdb \ -I../../gdb/gdb/common -I../../gdb/gdb/config \ -DLOCALEDIR="\"/home/siddhesh/sandbox/gdb-sandbox/share/locale\"" -DHAVE_CONFIG_H -I../../gdb/gdb/../include/opcode -I../../gdb/gdb/../opcodes/.. -I../../gdb/gdb/../readline/.. -I../bfd -I../../gdb/gdb/../bfd -I../../gdb/gdb/../include -I../libdecnumber -I../../gdb/gdb/../libdecnumber \ -I../../gdb/gdb/gnulib -Ignulib -DTUI=1 -I/usr/include/python2.7 -I/usr/include/python2.7 -I../../gdb-build/gdb $file There is one problem that still remains that I haven't fixed yet, which is the size of TYPE_FIELD. It is currently unsigned int, which is less than sizeof(bitpos) now. This looks wrong since bitpos is considered an offset within these types and it seems possible to have an offset larger than the total size right now. There are a couple of places where this comes into play, but fixing this in the same patch would mean another 2.5k lines in the patch. I can work on this on my free time later if not having it in this change is OK (and if my logic above makes sense of course). I have also added a test case to the testsuite. Regards, Siddhesh ChangeLog: 2012-02-29 Siddhesh Poyarekar <siddhesh@redhat.com> * gdbtypes.h (struct main_type.field.field_location): Expand bitpos to LONGEST. * value.h (value_primitive_field, val_print, set_value_offset): Adjust to accept LONGEST as offset. (set_value_pointed_to_offset, set_value_embedded_offset): Ditto. (value_bits_valid, value_bits_synthetic_pointer): Ditto. (value_bytes_available, mark_value_bytes_unavailable): Ditto. (value_available_contents_eq, unpack_value_bits_as_long): Ditto. (unpack_value_field_as_long, value_field_bitfield): Ditto. (value_contents_copy, value_contents_copy_raw, value_fn_field): Ditto. (value_find_oload_method_list, set_internalvar_component): Ditto. (value_pointed_to_offset, value_embedded_offset, value_offset): Ditto. (struct lval_funcs): Adjust signature of check_validity and check_synthetic_pointer. * value.c (modify_field, value_primitive_field, val_print): Expand offset to LONGEST. (value_bits_synthetic_pointer, value_bits_valid): Ditto. (unpack_value_bits_as_long_1, ranges_overlap, ranges_contain): Ditto. (value_bytes_available, mark_value_bytes_unavailable): Ditto. (find_first_range_overlap, value_available_contents_eq): Ditto. (set_value_offset, value_contents_copy_raw): Ditto. (value_contents_copy, value_contents_copy, value_bits_valid): Ditto. (value_bits_synthetic_pointer, set_value_embedded_offset): Ditto. (set_value_pointed_to_offset, set_internalvar_component): Ditto. (unpack_value_bits_as_long, unpack_value_field_as_long_1) (unpack_value_field_as_long, value_field_bitfield): Ditto. (unpack_value_bits_as_long_1): Explicitly cast downwards residual division results. (modify_field): Rename bitpos argument to LONGEST offset. Use bitpos to denote the bitfield offset. (struct value): Expand offset, embedded_offset and pointed_to_offset to LONGEST. (struct range): Expand offset to LONGEST. * valprint.c (val_print_scalar_formatted, val_print): Expand offset to LONGEST. (val_print_array_elements): Ditto. * valprint.h (val_print_scalar_formatted): Ditto. (val_print_array_elements): Ditto. * valops.c (search_struct_field, search_struct_method): Ditto. (value_struct_elt_for_reference, find_method_list): Ditto. (dynamic_cast_check_1, dynamic_cast_check_2, search_struct_field): Ditto. (search_struct_method, find_method_list): Ditto. (value_find_oload_method_list, value_struct_elt_for_reference): Ditto. (find_overload_match): Expand boffset to LONGEST. * regcache.h (regcache_cooked_read_part): Expand offset to LONGEST. (regcache_cooked_write_part): Ditto. * regcache.c (regcache_cooked_read_part): Ditto. (regcache_cooked_write_part, regcache_xfer_part): Ditto. * ax-gdb.c (gen_offset, gen_left_shift, gen_bitfield_ref):Ditto. (gen_primitive_field, gen_struct_ref_recursive): Ditto. * ada-lang.c (ada_value_primitive_packed_val): Ditto. (ada_value_primitive_field, find_struct_field): Ditto. (ada_search_struct_field, ada_template_to_fixed_record_type_1): Ditto. (ada_index_struct_field_1, ada_index_struct_field): Ditto. (align_value, cond_offset_host, cond_offset_target): Ditto. (fat_pntr_bounds_bitpos, fat_pntr_data_bitpos, desc_bound_bitpos): Return LONGEST. * p-lang.c (is_pascal_string_type): Expand offset to LONGEST. * opencl-lang.c (lval_func_read, lval_func_write): Store return of value_offset into LONGEST. (lval_func_check_validity): Expand offset to LONGEST. Explicit cast for residual division of LONGEST with int into int. (lval_func_check_synthetic_pointer): Ditto. * mips-tdep.c (mips_xfer_register): Adjust to accept LONGEST as offset. Adjust format specifier for bitpos. (mips_n32n64_fp_arg_chunk_p): Adjust to accept LONGEST as offset. (mips_n32n64_return_value): Store bitpos in LONGEST. * sparc64-tdep.c (sparc64_store_floating_fields): Adjust to accept LONGEST as bitpos. Explicit cast for regnum. (sparc64_extract_floating_fields): Ditto. * amd64-tdep.c (amd64_classify_aggregate): Expand pos and endpos to LONGEST. * gdbtypes.c (is_unique_ancestor_worker): Expand embedded_offset and offset to LONGEST. (recursive_dump_type): Adjust format specifier to print bitpos. * ada-typeprint.c (print_enum_type): Ditto. * c-typeprint.c (c_type_print_base): Ditto. * m2-typeprint.c (m2_enum): Ditto. * p-typeprint.c (pascal_type_print_base): Ditto. * language.h (struct language_defn): Adjust la_val_print to accept LONGEST as embedded_offset. * language.c (unk_lang_val_print): Adjust for change in la_val_print. * ada-lang.h (ada_val_print, ada_value_primitive_packed_val): Ditto. * ada-valprint.c (ada_val_print, ada_val_print_1): Ditto. (print_variant_part, print_field_values): Ditto. * c-lang.h (c_val_print, cp_print_value_fields): Ditto. (cp_print_value_fields_rtti): Ditto. * c-valprint.c (c_val_print): Ditto. * cp-valprint.c (cp_print_value, cp_print_value_fields): Ditto. (cp_print_value_fields_rtti, cp_print_value): Ditto. * d-lang.h (d_val_print): Ditto. * d-valprint.c (d_val_print): Ditto. * f-lang.h (f_val_print): Ditto. * f-valprint.c (f_val_print, f77_print_array_1, f77_print_array): Ditto. * jv-lang.h (java_val_print): Ditto. * jv-valprint.c (java_val_print, java_print_value_fields): Ditto. * m2-lang.h (m2_val_print): Ditto. * m2-valprint.c (m2_print_array_contents, m2_val_print):Ditto. (m2_print_unbounded_array, m2_print_array_contents): Ditto. (m2_print_long_set): Ditto. * p-lang.h (pascal_val_print, is_pascal_string_type): Ditto. (pascal_object_print_value_fields): Ditto. * p-valprint.c (pascal_val_print, pascal_object_print_value): Ditto. (pascal_object_print_value_fields): Ditto. * eval.c (evaluate_struct_tuple): Expand bitsize and bitpos to LONGEST. * python/py-prettyprint.c (apply_val_pretty_printer): Expand offset to LONGEST. * python/python.h (apply_val_pretty_printer): Ditto. * dwarf2loc.c (read_pieced_value, write_pieced_value): Explicit cast. (check_pieced_value_bits, check_pieced_value_validity): Expand offset to LONGEST. (check_pieced_synthetic_pointer): Ditto. * findvar.c (read_frame_register_value): Ditto. * cp-abi.c (baseclass_offset): Return LONGEST. (value_virtual_fn_field): Accept LONGEST as offset. * cp-abi.h (value_virtual_fn_field): Ditto. (baseclass_offset): Return LONGEST. (struct cp_abi_ops): Adjust signatures of baseclass_offset and virtual_fn_field. * gnu-v2-abi.c (gnuv2_virtual_fn_field): Expand offset to LONGEST. (gnuv2_baseclass_offset): Ditto. Return LONGEST. * gnu-v3-abi.c (gnuv3_virtual_fn_field): Expand offset to LONGEST. (vtable_address_point_offset, gnuv3_baseclass_offset): Return LONGEST. testsuite/ChangeLog: 2012-02-29 Siddhesh Poyarekar <siddhesh@redhat.com> * (gdb.base/structs4.c, gdb.base/structs4.exp): New test case. [-- Attachment #2: gdb-bitpos.patch --] [-- Type: text/plain, Size: 95565 bytes --] diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 107df93..f743db1 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -80,7 +80,7 @@ static struct type *desc_bounds_type (struct type *); static struct value *desc_bounds (struct value *); -static int fat_pntr_bounds_bitpos (struct type *); +static LONGEST fat_pntr_bounds_bitpos (struct type *); static int fat_pntr_bounds_bitsize (struct type *); @@ -88,13 +88,13 @@ static struct type *desc_data_target_type (struct type *); static struct value *desc_data (struct value *); -static int fat_pntr_data_bitpos (struct type *); +static LONGEST fat_pntr_data_bitpos (struct type *); static int fat_pntr_data_bitsize (struct type *); static struct value *desc_one_bound (struct value *, int, int); -static int desc_bound_bitpos (struct type *, int, int); +static LONGEST desc_bound_bitpos (struct type *, int, int); static int desc_bound_bitsize (struct type *, int, int); @@ -217,14 +217,14 @@ static struct value *value_val_atr (struct type *, struct value *); static struct symbol *standard_lookup (const char *, const struct block *, domain_enum); -static struct value *ada_search_struct_field (char *, struct value *, int, +static struct value *ada_search_struct_field (char *, struct value *, LONGEST, struct type *); -static struct value *ada_value_primitive_field (struct value *, int, int, +static struct value *ada_value_primitive_field (struct value *, LONGEST, int, struct type *); -static int find_struct_field (const char *, struct type *, int, - struct type **, int *, int *, int *, int *); +static int find_struct_field (const char *, struct type *, LONGEST, + struct type **, LONGEST *, int *, int *, int *); static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR, struct value *); @@ -240,7 +240,7 @@ static void ada_language_arch_info (struct gdbarch *, static void check_size (const struct type *); -static struct value *ada_index_struct_field (int, struct value *, int, +static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST, struct type *); static struct value *assign_aggregate (struct value *, struct value *, @@ -584,7 +584,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) } static const gdb_byte * -cond_offset_host (const gdb_byte *valaddr, long offset) +cond_offset_host (const gdb_byte *valaddr, LONGEST offset) { if (valaddr == NULL) return NULL; @@ -593,7 +593,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) } static CORE_ADDR -cond_offset_target (CORE_ADDR address, long offset) +cond_offset_target (CORE_ADDR address, LONGEST offset) { if (address == 0) return 0; @@ -1559,7 +1559,7 @@ desc_bounds (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the bounds data. */ -static int +static LONGEST fat_pntr_bounds_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 1); @@ -1625,7 +1625,7 @@ desc_data (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the data. */ -static int +static LONGEST fat_pntr_data_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 0); @@ -1660,7 +1660,7 @@ desc_one_bound (struct value *bounds, int i, int which) of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper bound, if WHICH is 1. The first bound is I=1. */ -static int +static LONGEST desc_bound_bitpos (struct type *type, int i, int which) { return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); @@ -2218,7 +2218,7 @@ has_negatives (struct type *type) struct value * ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, - long offset, int bit_offset, int bit_size, + LONGEST offset, int bit_offset, int bit_size, struct type *type) { struct value *v; @@ -5950,7 +5950,7 @@ value_tag_from_contents_and_address (struct type *type, const gdb_byte *valaddr, CORE_ADDR address) { - int tag_byte_offset; + LONGEST tag_byte_offset; struct type *tag_type; if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, @@ -6328,7 +6328,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) only in that it can handle packed values of arbitrary type. */ static struct value * -ada_value_primitive_field (struct value *arg1, int offset, int fieldno, +ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type) { struct type *type; @@ -6340,12 +6340,13 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) { - int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); + LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); return ada_value_primitive_packed_val (arg1, value_contents (arg1), offset + bit_pos / 8, - bit_pos % 8, bit_size, type); + (int)(bit_pos % 8), bit_size, + type); } else return value_primitive_field (arg1, offset, fieldno, arg_type); @@ -6367,9 +6368,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, Returns 1 if found, 0 otherwise. */ static int -find_struct_field (const char *name, struct type *type, int offset, +find_struct_field (const char *name, struct type *type, LONGEST offset, struct type **field_type_p, - int *byte_offset_p, int *bit_offset_p, int *bit_size_p, + LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p, int *index_p) { int i; @@ -6387,8 +6388,8 @@ find_struct_field (const char *name, struct type *type, int offset, for (i = 0; i < TYPE_NFIELDS (type); i += 1) { - int bit_pos = TYPE_FIELD_BITPOS (type, i); - int fld_offset = offset + bit_pos / 8; + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); + LONGEST fld_offset = offset + bit_pos / 8; const char *t_field_name = TYPE_FIELD_NAME (type, i); if (t_field_name == NULL) @@ -6403,7 +6404,7 @@ find_struct_field (const char *name, struct type *type, int offset, if (byte_offset_p != NULL) *byte_offset_p = fld_offset; if (bit_offset_p != NULL) - *bit_offset_p = bit_pos % 8; + *bit_offset_p = (int)(bit_pos % 8); if (bit_size_p != NULL) *bit_size_p = bit_size; return 1; @@ -6458,7 +6459,7 @@ num_visible_fields (struct type *type) Searches recursively through wrapper fields (e.g., '_parent'). */ static struct value * -ada_search_struct_field (char *name, struct value *arg, int offset, +ada_search_struct_field (char *name, struct value *arg, LONGEST offset, struct type *type) { int i; @@ -6491,7 +6492,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset, int j; struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i)); - int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; + LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) { @@ -6509,8 +6510,8 @@ ada_search_struct_field (char *name, struct value *arg, int offset, return NULL; } -static struct value *ada_index_struct_field_1 (int *, struct value *, - int, struct type *); +static struct value *ada_index_struct_field_1 (LONGEST *, struct value *, + LONGEST, struct type *); /* Return field #INDEX in ARG, where the index is that returned by @@ -6519,7 +6520,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, * If found, return value, else return NULL. */ static struct value * -ada_index_struct_field (int index, struct value *arg, int offset, +ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset, struct type *type) { return ada_index_struct_field_1 (&index, arg, offset, type); @@ -6531,7 +6532,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, * *INDEX_P. */ static struct value * -ada_index_struct_field_1 (int *index_p, struct value *arg, int offset, +ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset, struct type *type) { int i; @@ -6621,7 +6622,8 @@ ada_value_struct_elt (struct value *arg, char *name, int no_err) v = ada_search_struct_field (name, arg, 0, t); else { - int bit_offset, bit_size, byte_offset; + int bit_offset, bit_size; + LONGEST byte_offset; struct type *field_type; CORE_ADDR address; @@ -6929,7 +6931,7 @@ ada_coerce_ref (struct value *val0) ALIGNMENT (a power of 2). */ static unsigned int -align_value (unsigned int off, unsigned int alignment) +align_value (LONGEST off, unsigned int alignment) { return (off + alignment - 1) & ~(alignment - 1); } @@ -7303,9 +7305,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, struct value *mark = value_mark (); struct value *dval; struct type *rtype; - int nfields, bit_len; + int nfields; int variant_field; - long off; + LONGEST off, bit_len; int fld_bit_len; int f; @@ -7377,7 +7379,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, that follow this one. */ if (ada_is_aligner_type (field_type)) { - long field_offset = TYPE_FIELD_BITPOS (field_type, f); + LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f); field_valaddr = cond_offset_host (field_valaddr, field_offset); field_address = cond_offset_target (field_address, field_offset); diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index 2a6cd57..d79a2ba 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -164,7 +164,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int, extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream); -extern int ada_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern int ada_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -249,7 +249,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); extern struct value *ada_value_primitive_packed_val (struct value *, const gdb_byte *, - long, int, int, + LONGEST, int, int, struct type *); extern struct type *ada_coerce_to_simple_array_type (struct type *); diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index 5599278..de3ed5fa 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -274,7 +274,8 @@ static void print_enum_type (struct type *type, struct ui_file *stream) { int len = TYPE_NFIELDS (type); - int i, lastval; + LONGEST lastval; + int i; fprintf_filtered (stream, "("); wrap_here (" "); @@ -289,7 +290,7 @@ print_enum_type (struct type *type, struct ui_file *stream) fputs_filtered (ada_enum_name (TYPE_FIELD_NAME (type, i)), stream); if (lastval != TYPE_FIELD_BITPOS (type, i)) { - fprintf_filtered (stream, " => %d", TYPE_FIELD_BITPOS (type, i)); + fprintf_filtered (stream, " => %s", plongest(TYPE_FIELD_BITPOS (type, i))); lastval = TYPE_FIELD_BITPOS (type, i); } lastval += 1; diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index f43f3e3..1f01260 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -42,15 +42,15 @@ static void print_record (struct type *, const gdb_byte *, int, const struct value_print_options *); static int print_field_values (struct type *, const gdb_byte *, - int, + LONGEST, struct ui_file *, int, const struct value *, const struct value_print_options *, - int, struct type *, int); + int, struct type *, LONGEST); static void adjust_type_signedness (struct type *); -static int ada_val_print_1 (struct type *, const gdb_byte *, int, CORE_ADDR, +static int ada_val_print_1 (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -571,7 +571,7 @@ ada_printstr (struct ui_file *stream, struct type *type, int ada_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) @@ -667,7 +667,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, static int ada_val_print_1 (struct type *type, const gdb_byte *valaddr, - int offset, CORE_ADDR address, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -936,12 +936,12 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, static int print_variant_part (struct type *type, int field_num, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int comma_needed, - struct type *outer_type, int outer_offset) + struct type *outer_type, LONGEST outer_offset) { struct type *var_type = TYPE_FIELD_TYPE (type, field_num); int which = ada_which_variant_applies (var_type, outer_type, @@ -1048,11 +1048,11 @@ print_record (struct type *type, const gdb_byte *valaddr, static int print_field_values (struct type *type, const gdb_byte *valaddr, - int offset, struct ui_file *stream, int recurse, + LONGEST offset, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int comma_needed, - struct type *outer_type, int outer_offset) + struct type *outer_type, LONGEST outer_offset) { int i, len; @@ -1133,7 +1133,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, } else { - int bit_pos = TYPE_FIELD_BITPOS (type, i); + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); int bit_size = TYPE_FIELD_BITSIZE (type, i); struct value_print_options opts; @@ -1141,7 +1141,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, v = ada_value_primitive_packed_val (NULL, valaddr, offset + bit_pos / HOST_CHAR_BIT, - bit_pos % HOST_CHAR_BIT, + (int)(bit_pos % HOST_CHAR_BIT), bit_size, TYPE_FIELD_TYPE (type, i)); opts = *options; opts.deref_ref = 0; diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index ea65d0d..d52205f 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -482,10 +482,10 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int pos = TYPE_FIELD_BITPOS (type, i) / 64; + LONGEST pos = TYPE_FIELD_BITPOS (type, i) / 64; enum amd64_reg_class subclass[2]; int bitsize = TYPE_FIELD_BITSIZE (type, i); - int endpos; + LONGEST endpos; if (bitsize == 0) bitsize = TYPE_LENGTH (subtype) * 8; diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 739677f..8eff381 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -80,12 +80,12 @@ static void gen_traced_pop (struct gdbarch *, struct agent_expr *, static void gen_sign_extend (struct agent_expr *, struct type *); static void gen_extend (struct agent_expr *, struct type *); static void gen_fetch (struct agent_expr *, struct type *); -static void gen_left_shift (struct agent_expr *, int); +static void gen_left_shift (struct agent_expr *, LONGEST); static void gen_frame_args_address (struct gdbarch *, struct agent_expr *); static void gen_frame_locals_address (struct gdbarch *, struct agent_expr *); -static void gen_offset (struct agent_expr *ax, int offset); +static void gen_offset (struct agent_expr *ax, LONGEST offset); static void gen_sym_offset (struct agent_expr *, struct symbol *); static void gen_var_ref (struct gdbarch *, struct agent_expr *ax, struct axs_value *value, struct symbol *var); @@ -135,15 +135,15 @@ static void gen_deref (struct agent_expr *, struct axs_value *); static void gen_address_of (struct agent_expr *, struct axs_value *); static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - struct type *type, int start, int end); + struct type *type, LONGEST start, LONGEST end); static void gen_primitive_field (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - int offset, int fieldno, struct type *type); + LONGEST offset, int fieldno, struct type *type); static int gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - char *field, int offset, + char *field, LONGEST offset, struct type *type); static void gen_struct_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -567,7 +567,7 @@ gen_fetch (struct agent_expr *ax, struct type *type) right shift it by -DISTANCE bits if DISTANCE < 0. This generates unsigned (logical) right shifts. */ static void -gen_left_shift (struct agent_expr *ax, int distance) +gen_left_shift (struct agent_expr *ax, LONGEST distance) { if (distance > 0) { @@ -621,7 +621,7 @@ gen_frame_locals_address (struct gdbarch *gdbarch, struct agent_expr *ax) programming in ML, it would be clearer why these are the same thing. */ static void -gen_offset (struct agent_expr *ax, int offset) +gen_offset (struct agent_expr *ax, LONGEST offset) { /* It would suffice to simply push the offset and add it, but this makes it easier to read positive and negative offsets in the @@ -1283,7 +1283,7 @@ gen_address_of (struct agent_expr *ax, struct axs_value *value) static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *type, - int start, int end) + LONGEST start, LONGEST end) { /* Note that ops[i] fetches 8 << i bits. */ static enum agent_op ops[] @@ -1318,13 +1318,13 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, /* The first and one-after-last bits in the field, but rounded down and up to byte boundaries. */ - int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; - int bound_end = (((end + TARGET_CHAR_BIT - 1) - / TARGET_CHAR_BIT) - * TARGET_CHAR_BIT); + LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; + LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1) + / TARGET_CHAR_BIT) + * TARGET_CHAR_BIT); /* current bit offset within the structure */ - int offset; + LONGEST offset; /* The index in ops of the opcode we're considering. */ int op; @@ -1428,7 +1428,7 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, ax_simple (ax, aop_bit_or); /* Sign- or zero-extend the value as appropriate. */ - ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, end - start)); + ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, (int)(end - start))); /* This is *not* an lvalue. Ugh. */ value->kind = axs_rvalue; @@ -1443,7 +1443,7 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, static void gen_primitive_field (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - int offset, int fieldno, struct type *type) + LONGEST offset, int fieldno, struct type *type) { /* Is this a bitfield? */ if (TYPE_FIELD_PACKED (type, fieldno)) @@ -1468,7 +1468,7 @@ gen_primitive_field (struct expression *exp, static int gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - char *field, int offset, struct type *type) + char *field, LONGEST offset, struct type *type) { int i, rslt; int nbases = TYPE_N_BASECLASSES (type); diff --git a/gdb/c-lang.h b/gdb/c-lang.h index e8c632f..7fc6f61 100644 --- a/gdb/c-lang.h +++ b/gdb/c-lang.h @@ -72,7 +72,7 @@ extern void c_print_typedef (struct type *, struct ui_file *); extern int c_val_print (struct type *, const gdb_byte *, - int, CORE_ADDR, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -118,14 +118,14 @@ extern void cp_print_class_member (const gdb_byte *, struct type *, struct ui_file *, char *); extern void cp_print_value_fields (struct type *, struct type *, - const gdb_byte *, int, CORE_ADDR, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, struct type **, int); extern void cp_print_value_fields_rtti (struct type *, - const gdb_byte *, int, CORE_ADDR, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 21887c6..7a0f7e9 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -717,7 +717,7 @@ c_type_print_base (struct type *type, struct ui_file *stream, { int i; int len, real_len; - int lastval; + LONGEST lastval; enum { s_none, s_public, s_private, s_protected @@ -1206,8 +1206,8 @@ c_type_print_base (struct type *type, struct ui_file *stream, fputs_filtered (TYPE_FIELD_NAME (type, i), stream); if (lastval != TYPE_FIELD_BITPOS (type, i)) { - fprintf_filtered (stream, " = %d", - TYPE_FIELD_BITPOS (type, i)); + fprintf_filtered (stream, " = %s", + plongest(TYPE_FIELD_BITPOS (type, i))); lastval = TYPE_FIELD_BITPOS (type, i); } lastval++; diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 82551e9..f034a88 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -147,7 +147,7 @@ c_textual_element_type (struct type *type, char format) int c_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -416,7 +416,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, /* Print vtable entry - we only get here if NOT using -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ - int offset = (embedded_offset + LONGEST offset = (embedded_offset + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8); struct type *field_type = TYPE_FIELD_TYPE (type, diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c index e949088..c7afcd0 100644 --- a/gdb/cp-abi.c +++ b/gdb/cp-abi.c @@ -68,13 +68,13 @@ is_operator_name (const char *name) return (*current_cp_abi.is_operator_name) (name); } -int +LONGEST baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { volatile struct gdb_exception ex; - int res = 0; + LONGEST res = 0; gdb_assert (current_cp_abi.baseclass_offset != NULL); @@ -98,7 +98,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, struct value * value_virtual_fn_field (struct value **arg1p, struct fn_field *f, int j, - struct type *type, int offset) + struct type *type, LONGEST offset) { if ((current_cp_abi.virtual_fn_field) == NULL) return NULL; diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h index 0f24e9a..6e6c26e 100644 --- a/gdb/cp-abi.h +++ b/gdb/cp-abi.h @@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, struct fn_field *f, int j, struct type *type, - int offset); + LONGEST offset); /* Try to find the run-time type of VALUE, using C++ run-time type @@ -144,9 +144,9 @@ extern struct type *value_rtti_type (struct value *value, contents of VAL. The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. */ -extern int baseclass_offset (struct type *type, +extern LONGEST baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, const struct value *val); @@ -199,11 +199,11 @@ struct cp_abi_ops struct value *(*virtual_fn_field) (struct value **arg1p, struct fn_field * f, int j, struct type * type, - int offset); + LONGEST offset); struct type *(*rtti_type) (struct value *v, int *full, int *top, int *using_enc); - int (*baseclass_offset) (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, + LONGEST (*baseclass_offset) (struct type *type, int index, + const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val); void (*print_method_ptr) (const gdb_byte *contents, struct type *type, diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 1697006..563f759 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -82,7 +82,7 @@ static void cp_print_static_field (struct type *, struct value *, const struct value_print_options *); static void cp_print_value (struct type *, struct type *, - const gdb_byte *, int, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -156,7 +156,7 @@ cp_is_vtbl_member (struct type *type) void cp_print_value_fields (struct type *type, struct type *real_type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -428,7 +428,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, void cp_print_value_fields_rtti (struct type *type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -468,7 +468,7 @@ cp_print_value_fields_rtti (struct type *type, static void cp_print_value (struct type *type, struct type *real_type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -478,7 +478,7 @@ cp_print_value (struct type *type, struct type *real_type, = (struct type **) obstack_next_free (&dont_print_vb_obstack); struct obstack tmp_obstack = dont_print_vb_obstack; int i, n_baseclasses = TYPE_N_BASECLASSES (type); - int thisoffset; + LONGEST thisoffset; struct type *thistype; if (dont_print_vb == 0) @@ -492,7 +492,7 @@ cp_print_value (struct type *type, struct type *real_type, for (i = 0; i < n_baseclasses; i++) { - int boffset = 0; + LONGEST boffset = 0; int skip; struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); const char *basename = TYPE_NAME (baseclass); diff --git a/gdb/d-lang.h b/gdb/d-lang.h index 67ca14c..e2cda03 100644 --- a/gdb/d-lang.h +++ b/gdb/d-lang.h @@ -25,7 +25,7 @@ extern char *d_demangle (const char *mangled, int options); extern int d_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c index 527c087..813e9ee 100644 --- a/gdb/d-valprint.c +++ b/gdb/d-valprint.c @@ -29,7 +29,7 @@ a dynamic array. */ static int dynamic_array_type (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) @@ -70,7 +70,7 @@ dynamic_array_type (struct type *type, const gdb_byte *valaddr, /* Implements the la_val_print routine for language D. */ int -d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +d_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 313df7b..9415300 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -1391,7 +1391,7 @@ read_pieced_value (struct value *v) cleanup = make_cleanup (free_current_contents, &buffer); contents = value_contents_raw (v); - bits_to_skip = 8 * value_offset (v); + bits_to_skip = (ULONGEST)(8 * value_offset (v)); if (value_bitsize (v)) { bits_to_skip += value_bitpos (v); @@ -1575,7 +1575,7 @@ write_pieced_value (struct value *to, struct value *from) cleanup = make_cleanup (free_current_contents, &buffer); contents = value_contents (from); - bits_to_skip = 8 * value_offset (to); + bits_to_skip = (ULONGEST)(8 * value_offset (to)); if (value_bitsize (to)) { bits_to_skip += value_bitpos (to); @@ -1717,7 +1717,7 @@ write_pieced_value (struct value *to, struct value *from) implicit pointer. */ static int -check_pieced_value_bits (const struct value *value, int bit_offset, +check_pieced_value_bits (const struct value *value, LONGEST bit_offset, int bit_length, enum dwarf_value_location check_for) { @@ -1772,7 +1772,7 @@ check_pieced_value_bits (const struct value *value, int bit_offset, } static int -check_pieced_value_validity (const struct value *value, int bit_offset, +check_pieced_value_validity (const struct value *value, LONGEST bit_offset, int bit_length) { return check_pieced_value_bits (value, bit_offset, bit_length, @@ -1791,7 +1791,7 @@ check_pieced_value_invalid (const struct value *value) a synthetic pointer. */ static int -check_pieced_synthetic_pointer (const struct value *value, int bit_offset, +check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, int bit_length) { return check_pieced_value_bits (value, bit_offset, bit_length, @@ -1817,9 +1817,9 @@ indirect_pieced_value (struct value *value) struct type *type; struct frame_info *frame; struct dwarf2_locexpr_baton baton; - int i, bit_offset, bit_length; + int i, bit_length; struct dwarf_expr_piece *piece = NULL; - LONGEST byte_offset; + LONGEST byte_offset, bit_offset; type = check_typedef (value_type (value)); if (TYPE_CODE (type) != TYPE_CODE_PTR) diff --git a/gdb/eval.c b/gdb/eval.c index 9913a72..0922596 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -319,7 +319,8 @@ evaluate_struct_tuple (struct value *struct_val, int pc = *pos; struct value *val = NULL; int nlabels = 0; - int bitpos, bitsize; + int bitsize; + LONGEST bitpos; bfd_byte *addr; /* Skip past the labels, and count them. */ diff --git a/gdb/f-lang.h b/gdb/f-lang.h index 4e5563d..e6407b7 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h @@ -28,7 +28,7 @@ extern void f_error (char *); /* Defined in f-exp.y */ extern void f_print_type (struct type *, const char *, struct ui_file *, int, int); -extern int f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern int f_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 17f747f..6c30cfd 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -164,7 +164,7 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) static void f77_print_array_1 (int nss, int ndimensions, struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -215,7 +215,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, static void f77_print_array (struct type *type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -247,7 +247,7 @@ Type node corrupt! F77 arrays cannot have %d subscripts (%d Max)"), also identical to val_print. */ int -f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +f_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -498,7 +498,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, fprintf_filtered (stream, "( "); for (index = 0; index < TYPE_NFIELDS (type); index++) { - int offset = TYPE_FIELD_BITPOS (type, index) / 8; + LONGEST offset = TYPE_FIELD_BITPOS (type, index) / 8; val_print (TYPE_FIELD_TYPE (type, index), valaddr, embedded_offset + offset, diff --git a/gdb/findvar.c b/gdb/findvar.c index 79c4221..4ae70b3 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -631,7 +631,7 @@ void read_frame_register_value (struct value *value, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); - int offset = 0; + LONGEST offset = 0; int reg_offset = value_offset (value); int regnum = VALUE_REGNUM (value); int len = TYPE_LENGTH (check_typedef (value_type (value))); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index b6e8b4c..60a9f23 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -2137,8 +2137,8 @@ is_public_ancestor (struct type *base, struct type *dclass) static int is_unique_ancestor_worker (struct type *base, struct type *dclass, - int *offset, - const gdb_byte *valaddr, int embedded_offset, + LONGEST *offset, + const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct value *val) { int i, count = 0; @@ -2149,7 +2149,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) { struct type *iter; - int this_offset; + LONGEST this_offset; iter = check_typedef (TYPE_BASECLASS (dclass, i)); @@ -2190,7 +2190,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, int is_unique_ancestor (struct type *base, struct value *val) { - int offset = -1; + LONGEST offset = -1; return is_unique_ancestor_worker (base, value_type (val), &offset, value_contents_for_printing (val), @@ -3198,8 +3198,8 @@ recursive_dump_type (struct type *type, int spaces) for (idx = 0; idx < TYPE_NFIELDS (type); idx++) { printfi_filtered (spaces + 2, - "[%d] bitpos %d bitsize %d type ", - idx, TYPE_FIELD_BITPOS (type, idx), + "[%d] bitpos %s bitsize %d type ", + idx, plongest(TYPE_FIELD_BITPOS (type, idx)), TYPE_FIELD_BITSIZE (type, idx)); gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); printf_filtered (" name '%s' (", diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index cddd2d0..3f4e849 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -514,7 +514,7 @@ struct main_type the LSB. For a range bound or enum value, this is the value itself. */ - int bitpos; + LONGEST bitpos; /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr is the location (in the target) of the static field. diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index e635e8f..6312a10 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -86,7 +86,7 @@ gnuv2_is_operator_name (const char *name) TYPE is the type in which F is located. */ static struct value * gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, - struct type * type, int offset) + struct type * type, LONGEST offset) { struct value *arg1 = *arg1p; struct type *type1 = check_typedef (value_type (arg1)); @@ -342,9 +342,9 @@ vb_match (struct type *type, int index, struct type *basetype) target). The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. */ -static int +static LONGEST gnuv2_baseclass_offset (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, + const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { struct type *basetype = TYPE_BASECLASS (type, index); @@ -362,7 +362,7 @@ gnuv2_baseclass_offset (struct type *type, int index, if (vb_match (type, i, basetype)) { struct type *field_type; - int field_offset; + LONGEST field_offset; int field_length; CORE_ADDR addr; @@ -387,7 +387,7 @@ gnuv2_baseclass_offset (struct type *type, int index, /* Don't go through baseclass_offset, as that wraps exceptions, thus, inner exceptions would be wrapped more than once. */ - int boffset = + LONGEST boffset = gnuv2_baseclass_offset (type, i, valaddr, embedded_offset, address, val); diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index f015af6..afd404c 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -180,7 +180,7 @@ vtable_ptrdiff_type (struct gdbarch *gdbarch) /* Return the offset from the start of the imaginary `struct gdb_gnu_v3_abi_vtable' object to the vtable's "address point" (i.e., where objects' virtual table pointers point). */ -static int +static LONGEST vtable_address_point_offset (struct gdbarch *gdbarch) { struct type *vtable_type = gdbarch_data (gdbarch, vtable_type_gdbarch_data); @@ -383,7 +383,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, static struct value * gnuv3_virtual_fn_field (struct value **value_p, struct fn_field *f, int j, - struct type *vfn_base, int offset) + struct type *vfn_base, LONGEST offset) { struct type *values_type = check_typedef (value_type (*value_p)); struct gdbarch *gdbarch; @@ -413,16 +413,16 @@ gnuv3_virtual_fn_field (struct value **value_p, -1 is returned on error. */ -static int +static LONGEST gnuv3_baseclass_offset (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, + const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { struct gdbarch *gdbarch; struct type *ptr_type; struct value *vtable; struct value *vbase_array; - long int cur_base_offset, base_offset; + LONGEST cur_base_offset, base_offset; /* Determine architecture. */ gdbarch = get_type_arch (type); @@ -489,7 +489,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, we're out of luck. */ for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) { - int pos; + LONGEST pos; struct type *basetype; if (BASETYPE_VIA_VIRTUAL (domain, i)) diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index 18a7c19..9323c0b 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -438,7 +438,7 @@ java_link_class_type (struct gdbarch *gdbarch, for (i = TYPE_N_BASECLASSES (type); i < nfields; i++) { int accflags; - int boffset; + LONGEST boffset; if (fields == NULL) { diff --git a/gdb/jv-lang.h b/gdb/jv-lang.h index d061096..4380a42 100644 --- a/gdb/jv-lang.h +++ b/gdb/jv-lang.h @@ -42,7 +42,7 @@ struct builtin_java_type extern const struct builtin_java_type *builtin_java_type (struct gdbarch *); -extern int java_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern int java_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index d430ba0..914d871 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -261,7 +261,7 @@ java_value_print (struct value *val, struct ui_file *stream, static void java_print_value_fields (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -480,7 +480,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, int java_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) diff --git a/gdb/language.c b/gdb/language.c index 49ba21a..1850880 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -849,7 +849,7 @@ unk_lang_print_type (struct type *type, const char *varstring, static int unk_lang_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) diff --git a/gdb/language.h b/gdb/language.h index a47a44d..c20c581 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -242,7 +242,7 @@ struct language_defn int (*la_val_print) (struct type *type, const gdb_byte *contents, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h index 2803e63..865e8fb 100644 --- a/gdb/m2-lang.h +++ b/gdb/m2-lang.h @@ -32,7 +32,7 @@ extern void m2_print_typedef (struct type *, struct symbol *, extern int m2_is_long_set (struct type *type); extern int m2_is_unbounded_array (struct type *type); -extern int m2_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern int m2_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index 9735d7f..26615b0 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -587,7 +587,8 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show, void m2_enum (struct type *type, struct ui_file *stream, int show, int level) { - int lastval, i, len; + LONGEST lastval; + int i, len; if (show < 0) { @@ -609,7 +610,8 @@ m2_enum (struct type *type, struct ui_file *stream, int show, int level) fputs_filtered (TYPE_FIELD_NAME (type, i), stream); if (lastval != TYPE_FIELD_BITPOS (type, i)) { - fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i)); + fprintf_filtered (stream, " = %s", + plongest(TYPE_FIELD_BITPOS (type, i))); lastval = TYPE_FIELD_BITPOS (type, i); } lastval++; diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c index 4378b00..4a7977f 100644 --- a/gdb/m2-valprint.c +++ b/gdb/m2-valprint.c @@ -36,7 +36,7 @@ static int print_unpacked_pointer (struct type *type, struct ui_file *stream); static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -89,7 +89,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high) static void m2_print_long_set (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream) { int empty_set = 1; @@ -180,7 +180,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr, static void m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value_print_options *options) { @@ -277,7 +277,7 @@ print_variable_at_address (struct type *type, static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -315,7 +315,7 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr, also identical to val_print. */ int -m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +m2_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index a670cd3..a09d19a 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -289,7 +289,7 @@ static void mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, int reg_num, int length, enum bfd_endian endian, gdb_byte *in, - const gdb_byte *out, int buf_offset) + const gdb_byte *out, LONGEST buf_offset) { int reg_offset = 0; @@ -312,8 +312,8 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, } if (mips_debug) fprintf_unfiltered (gdb_stderr, - "xfer $%d, reg offset %d, buf offset %d, length %d, ", - reg_num, reg_offset, buf_offset, length); + "xfer $%d, reg offset %d, buf offset %s, length %d, ", + reg_num, reg_offset, plongest(buf_offset), length); if (mips_debug && out != NULL) { int i; @@ -3221,7 +3221,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct type *func_type, static int mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, - int offset) + LONGEST offset) { int i; @@ -3236,7 +3236,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, for (i = 0; i < TYPE_NFIELDS (arg_type); i++) { - int pos; + LONGEST pos; struct type *field_type; /* We're only looking at normal fields. */ @@ -3630,11 +3630,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type, : MIPS_V0_REGNUM); field < TYPE_NFIELDS (type); field++, regnum += 2) { - int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) + LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) / TARGET_CHAR_BIT); if (mips_debug) - fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", - offset); + fprintf_unfiltered (gdb_stderr, "Return float struct+%s\n", + plongest(offset)); if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) { /* A 16-byte long double field goes in two consecutive diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index 80f978c..dffc7a4 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -174,9 +174,9 @@ lval_func_read (struct value *v) struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); struct type *type = check_typedef (value_type (v)); struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); - int offset = value_offset (v); + LONGEST offset = value_offset (v); int elsize = TYPE_LENGTH (eltype); - int n, i, j = 0; + LONGEST n, i, j = 0; LONGEST lowb = 0; LONGEST highb = 0; @@ -203,9 +203,9 @@ lval_func_write (struct value *v, struct value *fromval) struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); struct type *type = check_typedef (value_type (v)); struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); - int offset = value_offset (v); + LONGEST offset = value_offset (v); int elsize = TYPE_LENGTH (eltype); - int n, i, j = 0; + LONGEST n, i, j = 0; LONGEST lowb = 0; LONGEST highb = 0; @@ -243,17 +243,17 @@ lval_func_write (struct value *v, struct value *fromval) /* Return nonzero if all bits in V within OFFSET and LENGTH are valid. */ static int -lval_func_check_validity (const struct value *v, int offset, int length) +lval_func_check_validity (const struct value *v, LONGEST offset, int length) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); /* Size of the target type in bits. */ int elsize = TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; - int startrest = offset % elsize; - int start = offset / elsize; - int endrest = (offset + length) % elsize; - int end = (offset + length) / elsize; - int i; + int startrest = (int)(offset % elsize); + LONGEST start = offset / elsize; + int endrest = (int)((offset + length) % elsize); + LONGEST end = (offset + length) / elsize; + LONGEST i; if (endrest) end++; @@ -297,17 +297,17 @@ lval_func_check_any_valid (const struct value *v) static int lval_func_check_synthetic_pointer (const struct value *v, - int offset, int length) + LONGEST offset, int length) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); /* Size of the target type in bits. */ int elsize = TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; - int startrest = offset % elsize; - int start = offset / elsize; - int endrest = (offset + length) % elsize; - int end = (offset + length) / elsize; - int i; + int startrest = (int)(offset % elsize); + LONGEST start = offset / elsize; + int endrest = (int)((offset + length) % elsize); + LONGEST end = (offset + length) / elsize; + LONGEST i; if (endrest) end++; diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 826d24f..80c1c68 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -96,8 +96,8 @@ pascal_main_name (void) are not multiple of TARGET_CHAR_BIT then the results are wrong but this does not happen for Free Pascal nor for GPC. */ int -is_pascal_string_type (struct type *type,int *length_pos, - int *length_size, int *string_pos, +is_pascal_string_type (struct type *type,LONGEST *length_pos, + int *length_size, LONGEST *string_pos, struct type **char_type, const char **arrayname) { diff --git a/gdb/p-lang.h b/gdb/p-lang.h index 180c544..2627aa4 100644 --- a/gdb/p-lang.h +++ b/gdb/p-lang.h @@ -35,7 +35,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *, extern void pascal_print_typedef (struct type *, struct symbol *, struct ui_file *); -extern int pascal_val_print (struct type *, const gdb_byte *, int, +extern int pascal_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -49,7 +49,7 @@ extern void pascal_type_print_method_args (const char *, const char *, /* These are in p-lang.c: */ extern int - is_pascal_string_type (struct type *, int *, int *, int *, + is_pascal_string_type (struct type *, LONGEST *, int *, LONGEST *, struct type **, const char **); extern void pascal_printchar (int, struct type *, struct ui_file *); @@ -69,7 +69,7 @@ extern void pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int); extern void pascal_object_print_value_fields (struct type *, const gdb_byte *, - int, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index ab82d90..b97c7e9 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -443,7 +443,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, { int i; int len; - int lastval; + LONGEST lastval; enum { s_none, s_public, s_private, s_protected @@ -754,7 +754,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, if (lastval != TYPE_FIELD_BITPOS (type, i)) { fprintf_filtered (stream, - " := %d", TYPE_FIELD_BITPOS (type, i)); + " := %s", + plongest(TYPE_FIELD_BITPOS (type, i))); lastval = TYPE_FIELD_BITPOS (type, i); } lastval++; diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 39eff10..aa75095 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -47,7 +47,7 @@ int pascal_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -59,7 +59,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, LONGEST low_bound, high_bound; struct type *elttype; unsigned eltlen; - int length_pos, length_size, string_pos; + LONGEST length_pos, string_pos; + int length_size; struct type *char_type; LONGEST val; CORE_ADDR addr; @@ -70,7 +71,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, case TYPE_CODE_ARRAY: if (get_array_bounds (type, &low_bound, &high_bound)) { - len = high_bound - low_bound + 1; + len = (unsigned int)(high_bound - low_bound + 1); elttype = check_typedef (TYPE_TARGET_TYPE (type)); eltlen = TYPE_LENGTH (elttype); if (options->prettyprint_arrays) @@ -633,7 +634,7 @@ static void pascal_object_print_static_field (struct value *, const struct value_print_options *); static void pascal_object_print_value (struct type *, const gdb_byte *, - int, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -692,7 +693,7 @@ pascal_object_is_vtbl_member (struct type *type) void pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -887,7 +888,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, static void pascal_object_print_value (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -910,11 +911,11 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr, for (i = 0; i < n_baseclasses; i++) { - int boffset = 0; + LONGEST boffset = 0; struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); const char *basename = type_name_no_tag (baseclass); const gdb_byte *base_valaddr = NULL; - int thisoffset; + LONGEST thisoffset; volatile struct gdb_exception ex; int skip = 0; diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index 86d4f2c..1ceb23b 100644 --- a/gdb/python/py-prettyprint.c +++ b/gdb/python/py-prettyprint.c @@ -676,7 +676,7 @@ print_children (PyObject *printer, const char *hint, int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -824,7 +824,7 @@ gdbpy_default_visualizer (PyObject *self, PyObject *args) int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, diff --git a/gdb/python/python.h b/gdb/python/python.h index 597ed2e..476299b 100644 --- a/gdb/python/python.h +++ b/gdb/python/python.h @@ -33,7 +33,7 @@ void eval_python_from_control_command (struct command_line *); void source_python_script (FILE *file, const char *filename); int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, diff --git a/gdb/regcache.c b/gdb/regcache.c index c716280..12ed8fa 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -902,7 +902,7 @@ typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum, static enum register_status regcache_xfer_part (struct regcache *regcache, int regnum, - int offset, int len, void *in, const void *out, + LONGEST offset, int len, void *in, const void *out, enum register_status (*read) (struct regcache *regcache, int regnum, gdb_byte *buf), @@ -968,7 +968,7 @@ regcache_raw_write_part (struct regcache *regcache, int regnum, enum register_status regcache_cooked_read_part (struct regcache *regcache, int regnum, - int offset, int len, gdb_byte *buf) + LONGEST offset, int len, gdb_byte *buf) { struct regcache_descr *descr = regcache->descr; @@ -979,7 +979,7 @@ regcache_cooked_read_part (struct regcache *regcache, int regnum, void regcache_cooked_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf) + LONGEST offset, int len, const gdb_byte *buf) { struct regcache_descr *descr = regcache->descr; diff --git a/gdb/regcache.h b/gdb/regcache.h index 93b4499..81ccda6 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -129,10 +129,10 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache, write style operations. */ enum register_status regcache_cooked_read_part (struct regcache *regcache, - int regnum, int offset, + int regnum, LONGEST offset, int len, gdb_byte *buf); void regcache_cooked_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf); + LONGEST offset, int len, const gdb_byte *buf); /* Special routines to read/write the PC. */ diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index 327eefe..3c4e034 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -639,7 +639,7 @@ sparc64_16_byte_align_p (struct type *type) static void sparc64_store_floating_fields (struct regcache *regcache, struct type *type, - const gdb_byte *valbuf, int element, int bitpos) + const gdb_byte *valbuf, int element, LONGEST bitpos) { int len = TYPE_LENGTH (type); @@ -662,7 +662,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, { gdb_assert (bitpos == 0 || bitpos == 64); - regnum = SPARC64_D0_REGNUM + element + bitpos / 64; + regnum = (int)(SPARC64_D0_REGNUM + element + bitpos / 64); regcache_cooked_write (regcache, regnum, valbuf + (bitpos / 8)); } else @@ -670,7 +670,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, gdb_assert (len == 4); gdb_assert (bitpos % 32 == 0 && bitpos >= 0 && bitpos < 128); - regnum = SPARC_F0_REGNUM + element * 2 + bitpos / 32; + regnum = (int)(SPARC_F0_REGNUM + element * 2 + bitpos / 32); regcache_cooked_write (regcache, regnum, valbuf + (bitpos / 8)); } } @@ -681,7 +681,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); sparc64_store_floating_fields (regcache, subtype, valbuf, element, subpos); @@ -713,7 +713,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, static void sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, - gdb_byte *valbuf, int bitpos) + gdb_byte *valbuf, LONGEST bitpos) { if (sparc64_floating_p (type)) { @@ -724,14 +724,14 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, { gdb_assert (bitpos == 0 || bitpos == 128); - regnum = SPARC64_Q0_REGNUM + bitpos / 128; + regnum = (int)(SPARC64_Q0_REGNUM + bitpos / 128); regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8)); } else if (len == 8) { gdb_assert (bitpos % 64 == 0 && bitpos >= 0 && bitpos < 256); - regnum = SPARC64_D0_REGNUM + bitpos / 64; + regnum = (int)(SPARC64_D0_REGNUM + bitpos / 64); regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8)); } else @@ -739,7 +739,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, gdb_assert (len == 4); gdb_assert (bitpos % 32 == 0 && bitpos >= 0 && bitpos < 256); - regnum = SPARC_F0_REGNUM + bitpos / 32; + regnum = (int)(SPARC_F0_REGNUM + bitpos / 32); regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8)); } } @@ -750,7 +750,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos); } diff --git a/gdb/testsuite/gdb.base/structs4.c b/gdb/testsuite/gdb.base/structs4.c new file mode 100644 index 0000000..e5dfc5c --- /dev/null +++ b/gdb/testsuite/gdb.base/structs4.c @@ -0,0 +1,27 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +enum e { I, J = (unsigned)0xffffffff } e = J; + +void dummy() +{ +} + +main() +{ + dummy(); +} diff --git a/gdb/testsuite/gdb.base/structs4.exp b/gdb/testsuite/gdb.base/structs4.exp new file mode 100644 index 0000000..b66a6eb --- /dev/null +++ b/gdb/testsuite/gdb.base/structs4.exp @@ -0,0 +1,29 @@ +# This testcase is part of GDB, the GNU debugger. + +# Copyright 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set testfile "structs4" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +if { [prepare_for_testing structs4.exp "structs4" "" {debug}] } { + return -1 +} + +# Check the real contents. +gdb_test "print e" "= J" + +gdb_test "print J" "= J" diff --git a/gdb/valops.c b/gdb/valops.c index fca601f..0774f65 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -53,11 +53,11 @@ static int typecmp (int staticp, int varargs, int nargs, struct field t1[], struct value *t2[]); static struct value *search_struct_field (const char *, struct value *, - int, struct type *, int); + LONGEST, struct type *, int); static struct value *search_struct_method (const char *, struct value **, struct value **, - int, int *, struct type *); + LONGEST, int *, struct type *); static int find_oload_champ_namespace (struct value **, int, const char *, const char *, @@ -85,7 +85,7 @@ oload_classification classify_oload_match (struct badness_vector *, int, int); static struct value *value_struct_elt_for_reference (struct type *, - int, struct type *, + LONGEST, struct type *, char *, struct type *, int, enum noside); @@ -102,8 +102,8 @@ static CORE_ADDR allocate_space_in_inferior (int); static struct value *cast_into_complex (struct type *, struct value *); static struct fn_field *find_method_list (struct value **, const char *, - int, struct type *, int *, - struct type **, int *); + LONGEST, struct type *, int *, + struct type **, LONGEST *); void _initialize_valops (void); @@ -651,7 +651,7 @@ value_reinterpret_cast (struct type *type, struct value *arg) static int dynamic_cast_check_1 (struct type *desired_type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct value *val, struct type *search_type, @@ -663,7 +663,7 @@ dynamic_cast_check_1 (struct type *desired_type, for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) { - int offset = baseclass_offset (search_type, i, valaddr, embedded_offset, + LONGEST offset = baseclass_offset (search_type, i, valaddr, embedded_offset, address, val); if (class_types_same_p (desired_type, TYPE_BASECLASS (search_type, i))) @@ -698,7 +698,7 @@ dynamic_cast_check_1 (struct type *desired_type, static int dynamic_cast_check_2 (struct type *desired_type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct value *val, struct type *search_type, @@ -708,7 +708,7 @@ dynamic_cast_check_2 (struct type *desired_type, for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) { - int offset; + LONGEST offset; if (! BASETYPE_VIA_PUBLIC (search_type, i)) continue; @@ -1329,7 +1329,7 @@ value_assign (struct value *toval, struct value *fromval) if (value_bitsize (toval)) { struct value *parent = value_parent (toval); - int offset = value_offset (parent) + value_offset (toval); + LONGEST offset = value_offset (parent) + value_offset (toval); int changed_len; gdb_byte buffer[sizeof (LONGEST)]; int optim, unavail; @@ -1993,7 +1993,7 @@ typecmp (int staticp, int varargs, int nargs, fields, look for a baseclass named NAME. */ static struct value * -search_struct_field (const char *name, struct value *arg1, int offset, +search_struct_field (const char *name, struct value *arg1, LONGEST offset, struct type *type, int looking_for_baseclass) { int i; @@ -2051,7 +2051,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, <variant field>. */ struct value *v; - int new_offset = offset; + LONGEST new_offset = offset; /* This is pretty gross. In G++, the offset in an anonymous union is relative to the beginning of the @@ -2088,7 +2088,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, if (BASETYPE_VIA_VIRTUAL (type, i)) { - int boffset; + LONGEST boffset; struct value *v2; boffset = baseclass_offset (type, i, @@ -2152,7 +2152,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, static struct value * search_struct_method (const char *name, struct value **arg1p, - struct value **args, int offset, + struct value **args, LONGEST offset, int *static_memfuncp, struct type *type) { int i; @@ -2216,9 +2216,9 @@ search_struct_method (const char *name, struct value **arg1p, for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { - int base_offset; + LONGEST base_offset; int skip = 0; - int this_offset; + LONGEST this_offset; if (BASETYPE_VIA_VIRTUAL (type, i)) { @@ -2230,7 +2230,7 @@ search_struct_method (const char *name, struct value **arg1p, clobbered by the user program. Make sure that it still points to a valid memory location. */ - if (offset < 0 || offset >= TYPE_LENGTH (type)) + if (offset < 0 || offset >= (LONGEST)TYPE_LENGTH (type)) { gdb_byte *tmp = alloca (TYPE_LENGTH (baseclass)); CORE_ADDR address = value_address (*arg1p); @@ -2394,8 +2394,8 @@ value_struct_elt (struct value **argp, struct value **args, static struct fn_field * find_method_list (struct value **argp, const char *method, - int offset, struct type *type, int *num_fns, - struct type **basetype, int *boffset) + LONGEST offset, struct type *type, int *num_fns, + struct type **basetype, LONGEST *boffset) { int i; struct fn_field *f; @@ -2428,7 +2428,7 @@ find_method_list (struct value **argp, const char *method, /* Not found in object, check in base subobjects. */ for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { - int base_offset; + LONGEST base_offset; if (BASETYPE_VIA_VIRTUAL (type, i)) { @@ -2464,7 +2464,7 @@ find_method_list (struct value **argp, const char *method, struct fn_field * value_find_oload_method_list (struct value **argp, const char *method, int offset, int *num_fns, - struct type **basetype, int *boffset) + struct type **basetype, LONGEST *boffset) { struct type *t; @@ -2556,7 +2556,7 @@ find_overload_match (struct value **args, int nargs, /* Number of overloaded instances being considered. */ int num_fns = 0; struct type *basetype = NULL; - int boffset; + LONGEST boffset; struct cleanup *all_cleanups = make_cleanup (null_cleanup, NULL); @@ -3263,7 +3263,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) the form "DOMAIN::NAME". */ static struct value * -value_struct_elt_for_reference (struct type *domain, int offset, +value_struct_elt_for_reference (struct type *domain, LONGEST offset, struct type *curtype, char *name, struct type *intype, int want_address, @@ -3300,7 +3300,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, if (want_address) return value_from_longest (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), - offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3)); + offset + (TYPE_FIELD_BITPOS (t, i) >> 3)); else if (noside == EVAL_AVOID_SIDE_EFFECTS) return allocate_value (TYPE_FIELD_TYPE (t, i)); else @@ -3443,7 +3443,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; - int base_offset; + LONGEST base_offset; if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; diff --git a/gdb/valprint.c b/gdb/valprint.c index 325cf40..8f261f5 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -261,7 +261,7 @@ scalar_type_p (struct type *type) static int valprint_check_validity (struct ui_file *stream, struct type *type, - int embedded_offset, + LONGEST embedded_offset, const struct value *val) { CHECK_TYPEDEF (type); @@ -336,7 +336,7 @@ val_print_invalid_address (struct ui_file *stream) characters printed. */ int -val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -556,7 +556,7 @@ val_print_type_code_flags (struct type *type, const gdb_byte *valaddr, void val_print_scalar_formatted (struct type *type, - const gdb_byte *valaddr, int embedded_offset, + const gdb_byte *valaddr, LONGEST embedded_offset, const struct value *val, const struct value_print_options *options, int size, @@ -1189,7 +1189,7 @@ maybe_print_array_index (struct type *index_type, LONGEST index, void val_print_array_elements (struct type *type, - const gdb_byte *valaddr, int embedded_offset, + const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, diff --git a/gdb/valprint.h b/gdb/valprint.h index a34d09b..74326f7 100644 --- a/gdb/valprint.h +++ b/gdb/valprint.h @@ -113,7 +113,7 @@ extern void maybe_print_array_index (struct type *index_type, LONGEST index, struct ui_file *stream, const struct value_print_options *); -extern void val_print_array_elements (struct type *, const gdb_byte *, int, +extern void val_print_array_elements (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -127,7 +127,7 @@ extern void val_print_type_code_flags (struct type *type, struct ui_file *stream); extern void val_print_scalar_formatted (struct type *, - const gdb_byte *, int, + const gdb_byte *, LONGEST, const struct value *, const struct value_print_options *, int, diff --git a/gdb/value.c b/gdb/value.c index 583be33..c56c22f 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -66,7 +66,7 @@ struct internal_function struct range { /* Lowest offset in the range. */ - int offset; + LONGEST offset; /* Length of the range. */ int length; @@ -80,8 +80,8 @@ DEF_VEC_O(range_s); [offset2, offset2+len2) overlap. */ static int -ranges_overlap (int offset1, int len1, - int offset2, int len2) +ranges_overlap (LONGEST offset1, int len1, + LONGEST offset2, int len2) { ULONGEST h, l; @@ -105,7 +105,7 @@ range_lessthan (const range_s *r1, const range_s *r2) OFFSET+LENGTH). */ static int -ranges_contain (VEC(range_s) *ranges, int offset, int length) +ranges_contain (VEC(range_s) *ranges, LONGEST offset, int length) { range_s what; int i; @@ -238,7 +238,7 @@ struct value lval == lval_register, this is a further offset from location.address within the registers structure. Note also the member embedded_offset below. */ - int offset; + LONGEST offset; /* Only used for bitfields; number of bits contained in them. */ int bitsize; @@ -308,8 +308,8 @@ struct value `type', and `embedded_offset' is zero, so everything works normally. */ struct type *enclosing_type; - int embedded_offset; - int pointed_to_offset; + LONGEST embedded_offset; + LONGEST pointed_to_offset; /* Values are stored in a chain, so that they can be deleted easily over calls to the inferior. Values assigned to internal @@ -331,7 +331,7 @@ struct value }; int -value_bytes_available (const struct value *value, int offset, int length) +value_bytes_available (const struct value *value, LONGEST offset, int length) { gdb_assert (!value->lazy); @@ -352,7 +352,7 @@ value_entirely_available (struct value *value) } void -mark_value_bytes_unavailable (struct value *value, int offset, int length) +mark_value_bytes_unavailable (struct value *value, LONGEST offset, int length) { range_s newr; int i; @@ -523,7 +523,7 @@ mark_value_bytes_unavailable (struct value *value, int offset, int length) static int find_first_range_overlap (VEC(range_s) *ranges, int pos, - int offset, int length) + LONGEST offset, int length) { range_s *r; int i; @@ -536,8 +536,8 @@ find_first_range_overlap (VEC(range_s) *ranges, int pos, } int -value_available_contents_eq (const struct value *val1, int offset1, - const struct value *val2, int offset2, +value_available_contents_eq (const struct value *val1, LONGEST offset1, + const struct value *val2, LONGEST offset2, int length) { int idx1 = 0, idx2 = 0; @@ -766,13 +766,13 @@ deprecated_set_value_type (struct value *value, struct type *type) value->type = type; } -int +LONGEST value_offset (const struct value *value) { return value->offset; } void -set_value_offset (struct value *value, int offset) +set_value_offset (struct value *value, LONGEST offset) { value->offset = offset; } @@ -874,8 +874,8 @@ value_contents_all (struct value *value) DST_OFFSET+LENGTH) range are wholly available. */ void -value_contents_copy_raw (struct value *dst, int dst_offset, - struct value *src, int src_offset, int length) +value_contents_copy_raw (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, int length) { range_s *r; int i; @@ -923,8 +923,8 @@ value_contents_copy_raw (struct value *dst, int dst_offset, DST_OFFSET+LENGTH) range are wholly available. */ void -value_contents_copy (struct value *dst, int dst_offset, - struct value *src, int src_offset, int length) +value_contents_copy (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, int length) { require_not_optimized_out (src); @@ -1019,7 +1019,7 @@ value_entirely_optimized_out (const struct value *value) } int -value_bits_valid (const struct value *value, int offset, int length) +value_bits_valid (const struct value *value, LONGEST offset, int length) { if (!value->optimized_out) return 1; @@ -1032,7 +1032,7 @@ value_bits_valid (const struct value *value, int offset, int length) int value_bits_synthetic_pointer (const struct value *value, - int offset, int length) + LONGEST offset, int length) { if (value->lval != lval_computed || !value->location.computed.funcs->check_synthetic_pointer) @@ -1042,26 +1042,26 @@ value_bits_synthetic_pointer (const struct value *value, length); } -int +LONGEST value_embedded_offset (struct value *value) { return value->embedded_offset; } void -set_value_embedded_offset (struct value *value, int val) +set_value_embedded_offset (struct value *value, LONGEST val) { value->embedded_offset = val; } -int +LONGEST value_pointed_to_offset (struct value *value) { return value->pointed_to_offset; } void -set_value_pointed_to_offset (struct value *value, int val) +set_value_pointed_to_offset (struct value *value, LONGEST val) { value->pointed_to_offset = val; } @@ -1832,7 +1832,7 @@ get_internalvar_function (struct internalvar *var, } void -set_internalvar_component (struct internalvar *var, int offset, int bitpos, +set_internalvar_component (struct internalvar *var, LONGEST offset, int bitpos, int bitsize, struct value *newval) { gdb_byte *addr; @@ -2496,7 +2496,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type) FIELDNO says which field. */ struct value * -value_primitive_field (struct value *arg1, int offset, +value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type) { struct value *v; @@ -2526,16 +2526,16 @@ value_primitive_field (struct value *arg1, int offset, bit. Assume that the address, offset, and embedded offset are sufficiently aligned. */ - int bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); + LONGEST bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); int container_bitsize = TYPE_LENGTH (type) * 8; v = allocate_value_lazy (type); v->bitsize = TYPE_FIELD_BITSIZE (arg_type, fieldno); if ((bitpos % container_bitsize) + v->bitsize <= container_bitsize && TYPE_LENGTH (type) <= (int) sizeof (LONGEST)) - v->bitpos = bitpos % container_bitsize; + v->bitpos = (int)(bitpos % container_bitsize); else - v->bitpos = bitpos % 8; + v->bitpos = (int)(bitpos % 8); v->offset = (value_embedded_offset (arg1) + offset + (bitpos - v->bitpos) / 8); @@ -2614,7 +2614,7 @@ value_field (struct value *arg1, int fieldno) struct value * value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *type, - int offset) + LONGEST offset) { struct value *v; struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); @@ -2674,7 +2674,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, static int unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, int bitsize, + LONGEST embedded_offset, LONGEST bitpos, int bitsize, const struct value *original_value, LONGEST *result) { @@ -2683,13 +2683,13 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, ULONGEST valmask; int lsbcount; int bytes_read; - int read_offset; + LONGEST read_offset; /* Read the minimum number of bytes required; there may not be enough bytes to read an entire ULONGEST. */ CHECK_TYPEDEF (field_type); if (bitsize) - bytes_read = ((bitpos % 8) + bitsize + 7) / 8; + bytes_read = (int)(((bitpos % 8) + bitsize + 7) / 8); else bytes_read = TYPE_LENGTH (field_type); @@ -2706,9 +2706,9 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, /* Extract bits. See comment above. */ if (gdbarch_bits_big_endian (get_type_arch (field_type))) - lsbcount = (bytes_read * 8 - bitpos % 8 - bitsize); + lsbcount = (int)(bytes_read * 8 - bitpos % 8 - bitsize); else - lsbcount = (bitpos % 8); + lsbcount = (int)(bitpos % 8); val >>= lsbcount; /* If the field does not entirely fill a LONGEST, then zero the sign bits. @@ -2753,7 +2753,7 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, int bitsize, + LONGEST embedded_offset, int bitpos, int bitsize, const struct value *original_value, LONGEST *result) { @@ -2771,10 +2771,10 @@ unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, static int unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result) { - int bitpos = TYPE_FIELD_BITPOS (type, fieldno); + LONGEST bitpos = TYPE_FIELD_BITPOS (type, fieldno); int bitsize = TYPE_FIELD_BITSIZE (type, fieldno); struct type *field_type = TYPE_FIELD_TYPE (type, fieldno); @@ -2790,7 +2790,7 @@ unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result) { gdb_assert (val != NULL); @@ -2822,7 +2822,7 @@ unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno) struct value * value_field_bitfield (struct type *type, int fieldno, const gdb_byte *valaddr, - int embedded_offset, const struct value *val) + LONGEST embedded_offset, const struct value *val) { LONGEST l; @@ -2842,23 +2842,23 @@ value_field_bitfield (struct type *type, int fieldno, /* Modify the value of a bitfield. ADDR points to a block of memory in target byte order; the bitfield starts in the byte pointed to. FIELDVAL - is the desired value of the field, in host byte order. BITPOS and BITSIZE + is the desired value of the field, in host byte order. OFFSET and BITSIZE indicate which bits (in target bit order) comprise the bitfield. - Requires 0 < BITSIZE <= lbits, 0 <= BITPOS % 8 + BITSIZE <= lbits, and - 0 <= BITPOS, where lbits is the size of a LONGEST in bits. */ + Requires 0 < BITSIZE <= lbits, 0 <= OFFSET % 8 + BITSIZE <= lbits, and + 0 <= OFFSET, where lbits is the size of a LONGEST in bits. */ void modify_field (struct type *type, gdb_byte *addr, - LONGEST fieldval, int bitpos, int bitsize) + LONGEST fieldval, LONGEST offset, int bitsize) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); ULONGEST oword; ULONGEST mask = (ULONGEST) -1 >> (8 * sizeof (ULONGEST) - bitsize); - int bytesize; + int bitpos, bytesize; /* Normalize BITPOS. */ - addr += bitpos / 8; - bitpos %= 8; + addr += offset / 8; + bitpos = (int)(offset % 8); /* If a negative fieldval fits in the field in question, chop off the sign extension bits. */ diff --git a/gdb/value.h b/gdb/value.h index 2a2274d..6eecbce 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -81,8 +81,8 @@ struct value *value_parent (struct value *); within the registers structure. Note also the member embedded_offset below. */ -extern int value_offset (const struct value *); -extern void set_value_offset (struct value *, int offset); +extern LONGEST value_offset (const struct value *); +extern void set_value_offset (struct value *, LONGEST offset); /* The comment from "struct value" reads: ``Is it modifiable? Only relevant if lval != not_lval.''. Shouldn't the value instead be @@ -137,10 +137,10 @@ extern struct type *value_enclosing_type (struct value *); extern void set_value_enclosing_type (struct value *val, struct type *new_type); -extern int value_pointed_to_offset (struct value *value); -extern void set_value_pointed_to_offset (struct value *value, int val); -extern int value_embedded_offset (struct value *value); -extern void set_value_embedded_offset (struct value *value, int val); +extern LONGEST value_pointed_to_offset (struct value *value); +extern void set_value_pointed_to_offset (struct value *value, LONGEST val); +extern LONGEST value_embedded_offset (struct value *value); +extern void set_value_embedded_offset (struct value *value, LONGEST val); /* For lval_computed values, this structure holds functions used to retrieve and set the value (or portions of the value). @@ -168,7 +168,7 @@ struct lval_funcs /* Check the validity of some bits in VALUE. This should return 1 if all the bits starting at OFFSET and extending for LENGTH bits are valid, or 0 if any bit is invalid. */ - int (*check_validity) (const struct value *value, int offset, int length); + int (*check_validity) (const struct value *value, LONGEST offset, int length); /* Return 1 if any bit in VALUE is valid, 0 if they are all invalid. */ int (*check_any_valid) (const struct value *value); @@ -186,7 +186,7 @@ struct lval_funcs /* If non-NULL, this is used to determine whether the indicated bits of VALUE are a synthetic pointer. */ int (*check_synthetic_pointer) (const struct value *value, - int offset, int length); + LONGEST offset, int length); /* Return a duplicate of VALUE's closure, for use in a new value. This may simply return the same closure, if VALUE's is @@ -367,13 +367,13 @@ extern struct value *coerce_array (struct value *value); bits in the given range are valid, zero if any bit is invalid. */ extern int value_bits_valid (const struct value *value, - int offset, int length); + LONGEST offset, int length); /* Given a value, determine whether the bits starting at OFFSET and extending for LENGTH bits are a synthetic pointer. */ extern int value_bits_synthetic_pointer (const struct value *value, - int offset, int length); + LONGEST offset, int length); /* Given a value, determine whether the contents bytes starting at OFFSET and extending for LENGTH bytes are available. This returns @@ -381,7 +381,7 @@ extern int value_bits_synthetic_pointer (const struct value *value, byte is unavailable. */ extern int value_bytes_available (const struct value *value, - int offset, int length); + LONGEST offset, int length); /* Like value_bytes_available, but return false if any byte in the whole object is unavailable. */ @@ -391,7 +391,7 @@ extern int value_entirely_available (struct value *value); LENGTH bytes as unavailable. */ extern void mark_value_bytes_unavailable (struct value *value, - int offset, int length); + LONGEST offset, int length); /* Compare LENGTH bytes of VAL1's contents starting at OFFSET1 with LENGTH bytes of VAL2's contents starting at OFFSET2. @@ -423,8 +423,8 @@ extern void mark_value_bytes_unavailable (struct value *value, value_available_contents_eq(val, 3, val, 4, 4) => 0 */ -extern int value_available_contents_eq (const struct value *val1, int offset1, - const struct value *val2, int offset2, +extern int value_available_contents_eq (const struct value *val1, LONGEST offset1, + const struct value *val2, LONGEST offset2, int length); /* Read LENGTH bytes of memory starting at MEMADDR into BUFFER, which @@ -461,7 +461,7 @@ extern CORE_ADDR unpack_pointer (struct type *type, const gdb_byte *valaddr); extern int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, + LONGEST embedded_offset, int bitpos, int bitsize, const struct value *original_value, LONGEST *result); @@ -470,12 +470,12 @@ extern LONGEST unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno); extern int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result); extern struct value *value_field_bitfield (struct type *type, int fieldno, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, const struct value *val); extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); @@ -526,11 +526,11 @@ extern struct value *read_var_value (struct symbol *var, extern struct value *allocate_value (struct type *type); extern struct value *allocate_value_lazy (struct type *type); extern void allocate_value_contents (struct value *value); -extern void value_contents_copy (struct value *dst, int dst_offset, - struct value *src, int src_offset, +extern void value_contents_copy (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, int length); -extern void value_contents_copy_raw (struct value *dst, int dst_offset, - struct value *src, int src_offset, +extern void value_contents_copy_raw (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, int length); extern struct value *allocate_repeat_value (struct type *type, int count); @@ -597,7 +597,7 @@ extern struct value *value_static_field (struct type *type, int fieldno); extern struct fn_field *value_find_oload_method_list (struct value **, const char *, int, int *, - struct type **, int *); + struct type **, LONGEST *); enum oload_search_type { NON_METHOD, METHOD, BOTH }; @@ -610,7 +610,7 @@ extern int find_overload_match (struct value **args, int nargs, extern struct value *value_field (struct value *arg1, int fieldno); -extern struct value *value_primitive_field (struct value *arg1, int offset, +extern struct value *value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type); @@ -709,7 +709,7 @@ extern void set_internalvar_string (struct internalvar *var, extern void clear_internalvar (struct internalvar *var); extern void set_internalvar_component (struct internalvar *var, - int offset, + LONGEST offset, int bitpos, int bitsize, struct value *newvalue); @@ -747,7 +747,7 @@ extern struct value *value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside); extern struct value *value_fn_field (struct value **arg1p, struct fn_field *f, - int j, struct type *type, int offset); + int j, struct type *type, LONGEST offset); extern int binop_types_user_defined_p (enum exp_opcode op, struct type *type1, @@ -775,7 +775,7 @@ extern void release_value_or_incref (struct value *val); extern int record_latest_value (struct value *val); extern void modify_field (struct type *type, gdb_byte *addr, - LONGEST fieldval, int bitpos, int bitsize); + LONGEST fieldval, LONGEST bitpos, int bitsize); extern void type_print (struct type *type, const char *varstring, struct ui_file *stream, int show); @@ -805,7 +805,7 @@ extern void value_print_array_elements (struct value *val, extern struct value *value_release_to_mark (struct value *mark); extern int val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -- 1.7.7.4 ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct 2012-02-29 13:55 ` Siddhesh Poyarekar @ 2012-02-29 13:59 ` Siddhesh Poyarekar 2012-03-01 22:45 ` Jan Kratochvil 1 sibling, 0 replies; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-02-29 13:59 UTC (permalink / raw) To: Tom Tromey; +Cc: gdb-patches, Jan Kratochvil On Wed, Feb 29, 2012 at 07:21:48PM +0530, Siddhesh Poyarekar wrote: > For reference, the splint command I used with each source: > > splint -warnposix -Dsigjmp_buf=int -I. -I../../gdb/gdb \ > -I../../gdb/gdb/common -I../../gdb/gdb/config \ > -DLOCALEDIR="\"/home/siddhesh/sandbox/gdb-sandbox/share/locale\"" > -DHAVE_CONFIG_H -I../../gdb/gdb/../include/opcode > -I../../gdb/gdb/../opcodes/.. -I../../gdb/gdb/../readline/.. > -I../bfd -I../../gdb/gdb/../bfd -I../../gdb/gdb/../include > -I../libdecnumber -I../../gdb/gdb/../libdecnumber \ > -I../../gdb/gdb/gnulib -Ignulib -DTUI=1 > -I/usr/include/python2.7 -I/usr/include/python2.7 > -I../../gdb-build/gdb $file > Ugh. This is obviously: splint -warnposix -Dsigjmp_buf=int -I. -I../../gdb/gdb \ -I../../gdb/gdb/common -I../../gdb/gdb/config \ -DLOCALEDIR="\"/home/siddhesh/sandbox/gdb-sandbox/share/locale\"" \ -DHAVE_CONFIG_H -I../../gdb/gdb/../include/opcode \ -I../../gdb/gdb/../opcodes/.. -I../../gdb/gdb/../readline/.. \ -I../bfd -I../../gdb/gdb/../bfd -I../../gdb/gdb/../include \ -I../libdecnumber -I../../gdb/gdb/../libdecnumber \ -I../../gdb/gdb/gnulib -Ignulib -DTUI=1 \ -I/usr/include/python2.7 -I/usr/include/python2.7 \ -I../../gdb-build/gdb $file -- Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct 2012-02-29 13:55 ` Siddhesh Poyarekar 2012-02-29 13:59 ` Siddhesh Poyarekar @ 2012-03-01 22:45 ` Jan Kratochvil 2012-03-05 6:34 ` Siddhesh Poyarekar 1 sibling, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-03-01 22:45 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Tom Tromey, gdb-patches On Wed, 29 Feb 2012 14:51:51 +0100, Siddhesh Poyarekar wrote: > There is one problem that still remains that I haven't fixed yet, > which is the size of TYPE_FIELD. It is currently unsigned int, which > is less than sizeof(bitpos) now. This looks wrong since bitpos is > considered an offset within these types and it seems possible to have > an offset larger than the total size right now. There are a couple of > places where this comes into play, but fixing this in the same patch > would mean another 2.5k lines in the patch. I can work on this on my > free time later if not having it in this change is OK I fully agree. But to make this patch really working for struct offsets (and not just enum's) one needs to also extend the type->length width. I am sorry but it will be a big patch. > * (gdb.base/structs4.c, gdb.base/structs4.exp): New test case. This should be written as - for example: * gdb.base/structs4.c, gdb.base/structs4.exp: New test files. And please choose some arbitrary name expressing what it tests, not "4", such as struct-64bit-offset or anything of your idea. Some patched lines exceed 80 character, please fix them, these lines: -d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +d_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, -f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +f_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, -m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +m2_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, - int offset = baseclass_offset (search_type, i, valaddr, embedded_offset, + LONGEST offset = baseclass_offset (search_type, i, valaddr, embedded_offset, -extern int value_available_contents_eq (const struct value *val1, int offset1, - const struct value *val2, int offset2, +extern int value_available_contents_eq (const struct value *val1, LONGEST offset1, + const struct value *val2, LONGEST offset2, splint gives nice advices, thanks for the idea. I think it would not give a warning if there is incorrectly used 'long' instead of LONGEST'. Still neded to fix: gnu-v2-abi.c:269:9: Assignment of long int to int: *top = (((rtti_type)->main_type->flds_bnds.fields[(rtti_type)->main_type->vp tr_fieldno]).loc.bitpos) / 8 Therefore: gnuv2_value_rtti_type: 3rd parameter should be: int *top -> LONGEST *top (It will introduce some more sources changes. > diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c > index 107df93..f743db1 100644 > --- a/gdb/ada-lang.c > +++ b/gdb/ada-lang.c > @@ -80,7 +80,7 @@ static struct type *desc_bounds_type (struct type *); > > static struct value *desc_bounds (struct value *); > > -static int fat_pntr_bounds_bitpos (struct type *); > +static LONGEST fat_pntr_bounds_bitpos (struct type *); > > static int fat_pntr_bounds_bitsize (struct type *); > > @@ -88,13 +88,13 @@ static struct type *desc_data_target_type (struct type *); > > static struct value *desc_data (struct value *); > > -static int fat_pntr_data_bitpos (struct type *); > +static LONGEST fat_pntr_data_bitpos (struct type *); > > static int fat_pntr_data_bitsize (struct type *); > > static struct value *desc_one_bound (struct value *, int, int); > > -static int desc_bound_bitpos (struct type *, int, int); > +static LONGEST desc_bound_bitpos (struct type *, int, int); > > static int desc_bound_bitsize (struct type *, int, int); > > @@ -217,14 +217,14 @@ static struct value *value_val_atr (struct type *, struct value *); > static struct symbol *standard_lookup (const char *, const struct block *, > domain_enum); > > -static struct value *ada_search_struct_field (char *, struct value *, int, > +static struct value *ada_search_struct_field (char *, struct value *, LONGEST, > struct type *); > > -static struct value *ada_value_primitive_field (struct value *, int, int, > +static struct value *ada_value_primitive_field (struct value *, LONGEST, int, > struct type *); > > -static int find_struct_field (const char *, struct type *, int, > - struct type **, int *, int *, int *, int *); > +static int find_struct_field (const char *, struct type *, LONGEST, > + struct type **, LONGEST *, int *, int *, int *); > > static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR, > struct value *); > @@ -240,7 +240,7 @@ static void ada_language_arch_info (struct gdbarch *, > > static void check_size (const struct type *); > > -static struct value *ada_index_struct_field (int, struct value *, int, > +static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST, > struct type *); > > static struct value *assign_aggregate (struct value *, struct value *, > @@ -584,7 +584,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) > } > > static const gdb_byte * > -cond_offset_host (const gdb_byte *valaddr, long offset) > +cond_offset_host (const gdb_byte *valaddr, LONGEST offset) > { > if (valaddr == NULL) > return NULL; > @@ -593,7 +593,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) > } > > static CORE_ADDR > -cond_offset_target (CORE_ADDR address, long offset) > +cond_offset_target (CORE_ADDR address, LONGEST offset) > { > if (address == 0) > return 0; > @@ -1559,7 +1559,7 @@ desc_bounds (struct value *arr) > /* If TYPE is the type of an array-descriptor (fat pointer), the bit > position of the field containing the address of the bounds data. */ > > -static int > +static LONGEST > fat_pntr_bounds_bitpos (struct type *type) > { > return TYPE_FIELD_BITPOS (desc_base_type (type), 1); > @@ -1625,7 +1625,7 @@ desc_data (struct value *arr) > /* If TYPE is the type of an array-descriptor (fat pointer), the bit > position of the field containing the address of the data. */ > > -static int > +static LONGEST > fat_pntr_data_bitpos (struct type *type) > { > return TYPE_FIELD_BITPOS (desc_base_type (type), 0); > @@ -1660,7 +1660,7 @@ desc_one_bound (struct value *bounds, int i, int which) > of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper > bound, if WHICH is 1. The first bound is I=1. */ > > -static int > +static LONGEST > desc_bound_bitpos (struct type *type, int i, int which) > { > return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); > @@ -2218,7 +2218,7 @@ has_negatives (struct type *type) > > struct value * > ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, > - long offset, int bit_offset, int bit_size, > + LONGEST offset, int bit_offset, int bit_size, > struct type *type) > { > struct value *v; > @@ -5950,7 +5950,7 @@ value_tag_from_contents_and_address (struct type *type, > const gdb_byte *valaddr, > CORE_ADDR address) > { > - int tag_byte_offset; > + LONGEST tag_byte_offset; > struct type *tag_type; > > if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, > @@ -6328,7 +6328,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) > only in that it can handle packed values of arbitrary type. */ > > static struct value * > -ada_value_primitive_field (struct value *arg1, int offset, int fieldno, > +ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, > struct type *arg_type) > { > struct type *type; > @@ -6340,12 +6340,13 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, > > if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) > { > - int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); > + LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); > int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); > > return ada_value_primitive_packed_val (arg1, value_contents (arg1), > offset + bit_pos / 8, > - bit_pos % 8, bit_size, type); > + (int)(bit_pos % 8), bit_size, > + type); GNU Coding Style would be '(int) (bit_pos % 8)'. But I do not see any need for the cast here. splint warning is not relevant in this case. > } > else > return value_primitive_field (arg1, offset, fieldno, arg_type); > @@ -6367,9 +6368,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, > Returns 1 if found, 0 otherwise. */ > > static int > -find_struct_field (const char *name, struct type *type, int offset, > +find_struct_field (const char *name, struct type *type, LONGEST offset, > struct type **field_type_p, > - int *byte_offset_p, int *bit_offset_p, int *bit_size_p, > + LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p, > int *index_p) > { > int i; > @@ -6387,8 +6388,8 @@ find_struct_field (const char *name, struct type *type, int offset, > > for (i = 0; i < TYPE_NFIELDS (type); i += 1) > { > - int bit_pos = TYPE_FIELD_BITPOS (type, i); > - int fld_offset = offset + bit_pos / 8; > + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); > + LONGEST fld_offset = offset + bit_pos / 8; > const char *t_field_name = TYPE_FIELD_NAME (type, i); > > if (t_field_name == NULL) > @@ -6403,7 +6404,7 @@ find_struct_field (const char *name, struct type *type, int offset, > if (byte_offset_p != NULL) > *byte_offset_p = fld_offset; > if (bit_offset_p != NULL) > - *bit_offset_p = bit_pos % 8; > + *bit_offset_p = (int)(bit_pos % 8); Again. > if (bit_size_p != NULL) > *bit_size_p = bit_size; > return 1; > @@ -6458,7 +6459,7 @@ num_visible_fields (struct type *type) > Searches recursively through wrapper fields (e.g., '_parent'). */ > > static struct value * > -ada_search_struct_field (char *name, struct value *arg, int offset, > +ada_search_struct_field (char *name, struct value *arg, LONGEST offset, > struct type *type) > { > int i; > @@ -6491,7 +6492,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset, > int j; > struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, > i)); > - int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; > + LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; > > for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) > { > @@ -6509,8 +6510,8 @@ ada_search_struct_field (char *name, struct value *arg, int offset, > return NULL; > } > > -static struct value *ada_index_struct_field_1 (int *, struct value *, > - int, struct type *); > +static struct value *ada_index_struct_field_1 (LONGEST *, struct value *, > + LONGEST, struct type *); > > > /* Return field #INDEX in ARG, where the index is that returned by > @@ -6519,7 +6520,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, > * If found, return value, else return NULL. */ > > static struct value * > -ada_index_struct_field (int index, struct value *arg, int offset, > +ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset, > struct type *type) > { > return ada_index_struct_field_1 (&index, arg, offset, type); > @@ -6531,7 +6532,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, > * *INDEX_P. */ > > static struct value * > -ada_index_struct_field_1 (int *index_p, struct value *arg, int offset, > +ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset, > struct type *type) > { > int i; > @@ -6621,7 +6622,8 @@ ada_value_struct_elt (struct value *arg, char *name, int no_err) > v = ada_search_struct_field (name, arg, 0, t); > else > { > - int bit_offset, bit_size, byte_offset; > + int bit_offset, bit_size; > + LONGEST byte_offset; > struct type *field_type; > CORE_ADDR address; > > @@ -6929,7 +6931,7 @@ ada_coerce_ref (struct value *val0) > ALIGNMENT (a power of 2). */ > > static unsigned int > -align_value (unsigned int off, unsigned int alignment) > +align_value (LONGEST off, unsigned int alignment) > { > return (off + alignment - 1) & ~(alignment - 1); > } > @@ -7303,9 +7305,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, > struct value *mark = value_mark (); > struct value *dval; > struct type *rtype; > - int nfields, bit_len; > + int nfields; > int variant_field; > - long off; > + LONGEST off, bit_len; > int fld_bit_len; > int f; > > @@ -7377,7 +7379,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, > that follow this one. */ > if (ada_is_aligner_type (field_type)) > { > - long field_offset = TYPE_FIELD_BITPOS (field_type, f); > + LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f); > > field_valaddr = cond_offset_host (field_valaddr, field_offset); > field_address = cond_offset_target (field_address, field_offset); > diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h > index 2a6cd57..d79a2ba 100644 > --- a/gdb/ada-lang.h > +++ b/gdb/ada-lang.h > @@ -164,7 +164,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int, > extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, > struct ui_file *stream); > > -extern int ada_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, > +extern int ada_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *); > @@ -249,7 +249,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); > > extern struct value *ada_value_primitive_packed_val (struct value *, > const gdb_byte *, > - long, int, int, > + LONGEST, int, int, > struct type *); > > extern struct type *ada_coerce_to_simple_array_type (struct type *); > diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c > index 5599278..de3ed5fa 100644 > --- a/gdb/ada-typeprint.c > +++ b/gdb/ada-typeprint.c > @@ -274,7 +274,8 @@ static void > print_enum_type (struct type *type, struct ui_file *stream) > { > int len = TYPE_NFIELDS (type); > - int i, lastval; > + LONGEST lastval; > + int i; > > fprintf_filtered (stream, "("); > wrap_here (" "); > @@ -289,7 +290,7 @@ print_enum_type (struct type *type, struct ui_file *stream) > fputs_filtered (ada_enum_name (TYPE_FIELD_NAME (type, i)), stream); > if (lastval != TYPE_FIELD_BITPOS (type, i)) > { > - fprintf_filtered (stream, " => %d", TYPE_FIELD_BITPOS (type, i)); > + fprintf_filtered (stream, " => %s", plongest(TYPE_FIELD_BITPOS (type, i))); GNU Coding style: 'plongest (TYPE_FIELD_BITPOS ...' > lastval = TYPE_FIELD_BITPOS (type, i); > } > lastval += 1; > diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c > index f43f3e3..1f01260 100644 > --- a/gdb/ada-valprint.c > +++ b/gdb/ada-valprint.c > @@ -42,15 +42,15 @@ static void print_record (struct type *, const gdb_byte *, int, > const struct value_print_options *); > > static int print_field_values (struct type *, const gdb_byte *, > - int, > + LONGEST, > struct ui_file *, int, > const struct value *, > const struct value_print_options *, > - int, struct type *, int); > + int, struct type *, LONGEST); > > static void adjust_type_signedness (struct type *); > > -static int ada_val_print_1 (struct type *, const gdb_byte *, int, CORE_ADDR, > +static int ada_val_print_1 (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *); > @@ -571,7 +571,7 @@ ada_printstr (struct ui_file *stream, struct type *type, > > int > ada_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options) > @@ -667,7 +667,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, > > static int > ada_val_print_1 (struct type *type, const gdb_byte *valaddr, > - int offset, CORE_ADDR address, > + LONGEST offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options) > @@ -936,12 +936,12 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, > > static int > print_variant_part (struct type *type, int field_num, > - const gdb_byte *valaddr, int offset, > + const gdb_byte *valaddr, LONGEST offset, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > int comma_needed, > - struct type *outer_type, int outer_offset) > + struct type *outer_type, LONGEST outer_offset) > { > struct type *var_type = TYPE_FIELD_TYPE (type, field_num); > int which = ada_which_variant_applies (var_type, outer_type, > @@ -1048,11 +1048,11 @@ print_record (struct type *type, const gdb_byte *valaddr, > > static int > print_field_values (struct type *type, const gdb_byte *valaddr, > - int offset, struct ui_file *stream, int recurse, > + LONGEST offset, struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > int comma_needed, > - struct type *outer_type, int outer_offset) > + struct type *outer_type, LONGEST outer_offset) > { > int i, len; > > @@ -1133,7 +1133,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, > } > else > { > - int bit_pos = TYPE_FIELD_BITPOS (type, i); > + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); > int bit_size = TYPE_FIELD_BITSIZE (type, i); > struct value_print_options opts; > > @@ -1141,7 +1141,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, > v = ada_value_primitive_packed_val > (NULL, valaddr, > offset + bit_pos / HOST_CHAR_BIT, > - bit_pos % HOST_CHAR_BIT, > + (int)(bit_pos % HOST_CHAR_BIT), Again. > bit_size, TYPE_FIELD_TYPE (type, i)); > opts = *options; > opts.deref_ref = 0; > diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c > index ea65d0d..d52205f 100644 > --- a/gdb/amd64-tdep.c > +++ b/gdb/amd64-tdep.c > @@ -482,10 +482,10 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) > for (i = 0; i < TYPE_NFIELDS (type); i++) > { > struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); > - int pos = TYPE_FIELD_BITPOS (type, i) / 64; > + LONGEST pos = TYPE_FIELD_BITPOS (type, i) / 64; > enum amd64_reg_class subclass[2]; > int bitsize = TYPE_FIELD_BITSIZE (type, i); > - int endpos; > + LONGEST endpos; > > if (bitsize == 0) > bitsize = TYPE_LENGTH (subtype) * 8; > diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c > index 739677f..8eff381 100644 > --- a/gdb/ax-gdb.c > +++ b/gdb/ax-gdb.c > @@ -80,12 +80,12 @@ static void gen_traced_pop (struct gdbarch *, struct agent_expr *, > static void gen_sign_extend (struct agent_expr *, struct type *); > static void gen_extend (struct agent_expr *, struct type *); > static void gen_fetch (struct agent_expr *, struct type *); > -static void gen_left_shift (struct agent_expr *, int); > +static void gen_left_shift (struct agent_expr *, LONGEST); > > > static void gen_frame_args_address (struct gdbarch *, struct agent_expr *); > static void gen_frame_locals_address (struct gdbarch *, struct agent_expr *); > -static void gen_offset (struct agent_expr *ax, int offset); > +static void gen_offset (struct agent_expr *ax, LONGEST offset); > static void gen_sym_offset (struct agent_expr *, struct symbol *); > static void gen_var_ref (struct gdbarch *, struct agent_expr *ax, > struct axs_value *value, struct symbol *var); > @@ -135,15 +135,15 @@ static void gen_deref (struct agent_expr *, struct axs_value *); > static void gen_address_of (struct agent_expr *, struct axs_value *); > static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, > struct axs_value *value, > - struct type *type, int start, int end); > + struct type *type, LONGEST start, LONGEST end); > static void gen_primitive_field (struct expression *exp, > struct agent_expr *ax, > struct axs_value *value, > - int offset, int fieldno, struct type *type); > + LONGEST offset, int fieldno, struct type *type); > static int gen_struct_ref_recursive (struct expression *exp, > struct agent_expr *ax, > struct axs_value *value, > - char *field, int offset, > + char *field, LONGEST offset, > struct type *type); > static void gen_struct_ref (struct expression *exp, struct agent_expr *ax, > struct axs_value *value, > @@ -567,7 +567,7 @@ gen_fetch (struct agent_expr *ax, struct type *type) > right shift it by -DISTANCE bits if DISTANCE < 0. This generates > unsigned (logical) right shifts. */ > static void > -gen_left_shift (struct agent_expr *ax, int distance) > +gen_left_shift (struct agent_expr *ax, LONGEST distance) > { > if (distance > 0) > { > @@ -621,7 +621,7 @@ gen_frame_locals_address (struct gdbarch *gdbarch, struct agent_expr *ax) > programming in ML, it would be clearer why these are the same > thing. */ > static void > -gen_offset (struct agent_expr *ax, int offset) > +gen_offset (struct agent_expr *ax, LONGEST offset) > { > /* It would suffice to simply push the offset and add it, but this > makes it easier to read positive and negative offsets in the > @@ -1283,7 +1283,7 @@ gen_address_of (struct agent_expr *ax, struct axs_value *value) > static void > gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, > struct axs_value *value, struct type *type, > - int start, int end) > + LONGEST start, LONGEST end) > { > /* Note that ops[i] fetches 8 << i bits. */ > static enum agent_op ops[] > @@ -1318,13 +1318,13 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, > > /* The first and one-after-last bits in the field, but rounded down > and up to byte boundaries. */ > - int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; > - int bound_end = (((end + TARGET_CHAR_BIT - 1) > - / TARGET_CHAR_BIT) > - * TARGET_CHAR_BIT); > + LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; > + LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1) > + / TARGET_CHAR_BIT) > + * TARGET_CHAR_BIT); > > /* current bit offset within the structure */ > - int offset; > + LONGEST offset; > > /* The index in ops of the opcode we're considering. */ > int op; > @@ -1428,7 +1428,7 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, > ax_simple (ax, aop_bit_or); > > /* Sign- or zero-extend the value as appropriate. */ > - ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, end - start)); > + ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, (int)(end - start))); Here I think ax_zero_ext and ax_ext should use LONGEST instead of the cast. (OK, one may argue a bit about it.) > > /* This is *not* an lvalue. Ugh. */ > value->kind = axs_rvalue; > @@ -1443,7 +1443,7 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, > static void > gen_primitive_field (struct expression *exp, > struct agent_expr *ax, struct axs_value *value, > - int offset, int fieldno, struct type *type) > + LONGEST offset, int fieldno, struct type *type) > { > /* Is this a bitfield? */ > if (TYPE_FIELD_PACKED (type, fieldno)) > @@ -1468,7 +1468,7 @@ gen_primitive_field (struct expression *exp, > static int > gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, > struct axs_value *value, > - char *field, int offset, struct type *type) > + char *field, LONGEST offset, struct type *type) > { > int i, rslt; > int nbases = TYPE_N_BASECLASSES (type); > diff --git a/gdb/c-lang.h b/gdb/c-lang.h > index e8c632f..7fc6f61 100644 > --- a/gdb/c-lang.h > +++ b/gdb/c-lang.h > @@ -72,7 +72,7 @@ extern void c_print_typedef (struct type *, > struct ui_file *); > > extern int c_val_print (struct type *, const gdb_byte *, > - int, CORE_ADDR, > + LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *); > @@ -118,14 +118,14 @@ extern void cp_print_class_member (const gdb_byte *, struct type *, > struct ui_file *, char *); > > extern void cp_print_value_fields (struct type *, struct type *, > - const gdb_byte *, int, CORE_ADDR, > + const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *, > struct type **, int); > > extern void cp_print_value_fields_rtti (struct type *, > - const gdb_byte *, int, CORE_ADDR, > + const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *, > diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c > index 21887c6..7a0f7e9 100644 > --- a/gdb/c-typeprint.c > +++ b/gdb/c-typeprint.c > @@ -717,7 +717,7 @@ c_type_print_base (struct type *type, struct ui_file *stream, > { > int i; > int len, real_len; > - int lastval; > + LONGEST lastval; > enum > { > s_none, s_public, s_private, s_protected > @@ -1206,8 +1206,8 @@ c_type_print_base (struct type *type, struct ui_file *stream, > fputs_filtered (TYPE_FIELD_NAME (type, i), stream); > if (lastval != TYPE_FIELD_BITPOS (type, i)) > { > - fprintf_filtered (stream, " = %d", > - TYPE_FIELD_BITPOS (type, i)); > + fprintf_filtered (stream, " = %s", > + plongest(TYPE_FIELD_BITPOS (type, i))); Again: 'plongest (TYPE_FIELD_BITPOS ...'. > lastval = TYPE_FIELD_BITPOS (type, i); > } > lastval++; > diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c > index 82551e9..f034a88 100644 > --- a/gdb/c-valprint.c > +++ b/gdb/c-valprint.c > @@ -147,7 +147,7 @@ c_textual_element_type (struct type *type, char format) > > int > c_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options) > @@ -416,7 +416,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, > /* Print vtable entry - we only get here if NOT using > -fvtable_thunks. (Otherwise, look under > TYPE_CODE_PTR.) */ > - int offset = (embedded_offset > + LONGEST offset = (embedded_offset > + TYPE_FIELD_BITPOS (type, > VTBL_FNADDR_OFFSET) / 8); Wrong indentation of the continuing lines. > struct type *field_type = TYPE_FIELD_TYPE (type, > diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c > index e949088..c7afcd0 100644 > --- a/gdb/cp-abi.c > +++ b/gdb/cp-abi.c > @@ -68,13 +68,13 @@ is_operator_name (const char *name) > return (*current_cp_abi.is_operator_name) (name); > } > > -int > +LONGEST > baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > const struct value *val) > { > volatile struct gdb_exception ex; > - int res = 0; > + LONGEST res = 0; > > gdb_assert (current_cp_abi.baseclass_offset != NULL); > > @@ -98,7 +98,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, > struct value * > value_virtual_fn_field (struct value **arg1p, > struct fn_field *f, int j, > - struct type *type, int offset) > + struct type *type, LONGEST offset) > { > if ((current_cp_abi.virtual_fn_field) == NULL) > return NULL; > diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h > index 0f24e9a..6e6c26e 100644 > --- a/gdb/cp-abi.h > +++ b/gdb/cp-abi.h > @@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, > struct fn_field *f, > int j, > struct type *type, > - int offset); > + LONGEST offset); > > > /* Try to find the run-time type of VALUE, using C++ run-time type > @@ -144,9 +144,9 @@ extern struct type *value_rtti_type (struct value *value, > contents of VAL. The result is the offset of the baseclass value > relative to (the address of)(ARG) + OFFSET. */ > > -extern int baseclass_offset (struct type *type, > +extern LONGEST baseclass_offset (struct type *type, > int index, const gdb_byte *valaddr, > - int embedded_offset, > + LONGEST embedded_offset, > CORE_ADDR address, > const struct value *val); Wrong indentation of the continuing lines. > > @@ -199,11 +199,11 @@ struct cp_abi_ops > struct value *(*virtual_fn_field) (struct value **arg1p, > struct fn_field * f, > int j, struct type * type, > - int offset); > + LONGEST offset); > struct type *(*rtti_type) (struct value *v, int *full, > int *top, int *using_enc); > - int (*baseclass_offset) (struct type *type, int index, > - const bfd_byte *valaddr, int embedded_offset, > + LONGEST (*baseclass_offset) (struct type *type, int index, > + const bfd_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, const struct value *val); Wrong indentation of the continuing lines. > void (*print_method_ptr) (const gdb_byte *contents, > struct type *type, > diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c > index 1697006..563f759 100644 > --- a/gdb/cp-valprint.c > +++ b/gdb/cp-valprint.c > @@ -82,7 +82,7 @@ static void cp_print_static_field (struct type *, struct value *, > const struct value_print_options *); > > static void cp_print_value (struct type *, struct type *, > - const gdb_byte *, int, > + const gdb_byte *, LONGEST, > CORE_ADDR, struct ui_file *, > int, const struct value *, > const struct value_print_options *, > @@ -156,7 +156,7 @@ cp_is_vtbl_member (struct type *type) > > void > cp_print_value_fields (struct type *type, struct type *real_type, > - const gdb_byte *valaddr, int offset, > + const gdb_byte *valaddr, LONGEST offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, const struct value *val, > const struct value_print_options *options, > @@ -428,7 +428,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, > > void > cp_print_value_fields_rtti (struct type *type, > - const gdb_byte *valaddr, int offset, > + const gdb_byte *valaddr, LONGEST offset, > CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > @@ -468,7 +468,7 @@ cp_print_value_fields_rtti (struct type *type, > > static void > cp_print_value (struct type *type, struct type *real_type, > - const gdb_byte *valaddr, int offset, > + const gdb_byte *valaddr, LONGEST offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, const struct value *val, > const struct value_print_options *options, > @@ -478,7 +478,7 @@ cp_print_value (struct type *type, struct type *real_type, > = (struct type **) obstack_next_free (&dont_print_vb_obstack); > struct obstack tmp_obstack = dont_print_vb_obstack; > int i, n_baseclasses = TYPE_N_BASECLASSES (type); > - int thisoffset; > + LONGEST thisoffset; > struct type *thistype; > > if (dont_print_vb == 0) > @@ -492,7 +492,7 @@ cp_print_value (struct type *type, struct type *real_type, > > for (i = 0; i < n_baseclasses; i++) > { > - int boffset = 0; > + LONGEST boffset = 0; > int skip; > struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); > const char *basename = TYPE_NAME (baseclass); > diff --git a/gdb/d-lang.h b/gdb/d-lang.h > index 67ca14c..e2cda03 100644 > --- a/gdb/d-lang.h > +++ b/gdb/d-lang.h > @@ -25,7 +25,7 @@ > extern char *d_demangle (const char *mangled, int options); > > extern int d_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options); > diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c > index 527c087..813e9ee 100644 > --- a/gdb/d-valprint.c > +++ b/gdb/d-valprint.c > @@ -29,7 +29,7 @@ > a dynamic array. */ > static int > dynamic_array_type (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options) > @@ -70,7 +70,7 @@ dynamic_array_type (struct type *type, const gdb_byte *valaddr, > > /* Implements the la_val_print routine for language D. */ > int > -d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > +d_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options) > diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c > index 313df7b..9415300 100644 > --- a/gdb/dwarf2loc.c > +++ b/gdb/dwarf2loc.c > @@ -1391,7 +1391,7 @@ read_pieced_value (struct value *v) > cleanup = make_cleanup (free_current_contents, &buffer); > > contents = value_contents_raw (v); > - bits_to_skip = 8 * value_offset (v); > + bits_to_skip = (ULONGEST)(8 * value_offset (v)); Again, split warnings are not relevant for this, it has no functionality impact, the cast is not needed. > if (value_bitsize (v)) > { > bits_to_skip += value_bitpos (v); > @@ -1575,7 +1575,7 @@ write_pieced_value (struct value *to, struct value *from) > cleanup = make_cleanup (free_current_contents, &buffer); > > contents = value_contents (from); > - bits_to_skip = 8 * value_offset (to); > + bits_to_skip = (ULONGEST)(8 * value_offset (to)); Again. > if (value_bitsize (to)) > { > bits_to_skip += value_bitpos (to); > @@ -1717,7 +1717,7 @@ write_pieced_value (struct value *to, struct value *from) > implicit pointer. */ > > static int > -check_pieced_value_bits (const struct value *value, int bit_offset, > +check_pieced_value_bits (const struct value *value, LONGEST bit_offset, > int bit_length, > enum dwarf_value_location check_for) > { > @@ -1772,7 +1772,7 @@ check_pieced_value_bits (const struct value *value, int bit_offset, > } > > static int > -check_pieced_value_validity (const struct value *value, int bit_offset, > +check_pieced_value_validity (const struct value *value, LONGEST bit_offset, > int bit_length) > { > return check_pieced_value_bits (value, bit_offset, bit_length, > @@ -1791,7 +1791,7 @@ check_pieced_value_invalid (const struct value *value) > a synthetic pointer. */ > > static int > -check_pieced_synthetic_pointer (const struct value *value, int bit_offset, > +check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, > int bit_length) > { > return check_pieced_value_bits (value, bit_offset, bit_length, > @@ -1817,9 +1817,9 @@ indirect_pieced_value (struct value *value) > struct type *type; > struct frame_info *frame; > struct dwarf2_locexpr_baton baton; > - int i, bit_offset, bit_length; > + int i, bit_length; > struct dwarf_expr_piece *piece = NULL; > - LONGEST byte_offset; > + LONGEST byte_offset, bit_offset; > > type = check_typedef (value_type (value)); > if (TYPE_CODE (type) != TYPE_CODE_PTR) > diff --git a/gdb/eval.c b/gdb/eval.c > index 9913a72..0922596 100644 > --- a/gdb/eval.c > +++ b/gdb/eval.c > @@ -319,7 +319,8 @@ evaluate_struct_tuple (struct value *struct_val, > int pc = *pos; > struct value *val = NULL; > int nlabels = 0; > - int bitpos, bitsize; > + int bitsize; > + LONGEST bitpos; > bfd_byte *addr; > > /* Skip past the labels, and count them. */ > diff --git a/gdb/f-lang.h b/gdb/f-lang.h > index 4e5563d..e6407b7 100644 > --- a/gdb/f-lang.h > +++ b/gdb/f-lang.h > @@ -28,7 +28,7 @@ extern void f_error (char *); /* Defined in f-exp.y */ > extern void f_print_type (struct type *, const char *, struct ui_file *, int, > int); > > -extern int f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, > +extern int f_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *); > diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c > index 17f747f..6c30cfd 100644 > --- a/gdb/f-valprint.c > +++ b/gdb/f-valprint.c > @@ -164,7 +164,7 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) > static void > f77_print_array_1 (int nss, int ndimensions, struct type *type, > const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > @@ -215,7 +215,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, > > static void > f77_print_array (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, > + LONGEST embedded_offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, > const struct value *val, > @@ -247,7 +247,7 @@ Type node corrupt! F77 arrays cannot have %d subscripts (%d Max)"), > also identical to val_print. */ > > int > -f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > +f_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options) > @@ -498,7 +498,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > fprintf_filtered (stream, "( "); > for (index = 0; index < TYPE_NFIELDS (type); index++) > { > - int offset = TYPE_FIELD_BITPOS (type, index) / 8; > + LONGEST offset = TYPE_FIELD_BITPOS (type, index) / 8; > > val_print (TYPE_FIELD_TYPE (type, index), valaddr, > embedded_offset + offset, > diff --git a/gdb/findvar.c b/gdb/findvar.c > index 79c4221..4ae70b3 100644 > --- a/gdb/findvar.c > +++ b/gdb/findvar.c > @@ -631,7 +631,7 @@ void > read_frame_register_value (struct value *value, struct frame_info *frame) > { > struct gdbarch *gdbarch = get_frame_arch (frame); > - int offset = 0; > + LONGEST offset = 0; > int reg_offset = value_offset (value); > int regnum = VALUE_REGNUM (value); > int len = TYPE_LENGTH (check_typedef (value_type (value))); > diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c > index b6e8b4c..60a9f23 100644 > --- a/gdb/gdbtypes.c > +++ b/gdb/gdbtypes.c > @@ -2137,8 +2137,8 @@ is_public_ancestor (struct type *base, struct type *dclass) > > static int > is_unique_ancestor_worker (struct type *base, struct type *dclass, > - int *offset, > - const gdb_byte *valaddr, int embedded_offset, > + LONGEST *offset, > + const gdb_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, struct value *val) > { > int i, count = 0; > @@ -2149,7 +2149,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, > for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) > { > struct type *iter; > - int this_offset; > + LONGEST this_offset; > > iter = check_typedef (TYPE_BASECLASS (dclass, i)); > > @@ -2190,7 +2190,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, > int > is_unique_ancestor (struct type *base, struct value *val) > { > - int offset = -1; > + LONGEST offset = -1; > > return is_unique_ancestor_worker (base, value_type (val), &offset, > value_contents_for_printing (val), > @@ -3198,8 +3198,8 @@ recursive_dump_type (struct type *type, int spaces) > for (idx = 0; idx < TYPE_NFIELDS (type); idx++) > { > printfi_filtered (spaces + 2, > - "[%d] bitpos %d bitsize %d type ", > - idx, TYPE_FIELD_BITPOS (type, idx), > + "[%d] bitpos %s bitsize %d type ", > + idx, plongest(TYPE_FIELD_BITPOS (type, idx)), Again: 'plongest (TYPE_FIELD_BITPOS ...'. > TYPE_FIELD_BITSIZE (type, idx)); > gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); > printf_filtered (" name '%s' (", > diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h > index cddd2d0..3f4e849 100644 > --- a/gdb/gdbtypes.h > +++ b/gdb/gdbtypes.h > @@ -514,7 +514,7 @@ struct main_type > the LSB. For a range bound or enum value, this is the > value itself. */ > > - int bitpos; > + LONGEST bitpos; > > /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr > is the location (in the target) of the static field. > diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c > index e635e8f..6312a10 100644 > --- a/gdb/gnu-v2-abi.c > +++ b/gdb/gnu-v2-abi.c > @@ -86,7 +86,7 @@ gnuv2_is_operator_name (const char *name) > TYPE is the type in which F is located. */ > static struct value * > gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, > - struct type * type, int offset) > + struct type * type, LONGEST offset) > { > struct value *arg1 = *arg1p; > struct type *type1 = check_typedef (value_type (arg1)); > @@ -342,9 +342,9 @@ vb_match (struct type *type, int index, struct type *basetype) > target). The result is the offset of the baseclass value relative > to (the address of)(ARG) + OFFSET. */ > > -static int > +static LONGEST > gnuv2_baseclass_offset (struct type *type, int index, > - const bfd_byte *valaddr, int embedded_offset, > + const bfd_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, const struct value *val) > { > struct type *basetype = TYPE_BASECLASS (type, index); > @@ -362,7 +362,7 @@ gnuv2_baseclass_offset (struct type *type, int index, > if (vb_match (type, i, basetype)) > { > struct type *field_type; > - int field_offset; > + LONGEST field_offset; > int field_length; > CORE_ADDR addr; > > @@ -387,7 +387,7 @@ gnuv2_baseclass_offset (struct type *type, int index, > /* Don't go through baseclass_offset, as that wraps > exceptions, thus, inner exceptions would be wrapped more > than once. */ > - int boffset = > + LONGEST boffset = > gnuv2_baseclass_offset (type, i, valaddr, > embedded_offset, address, val); > > diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c > index f015af6..afd404c 100644 > --- a/gdb/gnu-v3-abi.c > +++ b/gdb/gnu-v3-abi.c > @@ -180,7 +180,7 @@ vtable_ptrdiff_type (struct gdbarch *gdbarch) > /* Return the offset from the start of the imaginary `struct > gdb_gnu_v3_abi_vtable' object to the vtable's "address point" > (i.e., where objects' virtual table pointers point). */ > -static int > +static LONGEST > vtable_address_point_offset (struct gdbarch *gdbarch) > { > struct type *vtable_type = gdbarch_data (gdbarch, vtable_type_gdbarch_data); > @@ -383,7 +383,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, > static struct value * > gnuv3_virtual_fn_field (struct value **value_p, > struct fn_field *f, int j, > - struct type *vfn_base, int offset) > + struct type *vfn_base, LONGEST offset) > { > struct type *values_type = check_typedef (value_type (*value_p)); > struct gdbarch *gdbarch; > @@ -413,16 +413,16 @@ gnuv3_virtual_fn_field (struct value **value_p, > > -1 is returned on error. */ > > -static int > +static LONGEST > gnuv3_baseclass_offset (struct type *type, int index, > - const bfd_byte *valaddr, int embedded_offset, > + const bfd_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, const struct value *val) > { > struct gdbarch *gdbarch; > struct type *ptr_type; > struct value *vtable; > struct value *vbase_array; > - long int cur_base_offset, base_offset; > + LONGEST cur_base_offset, base_offset; > > /* Determine architecture. */ > gdbarch = get_type_arch (type); > @@ -489,7 +489,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, > we're out of luck. */ > for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) > { > - int pos; > + LONGEST pos; > struct type *basetype; > > if (BASETYPE_VIA_VIRTUAL (domain, i)) > diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c > index 18a7c19..9323c0b 100644 > --- a/gdb/jv-lang.c > +++ b/gdb/jv-lang.c > @@ -438,7 +438,7 @@ java_link_class_type (struct gdbarch *gdbarch, > for (i = TYPE_N_BASECLASSES (type); i < nfields; i++) > { > int accflags; > - int boffset; > + LONGEST boffset; > > if (fields == NULL) > { > diff --git a/gdb/jv-lang.h b/gdb/jv-lang.h > index d061096..4380a42 100644 > --- a/gdb/jv-lang.h > +++ b/gdb/jv-lang.h > @@ -42,7 +42,7 @@ struct builtin_java_type > > extern const struct builtin_java_type *builtin_java_type (struct gdbarch *); > > -extern int java_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, > +extern int java_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *); > diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c > index d430ba0..914d871 100644 > --- a/gdb/jv-valprint.c > +++ b/gdb/jv-valprint.c > @@ -261,7 +261,7 @@ java_value_print (struct value *val, struct ui_file *stream, > > static void > java_print_value_fields (struct type *type, const gdb_byte *valaddr, > - int offset, > + LONGEST offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, > const struct value *val, > @@ -480,7 +480,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, > > int > java_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options) > diff --git a/gdb/language.c b/gdb/language.c > index 49ba21a..1850880 100644 > --- a/gdb/language.c > +++ b/gdb/language.c > @@ -849,7 +849,7 @@ unk_lang_print_type (struct type *type, const char *varstring, > > static int > unk_lang_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options) > diff --git a/gdb/language.h b/gdb/language.h > index a47a44d..c20c581 100644 > --- a/gdb/language.h > +++ b/gdb/language.h > @@ -242,7 +242,7 @@ struct language_defn > > int (*la_val_print) (struct type *type, > const gdb_byte *contents, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options); > diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h > index 2803e63..865e8fb 100644 > --- a/gdb/m2-lang.h > +++ b/gdb/m2-lang.h > @@ -32,7 +32,7 @@ extern void m2_print_typedef (struct type *, struct symbol *, > extern int m2_is_long_set (struct type *type); > extern int m2_is_unbounded_array (struct type *type); > > -extern int m2_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, > +extern int m2_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *); > diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c > index 9735d7f..26615b0 100644 > --- a/gdb/m2-typeprint.c > +++ b/gdb/m2-typeprint.c > @@ -587,7 +587,8 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show, > void > m2_enum (struct type *type, struct ui_file *stream, int show, int level) > { > - int lastval, i, len; > + LONGEST lastval; > + int i, len; > > if (show < 0) > { > @@ -609,7 +610,8 @@ m2_enum (struct type *type, struct ui_file *stream, int show, int level) > fputs_filtered (TYPE_FIELD_NAME (type, i), stream); > if (lastval != TYPE_FIELD_BITPOS (type, i)) > { > - fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i)); > + fprintf_filtered (stream, " = %s", > + plongest(TYPE_FIELD_BITPOS (type, i))); Again: 'plongest (TYPE_FIELD_BITPOS ...'. > lastval = TYPE_FIELD_BITPOS (type, i); > } > lastval++; > diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c > index 4378b00..4a7977f 100644 > --- a/gdb/m2-valprint.c > +++ b/gdb/m2-valprint.c > @@ -36,7 +36,7 @@ static int print_unpacked_pointer (struct type *type, > struct ui_file *stream); > static void > m2_print_array_contents (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > @@ -89,7 +89,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high) > > static void > m2_print_long_set (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream) > { > int empty_set = 1; > @@ -180,7 +180,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr, > > static void > m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value_print_options *options) > { > @@ -277,7 +277,7 @@ print_variable_at_address (struct type *type, > > static void > m2_print_array_contents (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > @@ -315,7 +315,7 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr, > also identical to val_print. */ > > int > -m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > +m2_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options) > diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c > index a670cd3..a09d19a 100644 > --- a/gdb/mips-tdep.c > +++ b/gdb/mips-tdep.c > @@ -289,7 +289,7 @@ static void > mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, > int reg_num, int length, > enum bfd_endian endian, gdb_byte *in, > - const gdb_byte *out, int buf_offset) > + const gdb_byte *out, LONGEST buf_offset) > { > int reg_offset = 0; > > @@ -312,8 +312,8 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, > } > if (mips_debug) > fprintf_unfiltered (gdb_stderr, > - "xfer $%d, reg offset %d, buf offset %d, length %d, ", > - reg_num, reg_offset, buf_offset, length); > + "xfer $%d, reg offset %d, buf offset %s, length %d, ", > + reg_num, reg_offset, plongest(buf_offset), length); Again: 'plongest (buf_offset)'. > if (mips_debug && out != NULL) > { > int i; > @@ -3221,7 +3221,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct type *func_type, > > static int > mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, > - int offset) > + LONGEST offset) > { > int i; > > @@ -3236,7 +3236,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, > > for (i = 0; i < TYPE_NFIELDS (arg_type); i++) > { > - int pos; > + LONGEST pos; > struct type *field_type; > > /* We're only looking at normal fields. */ > @@ -3630,11 +3630,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type, > : MIPS_V0_REGNUM); > field < TYPE_NFIELDS (type); field++, regnum += 2) > { > - int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) > + LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) > / TARGET_CHAR_BIT); Wrong indentation of the continuing line. > if (mips_debug) > - fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", > - offset); > + fprintf_unfiltered (gdb_stderr, "Return float struct+%s\n", > + plongest(offset)); Again: 'plongest (offset)'. > if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) > { > /* A 16-byte long double field goes in two consecutive > diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c > index 80f978c..dffc7a4 100644 > --- a/gdb/opencl-lang.c > +++ b/gdb/opencl-lang.c > @@ -174,9 +174,9 @@ lval_func_read (struct value *v) > struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); > struct type *type = check_typedef (value_type (v)); > struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); > - int offset = value_offset (v); > + LONGEST offset = value_offset (v); > int elsize = TYPE_LENGTH (eltype); > - int n, i, j = 0; > + LONGEST n, i, j = 0; > LONGEST lowb = 0; > LONGEST highb = 0; > > @@ -203,9 +203,9 @@ lval_func_write (struct value *v, struct value *fromval) > struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); > struct type *type = check_typedef (value_type (v)); > struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); > - int offset = value_offset (v); > + LONGEST offset = value_offset (v); > int elsize = TYPE_LENGTH (eltype); > - int n, i, j = 0; > + LONGEST n, i, j = 0; > LONGEST lowb = 0; > LONGEST highb = 0; > > @@ -243,17 +243,17 @@ lval_func_write (struct value *v, struct value *fromval) > /* Return nonzero if all bits in V within OFFSET and LENGTH are valid. */ > > static int > -lval_func_check_validity (const struct value *v, int offset, int length) > +lval_func_check_validity (const struct value *v, LONGEST offset, int length) > { > struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); > /* Size of the target type in bits. */ > int elsize = > TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; > - int startrest = offset % elsize; > - int start = offset / elsize; > - int endrest = (offset + length) % elsize; > - int end = (offset + length) / elsize; > - int i; > + int startrest = (int)(offset % elsize); Unneeded cast. > + LONGEST start = offset / elsize; > + int endrest = (int)((offset + length) % elsize); Unneeded cast. > + LONGEST end = (offset + length) / elsize; > + LONGEST i; > > if (endrest) > end++; > @@ -297,17 +297,17 @@ lval_func_check_any_valid (const struct value *v) > > static int > lval_func_check_synthetic_pointer (const struct value *v, > - int offset, int length) > + LONGEST offset, int length) > { > struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); > /* Size of the target type in bits. */ > int elsize = > TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; > - int startrest = offset % elsize; > - int start = offset / elsize; > - int endrest = (offset + length) % elsize; > - int end = (offset + length) / elsize; > - int i; > + int startrest = (int)(offset % elsize); Unneeded cast. > + LONGEST start = offset / elsize; > + int endrest = (int)((offset + length) % elsize); Unneeded cast. > + LONGEST end = (offset + length) / elsize; > + LONGEST i; > > if (endrest) > end++; > diff --git a/gdb/p-lang.c b/gdb/p-lang.c > index 826d24f..80c1c68 100644 > --- a/gdb/p-lang.c > +++ b/gdb/p-lang.c > @@ -96,8 +96,8 @@ pascal_main_name (void) > are not multiple of TARGET_CHAR_BIT then the results are wrong > but this does not happen for Free Pascal nor for GPC. */ > int > -is_pascal_string_type (struct type *type,int *length_pos, > - int *length_size, int *string_pos, > +is_pascal_string_type (struct type *type,LONGEST *length_pos, > + int *length_size, LONGEST *string_pos, s/,LONGEST/, LONGEST/. And BTW you could fix up spaces to tabs for the indentation here. > struct type **char_type, > const char **arrayname) > { > diff --git a/gdb/p-lang.h b/gdb/p-lang.h > index 180c544..2627aa4 100644 > --- a/gdb/p-lang.h > +++ b/gdb/p-lang.h > @@ -35,7 +35,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *, > extern void pascal_print_typedef (struct type *, struct symbol *, > struct ui_file *); > > -extern int pascal_val_print (struct type *, const gdb_byte *, int, > +extern int pascal_val_print (struct type *, const gdb_byte *, LONGEST, > CORE_ADDR, struct ui_file *, int, > const struct value *, > const struct value_print_options *); > @@ -49,7 +49,7 @@ extern void pascal_type_print_method_args (const char *, const char *, > /* These are in p-lang.c: */ > > extern int > - is_pascal_string_type (struct type *, int *, int *, int *, > + is_pascal_string_type (struct type *, LONGEST *, int *, LONGEST *, > struct type **, const char **); > > extern void pascal_printchar (int, struct type *, struct ui_file *); > @@ -69,7 +69,7 @@ extern void > pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int); > > extern void pascal_object_print_value_fields (struct type *, const gdb_byte *, > - int, > + LONGEST, > CORE_ADDR, struct ui_file *, > int, > const struct value *, > diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c > index ab82d90..b97c7e9 100644 > --- a/gdb/p-typeprint.c > +++ b/gdb/p-typeprint.c > @@ -443,7 +443,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, > { > int i; > int len; > - int lastval; > + LONGEST lastval; > enum > { > s_none, s_public, s_private, s_protected > @@ -754,7 +754,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, > if (lastval != TYPE_FIELD_BITPOS (type, i)) > { > fprintf_filtered (stream, > - " := %d", TYPE_FIELD_BITPOS (type, i)); > + " := %s", > + plongest(TYPE_FIELD_BITPOS (type, i))); Again: 'plongest (TYPE_FIELD_BITPOS ...'. > lastval = TYPE_FIELD_BITPOS (type, i); > } > lastval++; > diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c > index 39eff10..aa75095 100644 > --- a/gdb/p-valprint.c > +++ b/gdb/p-valprint.c > @@ -47,7 +47,7 @@ > > int > pascal_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options) > @@ -59,7 +59,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, > LONGEST low_bound, high_bound; > struct type *elttype; > unsigned eltlen; > - int length_pos, length_size, string_pos; > + LONGEST length_pos, string_pos; > + int length_size; > struct type *char_type; > LONGEST val; > CORE_ADDR addr; > @@ -70,7 +71,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, > case TYPE_CODE_ARRAY: > if (get_array_bounds (type, &low_bound, &high_bound)) > { > - len = high_bound - low_bound + 1; > + len = (unsigned int)(high_bound - low_bound + 1); Unneeded cast. It is a bit incorrect, we do need to extend also type->length. > elttype = check_typedef (TYPE_TARGET_TYPE (type)); > eltlen = TYPE_LENGTH (elttype); > if (options->prettyprint_arrays) > @@ -633,7 +634,7 @@ static void pascal_object_print_static_field (struct value *, > const struct value_print_options *); > > static void pascal_object_print_value (struct type *, const gdb_byte *, > - int, > + LONGEST, > CORE_ADDR, struct ui_file *, int, > const struct value *, > const struct value_print_options *, > @@ -692,7 +693,7 @@ pascal_object_is_vtbl_member (struct type *type) > > void > pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, > - int offset, > + LONGEST offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, > const struct value *val, > @@ -887,7 +888,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, > > static void > pascal_object_print_value (struct type *type, const gdb_byte *valaddr, > - int offset, > + LONGEST offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, > const struct value *val, > @@ -910,11 +911,11 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr, > > for (i = 0; i < n_baseclasses; i++) > { > - int boffset = 0; > + LONGEST boffset = 0; > struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); > const char *basename = type_name_no_tag (baseclass); > const gdb_byte *base_valaddr = NULL; > - int thisoffset; > + LONGEST thisoffset; > volatile struct gdb_exception ex; > int skip = 0; > > diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c > index 86d4f2c..1ceb23b 100644 > --- a/gdb/python/py-prettyprint.c > +++ b/gdb/python/py-prettyprint.c > @@ -676,7 +676,7 @@ print_children (PyObject *printer, const char *hint, > > int > apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > @@ -824,7 +824,7 @@ gdbpy_default_visualizer (PyObject *self, PyObject *args) > > int > apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > diff --git a/gdb/python/python.h b/gdb/python/python.h > index 597ed2e..476299b 100644 > --- a/gdb/python/python.h > +++ b/gdb/python/python.h > @@ -33,7 +33,7 @@ void eval_python_from_control_command (struct command_line *); > void source_python_script (FILE *file, const char *filename); > > int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > diff --git a/gdb/regcache.c b/gdb/regcache.c > index c716280..12ed8fa 100644 > --- a/gdb/regcache.c > +++ b/gdb/regcache.c > @@ -902,7 +902,7 @@ typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum, > > static enum register_status > regcache_xfer_part (struct regcache *regcache, int regnum, > - int offset, int len, void *in, const void *out, > + LONGEST offset, int len, void *in, const void *out, > enum register_status (*read) (struct regcache *regcache, > int regnum, > gdb_byte *buf), > @@ -968,7 +968,7 @@ regcache_raw_write_part (struct regcache *regcache, int regnum, > > enum register_status > regcache_cooked_read_part (struct regcache *regcache, int regnum, > - int offset, int len, gdb_byte *buf) > + LONGEST offset, int len, gdb_byte *buf) > { > struct regcache_descr *descr = regcache->descr; > > @@ -979,7 +979,7 @@ regcache_cooked_read_part (struct regcache *regcache, int regnum, > > void > regcache_cooked_write_part (struct regcache *regcache, int regnum, > - int offset, int len, const gdb_byte *buf) > + LONGEST offset, int len, const gdb_byte *buf) > { > struct regcache_descr *descr = regcache->descr; > > diff --git a/gdb/regcache.h b/gdb/regcache.h > index 93b4499..81ccda6 100644 > --- a/gdb/regcache.h > +++ b/gdb/regcache.h > @@ -129,10 +129,10 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache, > write style operations. */ > > enum register_status regcache_cooked_read_part (struct regcache *regcache, > - int regnum, int offset, > + int regnum, LONGEST offset, > int len, gdb_byte *buf); > void regcache_cooked_write_part (struct regcache *regcache, int regnum, > - int offset, int len, const gdb_byte *buf); > + LONGEST offset, int len, const gdb_byte *buf); > > /* Special routines to read/write the PC. */ > > diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c > index 327eefe..3c4e034 100644 > --- a/gdb/sparc64-tdep.c > +++ b/gdb/sparc64-tdep.c > @@ -639,7 +639,7 @@ sparc64_16_byte_align_p (struct type *type) > > static void > sparc64_store_floating_fields (struct regcache *regcache, struct type *type, > - const gdb_byte *valbuf, int element, int bitpos) > + const gdb_byte *valbuf, int element, LONGEST bitpos) > { > int len = TYPE_LENGTH (type); > > @@ -662,7 +662,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, > { > gdb_assert (bitpos == 0 || bitpos == 64); > > - regnum = SPARC64_D0_REGNUM + element + bitpos / 64; > + regnum = (int)(SPARC64_D0_REGNUM + element + bitpos / 64); Unneeded cast. > regcache_cooked_write (regcache, regnum, valbuf + (bitpos / 8)); > } > else > @@ -670,7 +670,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, > gdb_assert (len == 4); > gdb_assert (bitpos % 32 == 0 && bitpos >= 0 && bitpos < 128); > > - regnum = SPARC_F0_REGNUM + element * 2 + bitpos / 32; > + regnum = (int)(SPARC_F0_REGNUM + element * 2 + bitpos / 32); Unneeded cast. > regcache_cooked_write (regcache, regnum, valbuf + (bitpos / 8)); > } > } > @@ -681,7 +681,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, > for (i = 0; i < TYPE_NFIELDS (type); i++) > { > struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); > - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); > + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); > > sparc64_store_floating_fields (regcache, subtype, valbuf, > element, subpos); > @@ -713,7 +713,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, > > static void > sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, > - gdb_byte *valbuf, int bitpos) > + gdb_byte *valbuf, LONGEST bitpos) > { > if (sparc64_floating_p (type)) > { > @@ -724,14 +724,14 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, > { > gdb_assert (bitpos == 0 || bitpos == 128); > > - regnum = SPARC64_Q0_REGNUM + bitpos / 128; > + regnum = (int)(SPARC64_Q0_REGNUM + bitpos / 128); Unneeded cast. > regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8)); > } > else if (len == 8) > { > gdb_assert (bitpos % 64 == 0 && bitpos >= 0 && bitpos < 256); > > - regnum = SPARC64_D0_REGNUM + bitpos / 64; > + regnum = (int)(SPARC64_D0_REGNUM + bitpos / 64); Unneeded cast. > regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8)); > } > else > @@ -739,7 +739,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, > gdb_assert (len == 4); > gdb_assert (bitpos % 32 == 0 && bitpos >= 0 && bitpos < 256); > > - regnum = SPARC_F0_REGNUM + bitpos / 32; > + regnum = (int)(SPARC_F0_REGNUM + bitpos / 32); Unneeded cast. > regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8)); > } > } > @@ -750,7 +750,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, > for (i = 0; i < TYPE_NFIELDS (type); i++) > { > struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); > - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); > + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); > > sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos); > } > diff --git a/gdb/testsuite/gdb.base/structs4.c b/gdb/testsuite/gdb.base/structs4.c > new file mode 100644 > index 0000000..e5dfc5c > --- /dev/null > +++ b/gdb/testsuite/gdb.base/structs4.c > @@ -0,0 +1,27 @@ > +/* This testcase is part of GDB, the GNU debugger. > + > + Copyright 2012 Free Software Foundation, Inc. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see <http://www.gnu.org/licenses/>. */ > + > +enum e { I, J = (unsigned)0xffffffff } e = J; Either '(unsigned) 0xffffffff' or just '0xffffffffU'. enum e { I, J = 0xffffffffU } e = J; > + > +void dummy() Not such strict for testcases but according to C prototypes + GNU Coding style: void dummy (void) > +{ > +} > + > +main() int main (void) > +{ > + dummy(); > +} { dummy (); return 0; } > diff --git a/gdb/testsuite/gdb.base/structs4.exp b/gdb/testsuite/gdb.base/structs4.exp > new file mode 100644 > index 0000000..b66a6eb > --- /dev/null > +++ b/gdb/testsuite/gdb.base/structs4.exp > @@ -0,0 +1,29 @@ > +# This testcase is part of GDB, the GNU debugger. > + > +# Copyright 2012 Free Software Foundation, Inc. > + > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see <http://www.gnu.org/licenses/>. > + > +set testfile "structs4" > +set srcfile ${testfile}.c > +set binfile ${objdir}/${subdir}/${testfile} > + > +if { [prepare_for_testing structs4.exp "structs4" "" {debug}] } { > + return -1 > +} > + > +# Check the real contents. > +gdb_test "print e" "= J" > + > +gdb_test "print J" "= J" > diff --git a/gdb/valops.c b/gdb/valops.c > index fca601f..0774f65 100644 > --- a/gdb/valops.c > +++ b/gdb/valops.c > @@ -53,11 +53,11 @@ static int typecmp (int staticp, int varargs, int nargs, > struct field t1[], struct value *t2[]); > > static struct value *search_struct_field (const char *, struct value *, > - int, struct type *, int); > + LONGEST, struct type *, int); > > static struct value *search_struct_method (const char *, struct value **, > struct value **, > - int, int *, struct type *); > + LONGEST, int *, struct type *); > > static int find_oload_champ_namespace (struct value **, int, > const char *, const char *, > @@ -85,7 +85,7 @@ oload_classification classify_oload_match (struct badness_vector *, > int, int); > > static struct value *value_struct_elt_for_reference (struct type *, > - int, struct type *, > + LONGEST, struct type *, > char *, > struct type *, > int, enum noside); > @@ -102,8 +102,8 @@ static CORE_ADDR allocate_space_in_inferior (int); > static struct value *cast_into_complex (struct type *, struct value *); > > static struct fn_field *find_method_list (struct value **, const char *, > - int, struct type *, int *, > - struct type **, int *); > + LONGEST, struct type *, int *, > + struct type **, LONGEST *); > > void _initialize_valops (void); > > @@ -651,7 +651,7 @@ value_reinterpret_cast (struct type *type, struct value *arg) > static int > dynamic_cast_check_1 (struct type *desired_type, > const gdb_byte *valaddr, > - int embedded_offset, > + LONGEST embedded_offset, > CORE_ADDR address, > struct value *val, > struct type *search_type, > @@ -663,7 +663,7 @@ dynamic_cast_check_1 (struct type *desired_type, > > for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) > { > - int offset = baseclass_offset (search_type, i, valaddr, embedded_offset, > + LONGEST offset = baseclass_offset (search_type, i, valaddr, embedded_offset, > address, val); Wrong indentation of the continuing line. > > if (class_types_same_p (desired_type, TYPE_BASECLASS (search_type, i))) > @@ -698,7 +698,7 @@ dynamic_cast_check_1 (struct type *desired_type, > static int > dynamic_cast_check_2 (struct type *desired_type, > const gdb_byte *valaddr, > - int embedded_offset, > + LONGEST embedded_offset, > CORE_ADDR address, > struct value *val, > struct type *search_type, > @@ -708,7 +708,7 @@ dynamic_cast_check_2 (struct type *desired_type, > > for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) > { > - int offset; > + LONGEST offset; > > if (! BASETYPE_VIA_PUBLIC (search_type, i)) > continue; > @@ -1329,7 +1329,7 @@ value_assign (struct value *toval, struct value *fromval) > if (value_bitsize (toval)) > { > struct value *parent = value_parent (toval); > - int offset = value_offset (parent) + value_offset (toval); > + LONGEST offset = value_offset (parent) + value_offset (toval); > int changed_len; > gdb_byte buffer[sizeof (LONGEST)]; > int optim, unavail; > @@ -1993,7 +1993,7 @@ typecmp (int staticp, int varargs, int nargs, > fields, look for a baseclass named NAME. */ > > static struct value * > -search_struct_field (const char *name, struct value *arg1, int offset, > +search_struct_field (const char *name, struct value *arg1, LONGEST offset, > struct type *type, int looking_for_baseclass) > { > int i; > @@ -2051,7 +2051,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, > <variant field>. */ > > struct value *v; > - int new_offset = offset; > + LONGEST new_offset = offset; > > /* This is pretty gross. In G++, the offset in an > anonymous union is relative to the beginning of the > @@ -2088,7 +2088,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, > > if (BASETYPE_VIA_VIRTUAL (type, i)) > { > - int boffset; > + LONGEST boffset; > struct value *v2; > > boffset = baseclass_offset (type, i, > @@ -2152,7 +2152,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, > > static struct value * > search_struct_method (const char *name, struct value **arg1p, > - struct value **args, int offset, > + struct value **args, LONGEST offset, > int *static_memfuncp, struct type *type) > { > int i; > @@ -2216,9 +2216,9 @@ search_struct_method (const char *name, struct value **arg1p, > > for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) > { > - int base_offset; > + LONGEST base_offset; > int skip = 0; > - int this_offset; > + LONGEST this_offset; > > if (BASETYPE_VIA_VIRTUAL (type, i)) > { > @@ -2230,7 +2230,7 @@ search_struct_method (const char *name, struct value **arg1p, > clobbered by the user program. Make sure that it > still points to a valid memory location. */ > > - if (offset < 0 || offset >= TYPE_LENGTH (type)) > + if (offset < 0 || offset >= (LONGEST)TYPE_LENGTH (type)) Unneeded cast. > { > gdb_byte *tmp = alloca (TYPE_LENGTH (baseclass)); > CORE_ADDR address = value_address (*arg1p); > @@ -2394,8 +2394,8 @@ value_struct_elt (struct value **argp, struct value **args, > > static struct fn_field * > find_method_list (struct value **argp, const char *method, > - int offset, struct type *type, int *num_fns, > - struct type **basetype, int *boffset) > + LONGEST offset, struct type *type, int *num_fns, > + struct type **basetype, LONGEST *boffset) > { > int i; > struct fn_field *f; > @@ -2428,7 +2428,7 @@ find_method_list (struct value **argp, const char *method, > /* Not found in object, check in base subobjects. */ > for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) > { > - int base_offset; > + LONGEST base_offset; > > if (BASETYPE_VIA_VIRTUAL (type, i)) > { > @@ -2464,7 +2464,7 @@ find_method_list (struct value **argp, const char *method, > struct fn_field * > value_find_oload_method_list (struct value **argp, const char *method, > int offset, int *num_fns, > - struct type **basetype, int *boffset) > + struct type **basetype, LONGEST *boffset) > { > struct type *t; > > @@ -2556,7 +2556,7 @@ find_overload_match (struct value **args, int nargs, > /* Number of overloaded instances being considered. */ > int num_fns = 0; > struct type *basetype = NULL; > - int boffset; > + LONGEST boffset; > > struct cleanup *all_cleanups = make_cleanup (null_cleanup, NULL); > > @@ -3263,7 +3263,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) > the form "DOMAIN::NAME". */ > > static struct value * > -value_struct_elt_for_reference (struct type *domain, int offset, > +value_struct_elt_for_reference (struct type *domain, LONGEST offset, > struct type *curtype, char *name, > struct type *intype, > int want_address, > @@ -3300,7 +3300,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, > if (want_address) > return value_from_longest > (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), > - offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3)); > + offset + (TYPE_FIELD_BITPOS (t, i) >> 3)); > else if (noside == EVAL_AVOID_SIDE_EFFECTS) > return allocate_value (TYPE_FIELD_TYPE (t, i)); > else > @@ -3443,7 +3443,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, > for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) > { > struct value *v; > - int base_offset; > + LONGEST base_offset; > > if (BASETYPE_VIA_VIRTUAL (t, i)) > base_offset = 0; > diff --git a/gdb/valprint.c b/gdb/valprint.c > index 325cf40..8f261f5 100644 > --- a/gdb/valprint.c > +++ b/gdb/valprint.c > @@ -261,7 +261,7 @@ scalar_type_p (struct type *type) > static int > valprint_check_validity (struct ui_file *stream, > struct type *type, > - int embedded_offset, > + LONGEST embedded_offset, > const struct value *val) > { > CHECK_TYPEDEF (type); > @@ -336,7 +336,7 @@ val_print_invalid_address (struct ui_file *stream) > characters printed. */ > > int > -val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > +val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > @@ -556,7 +556,7 @@ val_print_type_code_flags (struct type *type, const gdb_byte *valaddr, > > void > val_print_scalar_formatted (struct type *type, > - const gdb_byte *valaddr, int embedded_offset, > + const gdb_byte *valaddr, LONGEST embedded_offset, > const struct value *val, > const struct value_print_options *options, > int size, > @@ -1189,7 +1189,7 @@ maybe_print_array_index (struct type *index_type, LONGEST index, > > void > val_print_array_elements (struct type *type, > - const gdb_byte *valaddr, int embedded_offset, > + const gdb_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, > const struct value *val, > diff --git a/gdb/valprint.h b/gdb/valprint.h > index a34d09b..74326f7 100644 > --- a/gdb/valprint.h > +++ b/gdb/valprint.h > @@ -113,7 +113,7 @@ extern void maybe_print_array_index (struct type *index_type, LONGEST index, > struct ui_file *stream, > const struct value_print_options *); > > -extern void val_print_array_elements (struct type *, const gdb_byte *, int, > +extern void val_print_array_elements (struct type *, const gdb_byte *, LONGEST, > CORE_ADDR, struct ui_file *, int, > const struct value *, > const struct value_print_options *, > @@ -127,7 +127,7 @@ extern void val_print_type_code_flags (struct type *type, > struct ui_file *stream); > > extern void val_print_scalar_formatted (struct type *, > - const gdb_byte *, int, > + const gdb_byte *, LONGEST, > const struct value *, > const struct value_print_options *, > int, > diff --git a/gdb/value.c b/gdb/value.c > index 583be33..c56c22f 100644 > --- a/gdb/value.c > +++ b/gdb/value.c > @@ -66,7 +66,7 @@ struct internal_function > struct range > { > /* Lowest offset in the range. */ > - int offset; > + LONGEST offset; > > /* Length of the range. */ > int length; > @@ -80,8 +80,8 @@ DEF_VEC_O(range_s); > [offset2, offset2+len2) overlap. */ > > static int > -ranges_overlap (int offset1, int len1, > - int offset2, int len2) > +ranges_overlap (LONGEST offset1, int len1, > + LONGEST offset2, int len2) > { > ULONGEST h, l; > > @@ -105,7 +105,7 @@ range_lessthan (const range_s *r1, const range_s *r2) > OFFSET+LENGTH). */ > > static int > -ranges_contain (VEC(range_s) *ranges, int offset, int length) > +ranges_contain (VEC(range_s) *ranges, LONGEST offset, int length) > { > range_s what; > int i; > @@ -238,7 +238,7 @@ struct value > lval == lval_register, this is a further offset from > location.address within the registers structure. Note also the > member embedded_offset below. */ > - int offset; > + LONGEST offset; > > /* Only used for bitfields; number of bits contained in them. */ > int bitsize; > @@ -308,8 +308,8 @@ struct value > `type', and `embedded_offset' is zero, so everything works > normally. */ > struct type *enclosing_type; > - int embedded_offset; > - int pointed_to_offset; > + LONGEST embedded_offset; > + LONGEST pointed_to_offset; > > /* Values are stored in a chain, so that they can be deleted easily > over calls to the inferior. Values assigned to internal > @@ -331,7 +331,7 @@ struct value > }; > > int > -value_bytes_available (const struct value *value, int offset, int length) > +value_bytes_available (const struct value *value, LONGEST offset, int length) > { > gdb_assert (!value->lazy); > > @@ -352,7 +352,7 @@ value_entirely_available (struct value *value) > } > > void > -mark_value_bytes_unavailable (struct value *value, int offset, int length) > +mark_value_bytes_unavailable (struct value *value, LONGEST offset, int length) > { > range_s newr; > int i; > @@ -523,7 +523,7 @@ mark_value_bytes_unavailable (struct value *value, int offset, int length) > > static int > find_first_range_overlap (VEC(range_s) *ranges, int pos, > - int offset, int length) > + LONGEST offset, int length) > { > range_s *r; > int i; > @@ -536,8 +536,8 @@ find_first_range_overlap (VEC(range_s) *ranges, int pos, > } > > int > -value_available_contents_eq (const struct value *val1, int offset1, > - const struct value *val2, int offset2, > +value_available_contents_eq (const struct value *val1, LONGEST offset1, > + const struct value *val2, LONGEST offset2, > int length) > { > int idx1 = 0, idx2 = 0; > @@ -766,13 +766,13 @@ deprecated_set_value_type (struct value *value, struct type *type) > value->type = type; > } > > -int > +LONGEST > value_offset (const struct value *value) > { > return value->offset; > } > void > -set_value_offset (struct value *value, int offset) > +set_value_offset (struct value *value, LONGEST offset) > { > value->offset = offset; > } > @@ -874,8 +874,8 @@ value_contents_all (struct value *value) > DST_OFFSET+LENGTH) range are wholly available. */ > > void > -value_contents_copy_raw (struct value *dst, int dst_offset, > - struct value *src, int src_offset, int length) > +value_contents_copy_raw (struct value *dst, LONGEST dst_offset, > + struct value *src, LONGEST src_offset, int length) > { > range_s *r; > int i; > @@ -923,8 +923,8 @@ value_contents_copy_raw (struct value *dst, int dst_offset, > DST_OFFSET+LENGTH) range are wholly available. */ > > void > -value_contents_copy (struct value *dst, int dst_offset, > - struct value *src, int src_offset, int length) > +value_contents_copy (struct value *dst, LONGEST dst_offset, > + struct value *src, LONGEST src_offset, int length) > { > require_not_optimized_out (src); > > @@ -1019,7 +1019,7 @@ value_entirely_optimized_out (const struct value *value) > } > > int > -value_bits_valid (const struct value *value, int offset, int length) > +value_bits_valid (const struct value *value, LONGEST offset, int length) > { > if (!value->optimized_out) > return 1; > @@ -1032,7 +1032,7 @@ value_bits_valid (const struct value *value, int offset, int length) > > int > value_bits_synthetic_pointer (const struct value *value, > - int offset, int length) > + LONGEST offset, int length) > { > if (value->lval != lval_computed > || !value->location.computed.funcs->check_synthetic_pointer) > @@ -1042,26 +1042,26 @@ value_bits_synthetic_pointer (const struct value *value, > length); > } > > -int > +LONGEST > value_embedded_offset (struct value *value) > { > return value->embedded_offset; > } > > void > -set_value_embedded_offset (struct value *value, int val) > +set_value_embedded_offset (struct value *value, LONGEST val) > { > value->embedded_offset = val; > } > > -int > +LONGEST > value_pointed_to_offset (struct value *value) > { > return value->pointed_to_offset; > } > > void > -set_value_pointed_to_offset (struct value *value, int val) > +set_value_pointed_to_offset (struct value *value, LONGEST val) > { > value->pointed_to_offset = val; > } > @@ -1832,7 +1832,7 @@ get_internalvar_function (struct internalvar *var, > } > > void > -set_internalvar_component (struct internalvar *var, int offset, int bitpos, > +set_internalvar_component (struct internalvar *var, LONGEST offset, int bitpos, > int bitsize, struct value *newval) > { > gdb_byte *addr; > @@ -2496,7 +2496,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type) > FIELDNO says which field. */ > > struct value * > -value_primitive_field (struct value *arg1, int offset, > +value_primitive_field (struct value *arg1, LONGEST offset, > int fieldno, struct type *arg_type) > { > struct value *v; > @@ -2526,16 +2526,16 @@ value_primitive_field (struct value *arg1, int offset, > bit. Assume that the address, offset, and embedded offset > are sufficiently aligned. */ > > - int bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); > + LONGEST bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); > int container_bitsize = TYPE_LENGTH (type) * 8; > > v = allocate_value_lazy (type); > v->bitsize = TYPE_FIELD_BITSIZE (arg_type, fieldno); > if ((bitpos % container_bitsize) + v->bitsize <= container_bitsize > && TYPE_LENGTH (type) <= (int) sizeof (LONGEST)) > - v->bitpos = bitpos % container_bitsize; > + v->bitpos = (int)(bitpos % container_bitsize); Unneeded cast. (It is non-trivial but it seems correct it should fit in.) > else > - v->bitpos = bitpos % 8; > + v->bitpos = (int)(bitpos % 8); Unneeded cast. > v->offset = (value_embedded_offset (arg1) > + offset > + (bitpos - v->bitpos) / 8); > @@ -2614,7 +2614,7 @@ value_field (struct value *arg1, int fieldno) > struct value * > value_fn_field (struct value **arg1p, struct fn_field *f, > int j, struct type *type, > - int offset) > + LONGEST offset) > { > struct value *v; > struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); > @@ -2674,7 +2674,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, > > static int > unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, > - int embedded_offset, int bitpos, int bitsize, > + LONGEST embedded_offset, LONGEST bitpos, int bitsize, > const struct value *original_value, > LONGEST *result) > { > @@ -2683,13 +2683,13 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, > ULONGEST valmask; > int lsbcount; > int bytes_read; > - int read_offset; > + LONGEST read_offset; > > /* Read the minimum number of bytes required; there may not be > enough bytes to read an entire ULONGEST. */ > CHECK_TYPEDEF (field_type); > if (bitsize) > - bytes_read = ((bitpos % 8) + bitsize + 7) / 8; > + bytes_read = (int)(((bitpos % 8) + bitsize + 7) / 8); Unneeded cast. > else > bytes_read = TYPE_LENGTH (field_type); > > @@ -2706,9 +2706,9 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, > /* Extract bits. See comment above. */ > > if (gdbarch_bits_big_endian (get_type_arch (field_type))) > - lsbcount = (bytes_read * 8 - bitpos % 8 - bitsize); > + lsbcount = (int)(bytes_read * 8 - bitpos % 8 - bitsize); Unneeded cast. > else > - lsbcount = (bitpos % 8); > + lsbcount = (int)(bitpos % 8); Unneeded cast. > val >>= lsbcount; > > /* If the field does not entirely fill a LONGEST, then zero the sign bits. > @@ -2753,7 +2753,7 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, > > int > unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, > - int embedded_offset, int bitpos, int bitsize, > + LONGEST embedded_offset, int bitpos, int bitsize, > const struct value *original_value, > LONGEST *result) > { > @@ -2771,10 +2771,10 @@ unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, > > static int > unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, int fieldno, > + LONGEST embedded_offset, int fieldno, > const struct value *val, LONGEST *result) > { > - int bitpos = TYPE_FIELD_BITPOS (type, fieldno); > + LONGEST bitpos = TYPE_FIELD_BITPOS (type, fieldno); > int bitsize = TYPE_FIELD_BITSIZE (type, fieldno); > struct type *field_type = TYPE_FIELD_TYPE (type, fieldno); > > @@ -2790,7 +2790,7 @@ unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, > > int > unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, int fieldno, > + LONGEST embedded_offset, int fieldno, > const struct value *val, LONGEST *result) > { > gdb_assert (val != NULL); > @@ -2822,7 +2822,7 @@ unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno) > struct value * > value_field_bitfield (struct type *type, int fieldno, > const gdb_byte *valaddr, > - int embedded_offset, const struct value *val) > + LONGEST embedded_offset, const struct value *val) > { > LONGEST l; > > @@ -2842,23 +2842,23 @@ value_field_bitfield (struct type *type, int fieldno, > > /* Modify the value of a bitfield. ADDR points to a block of memory in > target byte order; the bitfield starts in the byte pointed to. FIELDVAL > - is the desired value of the field, in host byte order. BITPOS and BITSIZE > + is the desired value of the field, in host byte order. OFFSET and BITSIZE > indicate which bits (in target bit order) comprise the bitfield. > - Requires 0 < BITSIZE <= lbits, 0 <= BITPOS % 8 + BITSIZE <= lbits, and > - 0 <= BITPOS, where lbits is the size of a LONGEST in bits. */ > + Requires 0 < BITSIZE <= lbits, 0 <= OFFSET % 8 + BITSIZE <= lbits, and > + 0 <= OFFSET, where lbits is the size of a LONGEST in bits. */ > > void > modify_field (struct type *type, gdb_byte *addr, > - LONGEST fieldval, int bitpos, int bitsize) > + LONGEST fieldval, LONGEST offset, int bitsize) > { > enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); > ULONGEST oword; > ULONGEST mask = (ULONGEST) -1 >> (8 * sizeof (ULONGEST) - bitsize); > - int bytesize; > + int bitpos, bytesize; > > /* Normalize BITPOS. */ > - addr += bitpos / 8; > - bitpos %= 8; > + addr += offset / 8; > + bitpos = (int)(offset % 8); Unneeded cast. > > /* If a negative fieldval fits in the field in question, chop > off the sign extension bits. */ > diff --git a/gdb/value.h b/gdb/value.h > index 2a2274d..6eecbce 100644 > --- a/gdb/value.h > +++ b/gdb/value.h > @@ -81,8 +81,8 @@ struct value *value_parent (struct value *); > within the registers structure. Note also the member > embedded_offset below. */ > > -extern int value_offset (const struct value *); > -extern void set_value_offset (struct value *, int offset); > +extern LONGEST value_offset (const struct value *); > +extern void set_value_offset (struct value *, LONGEST offset); > > /* The comment from "struct value" reads: ``Is it modifiable? Only > relevant if lval != not_lval.''. Shouldn't the value instead be > @@ -137,10 +137,10 @@ extern struct type *value_enclosing_type (struct value *); > extern void set_value_enclosing_type (struct value *val, > struct type *new_type); > > -extern int value_pointed_to_offset (struct value *value); > -extern void set_value_pointed_to_offset (struct value *value, int val); > -extern int value_embedded_offset (struct value *value); > -extern void set_value_embedded_offset (struct value *value, int val); > +extern LONGEST value_pointed_to_offset (struct value *value); > +extern void set_value_pointed_to_offset (struct value *value, LONGEST val); > +extern LONGEST value_embedded_offset (struct value *value); > +extern void set_value_embedded_offset (struct value *value, LONGEST val); > > /* For lval_computed values, this structure holds functions used to > retrieve and set the value (or portions of the value). > @@ -168,7 +168,7 @@ struct lval_funcs > /* Check the validity of some bits in VALUE. This should return 1 > if all the bits starting at OFFSET and extending for LENGTH bits > are valid, or 0 if any bit is invalid. */ > - int (*check_validity) (const struct value *value, int offset, int length); > + int (*check_validity) (const struct value *value, LONGEST offset, int length); > > /* Return 1 if any bit in VALUE is valid, 0 if they are all invalid. */ > int (*check_any_valid) (const struct value *value); > @@ -186,7 +186,7 @@ struct lval_funcs > /* If non-NULL, this is used to determine whether the indicated bits > of VALUE are a synthetic pointer. */ > int (*check_synthetic_pointer) (const struct value *value, > - int offset, int length); > + LONGEST offset, int length); > > /* Return a duplicate of VALUE's closure, for use in a new value. > This may simply return the same closure, if VALUE's is > @@ -367,13 +367,13 @@ extern struct value *coerce_array (struct value *value); > bits in the given range are valid, zero if any bit is invalid. */ > > extern int value_bits_valid (const struct value *value, > - int offset, int length); > + LONGEST offset, int length); > > /* Given a value, determine whether the bits starting at OFFSET and > extending for LENGTH bits are a synthetic pointer. */ > > extern int value_bits_synthetic_pointer (const struct value *value, > - int offset, int length); > + LONGEST offset, int length); > > /* Given a value, determine whether the contents bytes starting at > OFFSET and extending for LENGTH bytes are available. This returns > @@ -381,7 +381,7 @@ extern int value_bits_synthetic_pointer (const struct value *value, > byte is unavailable. */ > > extern int value_bytes_available (const struct value *value, > - int offset, int length); > + LONGEST offset, int length); > > /* Like value_bytes_available, but return false if any byte in the > whole object is unavailable. */ > @@ -391,7 +391,7 @@ extern int value_entirely_available (struct value *value); > LENGTH bytes as unavailable. */ > > extern void mark_value_bytes_unavailable (struct value *value, > - int offset, int length); > + LONGEST offset, int length); > > /* Compare LENGTH bytes of VAL1's contents starting at OFFSET1 with > LENGTH bytes of VAL2's contents starting at OFFSET2. > @@ -423,8 +423,8 @@ extern void mark_value_bytes_unavailable (struct value *value, > value_available_contents_eq(val, 3, val, 4, 4) => 0 > */ > > -extern int value_available_contents_eq (const struct value *val1, int offset1, > - const struct value *val2, int offset2, > +extern int value_available_contents_eq (const struct value *val1, LONGEST offset1, > + const struct value *val2, LONGEST offset2, > int length); > > /* Read LENGTH bytes of memory starting at MEMADDR into BUFFER, which > @@ -461,7 +461,7 @@ extern CORE_ADDR unpack_pointer (struct type *type, const gdb_byte *valaddr); > > extern int unpack_value_bits_as_long (struct type *field_type, > const gdb_byte *valaddr, > - int embedded_offset, int bitpos, > + LONGEST embedded_offset, int bitpos, > int bitsize, > const struct value *original_value, > LONGEST *result); > @@ -470,12 +470,12 @@ extern LONGEST unpack_field_as_long (struct type *type, > const gdb_byte *valaddr, > int fieldno); > extern int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, int fieldno, > + LONGEST embedded_offset, int fieldno, > const struct value *val, LONGEST *result); > > extern struct value *value_field_bitfield (struct type *type, int fieldno, > const gdb_byte *valaddr, > - int embedded_offset, > + LONGEST embedded_offset, > const struct value *val); > > extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); > @@ -526,11 +526,11 @@ extern struct value *read_var_value (struct symbol *var, > extern struct value *allocate_value (struct type *type); > extern struct value *allocate_value_lazy (struct type *type); > extern void allocate_value_contents (struct value *value); > -extern void value_contents_copy (struct value *dst, int dst_offset, > - struct value *src, int src_offset, > +extern void value_contents_copy (struct value *dst, LONGEST dst_offset, > + struct value *src, LONGEST src_offset, > int length); > -extern void value_contents_copy_raw (struct value *dst, int dst_offset, > - struct value *src, int src_offset, > +extern void value_contents_copy_raw (struct value *dst, LONGEST dst_offset, > + struct value *src, LONGEST src_offset, > int length); > > extern struct value *allocate_repeat_value (struct type *type, int count); > @@ -597,7 +597,7 @@ extern struct value *value_static_field (struct type *type, int fieldno); > extern struct fn_field *value_find_oload_method_list (struct value **, > const char *, > int, int *, > - struct type **, int *); > + struct type **, LONGEST *); > > enum oload_search_type { NON_METHOD, METHOD, BOTH }; > > @@ -610,7 +610,7 @@ extern int find_overload_match (struct value **args, int nargs, > > extern struct value *value_field (struct value *arg1, int fieldno); > > -extern struct value *value_primitive_field (struct value *arg1, int offset, > +extern struct value *value_primitive_field (struct value *arg1, LONGEST offset, > int fieldno, > struct type *arg_type); > > @@ -709,7 +709,7 @@ extern void set_internalvar_string (struct internalvar *var, > extern void clear_internalvar (struct internalvar *var); > > extern void set_internalvar_component (struct internalvar *var, > - int offset, > + LONGEST offset, > int bitpos, int bitsize, > struct value *newvalue); > > @@ -747,7 +747,7 @@ extern struct value *value_x_unop (struct value *arg1, enum exp_opcode op, > enum noside noside); > > extern struct value *value_fn_field (struct value **arg1p, struct fn_field *f, > - int j, struct type *type, int offset); > + int j, struct type *type, LONGEST offset); > > extern int binop_types_user_defined_p (enum exp_opcode op, > struct type *type1, > @@ -775,7 +775,7 @@ extern void release_value_or_incref (struct value *val); > extern int record_latest_value (struct value *val); > > extern void modify_field (struct type *type, gdb_byte *addr, > - LONGEST fieldval, int bitpos, int bitsize); > + LONGEST fieldval, LONGEST bitpos, int bitsize); > > extern void type_print (struct type *type, const char *varstring, > struct ui_file *stream, int show); > @@ -805,7 +805,7 @@ extern void value_print_array_elements (struct value *val, > extern struct value *value_release_to_mark (struct value *mark); > > extern int val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > -- > 1.7.7.4 > Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct 2012-03-01 22:45 ` Jan Kratochvil @ 2012-03-05 6:34 ` Siddhesh Poyarekar 2012-03-05 8:05 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-03-05 6:34 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Tom Tromey, gdb-patches On Thu, Mar 01, 2012 at 11:44:28PM +0100, Jan Kratochvil wrote: > But to make this patch really working for struct offsets (and not just enum's) > one needs to also extend the type->length width. I am sorry but it will be > a big patch. OK, will work on this. > splint gives nice advices, thanks for the idea. I think it would not give a > warning if there is incorrectly used 'long' instead of LONGEST'. I think it should give this warning on ia32, since there is a storage size mismatch there. That said, I need to test on 32-bit the next time too. > > - ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, end - start)); > > + ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, (int)(end - start))); > > Here I think ax_zero_ext and ax_ext should use LONGEST instead of the cast. > (OK, one may argue a bit about it.) > The reason I cast it down to INT is because the eventual call to generic_ext() requires N to be between 0 and 255. But I guess we might want to keep the value intact to catch any internal bugs that may trigger this? Thanks for your very detailed review. I'll fix up the patch and also expand type->length. -- Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct 2012-03-05 6:34 ` Siddhesh Poyarekar @ 2012-03-05 8:05 ` Jan Kratochvil 2012-03-21 10:06 ` [PATCH] Allow 64-bit enum values Siddhesh Poyarekar 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-03-05 8:05 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Tom Tromey, gdb-patches On Mon, 05 Mar 2012 07:35:43 +0100, Siddhesh Poyarekar wrote: > On Thu, Mar 01, 2012 at 11:44:28PM +0100, Jan Kratochvil wrote: > > warning if there is incorrectly used 'long' instead of LONGEST'. > > I think it should give this warning on ia32, since there is a storage > size mismatch there. That said, I need to test on 32-bit the next time > too. True, good idea. > > > - ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, end - start)); > > > + ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, (int)(end - start))); > > > > Here I think ax_zero_ext and ax_ext should use LONGEST instead of the cast. > > (OK, one may argue a bit about it.) > > The reason I cast it down to INT is because the eventual call to > generic_ext() requires N to be between 0 and 255. But I guess we might > want to keep the value intact to catch any internal bugs that may > trigger this? Yes, I meant that. > Thanks for your very detailed review. I'll fix up the patch and also > expand type->length. Maybe you can keep that patch as a separate one; but I do not mind much. Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* [PATCH] Allow 64-bit enum values 2012-03-05 8:05 ` Jan Kratochvil @ 2012-03-21 10:06 ` Siddhesh Poyarekar 2012-03-27 17:00 ` Jan Kratochvil ` (2 more replies) 0 siblings, 3 replies; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-03-21 10:06 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Tom Tromey, gdb-patches Hi, I took a separate approach from the one I took in: http://sourceware.org/ml/gdb-patches/2012-02/msg00403.html and removed the overloaded meaning of the bitpos location variable to fix PR symtab/7259. In the following patch, I introduce a separate field_location union member 'enumval' which can accept LONGEST and hence expand enum values to 64-bit signed values. With this change, bitpos now only is used for (non-negative) offsets into structures, since the other overload of bitpos (range bounds) were already separated into struct range_bound. I have used the enum test from the PR here, so I will try to write another test for the bitpos expansion for large struct offsets. Regards, Siddhesh ChangeLog: 2012-03-21 Siddhesh Poyarekar <siddhesh@redhat.com> PR symtab/7259: * gdbtypes.h (enum field_loc_kind): New FIELD_LOC_KIND_ENUMVAL. (struct main_type.fields): Adjust loc_kind and bitsize to accommodate FIELD_LOC_KIND_ENUMVAL. (struct main_type.fields.field_location): New enumval. New macros: FIELD_ENUMVAL, SET_FIELD_ENUMVAL and TYPE_FIELD_ENUMVAL. * ada-exp.y (convert_char_literal): use TYPE_FIELD_ENUMVAL. * ada-lang.c (ada_discrete_type_high_bound): Ditto. (ada_discrete_type_low_bound, value_val_atr): Ditto. (ada_identical_enum_types_p, pos_atr): Ditto. * ada-typeprint.c (print_enum_type): Ditto. * ada-valprint.c (print_optional_low_bound): Ditto. (ada_print_scalar, ada_val_print_1): Ditto. * c-typeprint.c (c_type_print_base): Ditto. * coffread.c (coff_read_enum_type): Ditto. * dwarf2read.c (process_enumeration_scope): Ditto. * gdb-gdb.py (class StructMainTypePrettyPrinter): Ditto. * gdbtypes.c (get_discrete_bounds): Ditto (recursive_dump_type, copy_type_recursive): Ditto. * m2-typeprint.c (m2_enum): Ditto. * mdebugread.c (parse_symbol): Ditto. * p-typeprint.c (pascal_type_print_base): Ditto. * python/py-type.c (check_types_equal): Ditto. * stabsread.c (read_enum_type): Ditto. * typepint.c (print_type_scalar): Ditto. * valprint.c (generic_val_print): Ditto. testsuite/ChangeLog: 2012-03-21 Siddhesh Poyarekar <siddhesh@redhat.com> PR symtab/7259: * gdb.base/enumval.exp: New test case. * gdb.base/enumval.c: New test case. diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 226cc1d..ef052d7 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1458,7 +1458,7 @@ convert_char_literal (struct type *type, LONGEST val) for (f = 0; f < TYPE_NFIELDS (type); f += 1) { if (strcmp (name, TYPE_FIELD_NAME (type, f)) == 0) - return TYPE_FIELD_BITPOS (type, f); + return TYPE_FIELD_ENUMVAL (type, f); } return val; } diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 78a0261..5d77b1a 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -690,7 +690,7 @@ ada_discrete_type_high_bound (struct type *type) case TYPE_CODE_RANGE: return TYPE_HIGH_BOUND (type); case TYPE_CODE_ENUM: - return TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) - 1); + return TYPE_FIELD_ENUMVAL (type, TYPE_NFIELDS (type) - 1); case TYPE_CODE_BOOL: return 1; case TYPE_CODE_CHAR: @@ -701,7 +701,7 @@ ada_discrete_type_high_bound (struct type *type) } } -/* The largest value in the domain of TYPE, a discrete type, as an integer. */ +/* The smallest value in the domain of TYPE, a discrete type, as an integer. */ LONGEST ada_discrete_type_low_bound (struct type *type) { @@ -710,7 +710,7 @@ ada_discrete_type_low_bound (struct type *type) case TYPE_CODE_RANGE: return TYPE_LOW_BOUND (type); case TYPE_CODE_ENUM: - return TYPE_FIELD_BITPOS (type, 0); + return TYPE_FIELD_ENUMVAL (type, 0); case TYPE_CODE_BOOL: return 0; case TYPE_CODE_CHAR: @@ -4479,7 +4479,7 @@ ada_identical_enum_types_p (struct type *type1, struct type *type2) /* All enums in the type should have an identical underlying value. */ for (i = 0; i < TYPE_NFIELDS (type1); i++) - if (TYPE_FIELD_BITPOS (type1, i) != TYPE_FIELD_BITPOS (type2, i)) + if (TYPE_FIELD_ENUMVAL (type1, i) != TYPE_FIELD_ENUMVAL (type2, i)) return 0; /* All enumerals should also have the same name (modulo any numerical @@ -8284,7 +8284,7 @@ pos_atr (struct value *arg) for (i = 0; i < TYPE_NFIELDS (type); i += 1) { - if (v == TYPE_FIELD_BITPOS (type, i)) + if (v == TYPE_FIELD_ENUMVAL (type, i)) return i; } error (_("enumeration value is invalid: can't find 'POS")); @@ -8315,7 +8315,7 @@ value_val_atr (struct type *type, struct value *arg) if (pos < 0 || pos >= TYPE_NFIELDS (type)) error (_("argument to 'VAL out of range")); - return value_from_longest (type, TYPE_FIELD_BITPOS (type, pos)); + return value_from_longest (type, TYPE_FIELD_ENUMVAL (type, pos)); } else return value_from_longest (type, value_as_long (arg)); diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index 5599278..40f3058 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -274,7 +274,8 @@ static void print_enum_type (struct type *type, struct ui_file *stream) { int len = TYPE_NFIELDS (type); - int i, lastval; + int i; + LONGEST lastval; fprintf_filtered (stream, "("); wrap_here (" "); @@ -287,10 +288,11 @@ print_enum_type (struct type *type, struct ui_file *stream) fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (ada_enum_name (TYPE_FIELD_NAME (type, i)), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " => %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " => %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval += 1; } diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index a8351dd..72c6863 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -109,7 +109,7 @@ print_optional_low_bound (struct ui_file *stream, struct type *type, return 0; break; case TYPE_CODE_ENUM: - if (low_bound == TYPE_FIELD_BITPOS (index_type, 0)) + if (low_bound == TYPE_FIELD_ENUMVAL (index_type, 0)) return 0; break; case TYPE_CODE_UNDEF: @@ -402,7 +402,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) len = TYPE_NFIELDS (type); for (i = 0; i < len; i++) { - if (TYPE_FIELD_BITPOS (type, i) == val) + if (TYPE_FIELD_ENUMVAL (type, i) == val) { break; } @@ -822,7 +822,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, for (i = 0; i < len; i++) { QUIT; - if (val == TYPE_FIELD_BITPOS (type, i)) + if (val == TYPE_FIELD_ENUMVAL (type, i)) { break; } diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 21887c6..7de7b12 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -717,7 +717,6 @@ c_type_print_base (struct type *type, struct ui_file *stream, { int i; int len, real_len; - int lastval; enum { s_none, s_public, s_private, s_protected @@ -1194,9 +1193,9 @@ c_type_print_base (struct type *type, struct ui_file *stream, } else if (show > 0 || TYPE_TAG_NAME (type) == NULL) { + LONGEST lastval = 0; fprintf_filtered (stream, "{"); len = TYPE_NFIELDS (type); - lastval = 0; for (i = 0; i < len; i++) { QUIT; @@ -1204,11 +1203,11 @@ c_type_print_base (struct type *type, struct ui_file *stream, fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " = %d", - TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " = %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } diff --git a/gdb/coffread.c b/gdb/coffread.c index 30bf3f7..7c59535 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -2159,7 +2159,7 @@ coff_read_enum_type (int index, int length, int lastsym, SYMBOL_TYPE (xsym) = type; TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym); - SET_FIELD_BITPOS (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); + SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); if (SYMBOL_VALUE (xsym) < 0) unsigned_enum = 0; TYPE_FIELD_BITSIZE (type, n) = 0; diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 4b49484..9fa7678 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8047,7 +8047,7 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) FIELD_NAME (fields[num_fields]) = SYMBOL_LINKAGE_NAME (sym); FIELD_TYPE (fields[num_fields]) = NULL; - SET_FIELD_BITPOS (fields[num_fields], SYMBOL_VALUE (sym)); + SET_FIELD_ENUMVAL (fields[num_fields], SYMBOL_VALUE (sym)); FIELD_BITSIZE (fields[num_fields]) = 0; num_fields++; diff --git a/gdb/gdb-gdb.py b/gdb/gdb-gdb.py index 579500f..013bcbb 100644 --- a/gdb/gdb-gdb.py +++ b/gdb/gdb-gdb.py @@ -154,6 +154,8 @@ class StructMainTypePrettyPrinter: loc_kind = str(field_val['loc_kind']) if loc_kind == "FIELD_LOC_KIND_BITPOS": return 'bitpos = %d' % loc_val['bitpos'] + elif loc_kind == "FIELD_LOC_KIND_ENUMVAL": + return 'enumval = %d' % loc_val['enumval'] elif loc_kind == "FIELD_LOC_KIND_PHYSADDR": return 'physaddr = 0x%x' % loc_val['physaddr'] elif loc_kind == "FIELD_LOC_KIND_PHYSNAME": diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index b6e8b4c..a55d93b 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -775,13 +775,13 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp) entries. */ int i; - *lowp = *highp = TYPE_FIELD_BITPOS (type, 0); + *lowp = *highp = TYPE_FIELD_ENUMVAL (type, 0); for (i = 0; i < TYPE_NFIELDS (type); i++) { - if (TYPE_FIELD_BITPOS (type, i) < *lowp) - *lowp = TYPE_FIELD_BITPOS (type, i); - if (TYPE_FIELD_BITPOS (type, i) > *highp) - *highp = TYPE_FIELD_BITPOS (type, i); + if (TYPE_FIELD_ENUMVAL (type, i) < *lowp) + *lowp = TYPE_FIELD_ENUMVAL (type, i); + if (TYPE_FIELD_ENUMVAL (type, i) > *highp) + *highp = TYPE_FIELD_ENUMVAL (type, i); } /* Set unsigned indicator if warranted. */ @@ -3197,10 +3197,15 @@ recursive_dump_type (struct type *type, int spaces) puts_filtered ("\n"); for (idx = 0; idx < TYPE_NFIELDS (type); idx++) { - printfi_filtered (spaces + 2, - "[%d] bitpos %d bitsize %d type ", - idx, TYPE_FIELD_BITPOS (type, idx), - TYPE_FIELD_BITSIZE (type, idx)); + if (TYPE_CODE (type) == TYPE_CODE_ENUM) + printfi_filtered (spaces + 2, + "[%d] enumval %s type ", + idx, plongest (TYPE_FIELD_ENUMVAL (type, idx))); + else + printfi_filtered (spaces + 2, + "[%d] bitpos %d bitsize %d type ", + idx, TYPE_FIELD_BITPOS (type, idx), + TYPE_FIELD_BITSIZE (type, idx)); gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); printf_filtered (" name '%s' (", TYPE_FIELD_NAME (type, idx) != NULL @@ -3397,6 +3402,10 @@ copy_type_recursive (struct objfile *objfile, SET_FIELD_BITPOS (TYPE_FIELD (new_type, i), TYPE_FIELD_BITPOS (type, i)); break; + case FIELD_LOC_KIND_ENUMVAL: + SET_FIELD_ENUMVAL (TYPE_FIELD (new_type, i), + TYPE_FIELD_ENUMVAL (type, i)); + break; case FIELD_LOC_KIND_PHYSADDR: SET_FIELD_PHYSADDR (TYPE_FIELD (new_type, i), TYPE_FIELD_STATIC_PHYSADDR (type, i)); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 07c3a86..01c62a5 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -351,6 +351,7 @@ enum type_instance_flag_value enum field_loc_kind { FIELD_LOC_KIND_BITPOS, /* bitpos */ + FIELD_LOC_KIND_ENUMVAL, /* enumval */ FIELD_LOC_KIND_PHYSADDR, /* physaddr */ FIELD_LOC_KIND_PHYSNAME, /* physname */ FIELD_LOC_KIND_DWARF_BLOCK /* dwarf_block */ @@ -511,11 +512,13 @@ struct main_type containing structure. For gdbarch_bits_big_endian=1 targets, it is the bit offset to the MSB. For gdbarch_bits_big_endian=0 targets, it is the bit offset to - the LSB. For a range bound or enum value, this is the - value itself. */ + the LSB. */ int bitpos; + /* Enum value. */ + LONGEST enumval; + /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr is the location (in the target) of the static field. Otherwise, physname is the mangled label of the static field. */ @@ -538,7 +541,7 @@ struct main_type unsigned int artificial : 1; /* Discriminant for union field_location. */ - ENUM_BITFIELD(field_loc_kind) loc_kind : 2; + ENUM_BITFIELD(field_loc_kind) loc_kind : 3; /* Size of this field, in bits, or zero if not packed. If non-zero in an array type, indicates the element size in @@ -546,7 +549,7 @@ struct main_type For an unpacked field, the field's type's length says how many bytes the field occupies. */ - unsigned int bitsize : 29; + unsigned int bitsize : 28; /* In a struct or union type, type of this field. In a function or member type, type of this argument. @@ -931,7 +934,7 @@ struct call_site union field_location loc; /* Discriminant for union field_location. */ - ENUM_BITFIELD(field_loc_kind) loc_kind : 2; + ENUM_BITFIELD(field_loc_kind) loc_kind : 3; } target; @@ -1088,12 +1091,16 @@ extern void allocate_gnat_aux_type (struct type *); #define FIELD_NAME(thisfld) ((thisfld).name) #define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind) #define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos) +#define FIELD_ENUMVAL(thisfld) ((thisfld).loc.enumval) #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) #define SET_FIELD_BITPOS(thisfld, bitpos) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \ FIELD_BITPOS (thisfld) = (bitpos)) +#define SET_FIELD_ENUMVAL(thisfld, enumval) \ + (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_ENUMVAL, \ + FIELD_ENUMVAL (thisfld) = (enumval)) #define SET_FIELD_PHYSNAME(thisfld, name) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -1111,6 +1118,7 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n)) #define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) +#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n)) diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index 9735d7f..fb3d49c 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -607,10 +607,11 @@ m2_enum (struct type *type, struct ui_file *stream, int show, int level) fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " = %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 299e94c..a20f953 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1047,7 +1047,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, if (tsym.st != stMember) break; - SET_FIELD_BITPOS (*f, tsym.value); + SET_FIELD_ENUMVAL (*f, tsym.value); FIELD_TYPE (*f) = t; FIELD_NAME (*f) = debug_info->ss + cur_fdr->issBase + tsym.iss; FIELD_BITSIZE (*f) = 0; diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index bc24495..a00f5b3 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -750,11 +750,12 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { fprintf_filtered (stream, - " := %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + " := %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index d47d4c8..701c457 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -1018,6 +1018,10 @@ check_types_equal (struct type *type1, struct type *type2, if (FIELD_BITPOS (*field1) != FIELD_BITPOS (*field2)) return Py_NE; break; + case FIELD_LOC_KIND_ENUMVAL: + if (FIELD_ENUMVAL (*field1) != FIELD_ENUMVAL (*field2)) + return Py_NE; + break; case FIELD_LOC_KIND_PHYSADDR: if (FIELD_STATIC_PHYSADDR (*field1) != FIELD_STATIC_PHYSADDR (*field2)) diff --git a/gdb/stabsread.c b/gdb/stabsread.c index ac82652..bfd6c2e 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -3730,7 +3730,7 @@ read_enum_type (char **pp, struct type *type, SYMBOL_TYPE (xsym) = type; TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym); - TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym); + TYPE_FIELD_ENUMVAL (type, n) = SYMBOL_VALUE (xsym); TYPE_FIELD_BITSIZE (type, n) = 0; } if (syms == osyms) diff --git a/gdb/testsuite/gdb.base/enumval.c b/gdb/testsuite/gdb.base/enumval.c new file mode 100644 index 0000000..790d86c --- /dev/null +++ b/gdb/testsuite/gdb.base/enumval.c @@ -0,0 +1,30 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +enum e { I, J = 0xffffffffU } e = J; + +void +dummy() +{ +} + +int +main(void) +{ + dummy(); + return 0; +} diff --git a/gdb/testsuite/gdb.base/enumval.exp b/gdb/testsuite/gdb.base/enumval.exp new file mode 100644 index 0000000..5ec7950 --- /dev/null +++ b/gdb/testsuite/gdb.base/enumval.exp @@ -0,0 +1,29 @@ +# This testcase is part of GDB, the GNU debugger. + +# Copyright 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set testfile "enumval" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +if { [prepare_for_testing enumval.exp "enumval" "" {debug}] } { + return -1 +} + +# Check the real contents. +gdb_test "print e" "= J" + +gdb_test "print J" "= J" diff --git a/gdb/typeprint.c b/gdb/typeprint.c index f257f47..c25e705 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -206,7 +206,7 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream) len = TYPE_NFIELDS (type); for (i = 0; i < len; i++) { - if (TYPE_FIELD_BITPOS (type, i) == val) + if (TYPE_FIELD_ENUMVAL (type, i) == val) { break; } diff --git a/gdb/valprint.c b/gdb/valprint.c index 0037cb9..fdbd3e6 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -453,7 +453,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr, for (i = 0; i < len; i++) { QUIT; - if (val == TYPE_FIELD_BITPOS (type, i)) + if (val == TYPE_FIELD_ENUMVAL (type, i)) { break; } @@ -474,13 +474,13 @@ generic_val_print (struct type *type, const gdb_byte *valaddr, { QUIT; - if ((val & TYPE_FIELD_BITPOS (type, i)) != 0) + if ((val & TYPE_FIELD_ENUMVAL (type, i)) != 0) { if (!first) fputs_filtered (" | ", stream); first = 0; - val &= ~TYPE_FIELD_BITPOS (type, i); + val &= ~TYPE_FIELD_ENUMVAL (type, i); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); } } ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Allow 64-bit enum values 2012-03-21 10:06 ` [PATCH] Allow 64-bit enum values Siddhesh Poyarekar @ 2012-03-27 17:00 ` Jan Kratochvil 2012-03-28 4:19 ` Siddhesh Poyarekar 2012-03-28 16:55 ` [PATCH] Allow 64-bit enum values Tom Tromey 2012-04-17 13:11 ` [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] Jan Kratochvil 2 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-03-27 17:00 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Tom Tromey, gdb-patches On Wed, 21 Mar 2012 11:06:32 +0100, Siddhesh Poyarekar wrote: > I took a separate approach from the one I took in: > > http://sourceware.org/ml/gdb-patches/2012-02/msg00403.html > > and removed the overloaded meaning of the bitpos location variable to > fix PR symtab/7259. In the following patch, I introduce a separate > field_location union member 'enumval' which can accept LONGEST and > hence expand enum values to 64-bit signed values. With this change, > bitpos now only is used for (non-negative) offsets into structures, > since the other overload of bitpos (range bounds) were already > separated into struct range_bound. Sorry for respoding so late but what is the point of this enum and offsets separation? Both need to become 64bit anyway so why to separate them? Or you find it a better coding style this way? Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Allow 64-bit enum values 2012-03-27 17:00 ` Jan Kratochvil @ 2012-03-28 4:19 ` Siddhesh Poyarekar 2012-03-30 16:15 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-03-28 4:19 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Tom Tromey, gdb-patches On Tue, 27 Mar 2012 18:59:50 +0200 Jan Kratochvil <jan.kratochvil@redhat.com> wrote: > Sorry for respoding so late but what is the point of this enum and > offsets separation? Both need to become 64bit anyway so why to > separate them? > > Or you find it a better coding style this way? Better coding style is one of the reasons, to make the meaning of the elements unambiguous. The main reason for this separation is to match the types of bitpos and type.length exactly to retain the possibility of a typedef'd struct for their type. Something like: typedef struct { ULONGEST val; } struct_off_t; #define STRUCT_OFF_VAL(s) ((s).val) #define TYPE_LENGTH_VAL(t) STRUCT_OFF_VAL(TYPE_LENGTH(t)) #define TYPE_FIELD_BITPOS_VAL(t) STRUCT_OFF_VAL(TYPE_FIELD_BITPOS(t)) and do arithmetic like this: --- struct_off_t offset; return TYPE_LENGTH_VAL(t) + STRUCT_OFF_VAL(offset) - TYPE_FIELD_BITPOS_VAL(t) --- I hope this is OK. Regards, Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Allow 64-bit enum values 2012-03-28 4:19 ` Siddhesh Poyarekar @ 2012-03-30 16:15 ` Jan Kratochvil 2012-04-17 14:01 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-03-30 16:15 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Tom Tromey, gdb-patches Hi Siddhesh, On Wed, 28 Mar 2012 06:20:37 +0200, Siddhesh Poyarekar wrote: > and do arithmetic like this: > > --- > struct_off_t offset; > > return TYPE_LENGTH_VAL(t) + STRUCT_OFF_VAL(offset) > - TYPE_FIELD_BITPOS_VAL(t) > --- FYI I posted first before this method gets generally approved: Will therefore GDB utilize C++ or not? http://sourceware.org/ml/gdb/2012-03/msg00087.html Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Allow 64-bit enum values 2012-03-30 16:15 ` Jan Kratochvil @ 2012-04-17 14:01 ` Jan Kratochvil 2012-04-18 2:53 ` Siddhesh Poyarekar 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-04-17 14:01 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Tom Tromey, gdb-patches Hi Siddhesh, On Fri, 30 Mar 2012 18:15:21 +0200, Jan Kratochvil wrote: > FYI I posted first before this method gets generally approved: > Will therefore GDB utilize C++ or not? > http://sourceware.org/ml/gdb/2012-03/msg00087.html According to Tom it should the review should not depend on C++ so: I made there these changes, particularly to really test 64-bit enums: ### a/gdb/gdbtypes.c - TYPE_FIELD_ENUMVAL (type, i)); + TYPE_FIELD_ENUMVAL (type, i)); ### a/gdb/python/py-type.c - if (TYPE_CODE(type) == TYPE_CODE_ENUM) + if (TYPE_CODE (type) == TYPE_CODE_ENUM) - arg = PyLong_FromLong (TYPE_FIELD_ENUMVAL (type, field)); + arg = gdb_py_long_from_longest (TYPE_FIELD_ENUMVAL (type, field)); ### a/gdb/testsuite/gdb.base/enumval.c -enum e { I, J = 0xffffffffU } e = J; +enum e { I, J = 0xffffffffU, K = 0xf000000000000000ULL } e = J, f = K; ### a/gdb/testsuite/gdb.base/enumval.exp +gdb_test "print f" "= K" +gdb_test "print K" "= K" The patch needs small rebase on HEAD due to other changes and due to: [commit] Do not rely on FIELD_LOC_KIND_BITPOS being zero http://sourceware.org/ml/gdb-patches/2012-04/msg00460.html and it should be checked in along with: [patch!] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] http://sourceware.org/ml/gdb-patches/2012-04/msg00463.html OK to check it in with these changes. Thanks, Jan gdb/ 2012-03-21 Siddhesh Poyarekar <siddhesh@redhat.com> PR symtab/7259: * gdbtypes.h (enum field_loc_kind): New FIELD_LOC_KIND_ENUMVAL. (struct main_type.fields): Adjust loc_kind and bitsize to accommodate FIELD_LOC_KIND_ENUMVAL. (struct main_type.fields.field_location): New enumval. New macros: FIELD_ENUMVAL, SET_FIELD_ENUMVAL and TYPE_FIELD_ENUMVAL. * ada-exp.y (convert_char_literal): use TYPE_FIELD_ENUMVAL if type is TYPE_CODE_ENUM. * ada-lang.c (ada_discrete_type_high_bound): Ditto. (ada_discrete_type_low_bound, value_val_atr): Ditto. (ada_identical_enum_types_p, pos_atr): Ditto. * ada-typeprint.c (print_enum_type): Ditto. * ada-valprint.c (print_optional_low_bound): Ditto. (ada_print_scalar, ada_val_print_1): Ditto. * c-typeprint.c (c_type_print_base): Ditto. * coffread.c (coff_read_enum_type): Ditto. * dwarf2read.c (process_enumeration_scope): Ditto. * gdbtypes.c (get_discrete_bounds): Ditto (recursive_dump_type, copy_type_recursive): Ditto. * m2-typeprint.c (m2_enum): Ditto. * mdebugread.c (parse_symbol): Ditto. * p-typeprint.c (pascal_type_print_base): Ditto. * python/py-type.c (check_types_equal, convert_field): Ditto. * stabsread.c (read_enum_type): Ditto. * typepint.c (print_type_scalar): Ditto. * valprint.c (generic_val_print): Ditto. * gdb-gdb.py (class StructMainTypePrettyPrinter): Ditto. (TypeFlagsPrinter): Use field.enumval instead of field.bitpos. * python/lib/gdb/printing.py (FlagEnumerationPrinter): Ditto. * python/lib/gdb/types.py (make_enum_dict): Ditto. testsuite/ 2012-03-21 Siddhesh Poyarekar <siddhesh@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> PR symtab/7259: * gdb.base/enumval.exp: New test case. * gdb.base/enumval.c: New test case. * gdb.python/py-type.exp (test_enums): Modify test to look for field.enumval instead of field.bitpos. diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 36ef3d4..1a80b0b 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1463,7 +1463,7 @@ convert_char_literal (struct type *type, LONGEST val) for (f = 0; f < TYPE_NFIELDS (type); f += 1) { if (strcmp (name, TYPE_FIELD_NAME (type, f)) == 0) - return TYPE_FIELD_BITPOS (type, f); + return TYPE_FIELD_ENUMVAL (type, f); } return val; } diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 2e1df7a..52e1e59 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -690,7 +690,7 @@ ada_discrete_type_high_bound (struct type *type) case TYPE_CODE_RANGE: return TYPE_HIGH_BOUND (type); case TYPE_CODE_ENUM: - return TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) - 1); + return TYPE_FIELD_ENUMVAL (type, TYPE_NFIELDS (type) - 1); case TYPE_CODE_BOOL: return 1; case TYPE_CODE_CHAR: @@ -701,7 +701,7 @@ ada_discrete_type_high_bound (struct type *type) } } -/* The largest value in the domain of TYPE, a discrete type, as an integer. */ +/* The smallest value in the domain of TYPE, a discrete type, as an integer. */ LONGEST ada_discrete_type_low_bound (struct type *type) { @@ -710,7 +710,7 @@ ada_discrete_type_low_bound (struct type *type) case TYPE_CODE_RANGE: return TYPE_LOW_BOUND (type); case TYPE_CODE_ENUM: - return TYPE_FIELD_BITPOS (type, 0); + return TYPE_FIELD_ENUMVAL (type, 0); case TYPE_CODE_BOOL: return 0; case TYPE_CODE_CHAR: @@ -4479,7 +4479,7 @@ ada_identical_enum_types_p (struct type *type1, struct type *type2) /* All enums in the type should have an identical underlying value. */ for (i = 0; i < TYPE_NFIELDS (type1); i++) - if (TYPE_FIELD_BITPOS (type1, i) != TYPE_FIELD_BITPOS (type2, i)) + if (TYPE_FIELD_ENUMVAL (type1, i) != TYPE_FIELD_ENUMVAL (type2, i)) return 0; /* All enumerals should also have the same name (modulo any numerical @@ -8298,7 +8298,7 @@ pos_atr (struct value *arg) for (i = 0; i < TYPE_NFIELDS (type); i += 1) { - if (v == TYPE_FIELD_BITPOS (type, i)) + if (v == TYPE_FIELD_ENUMVAL (type, i)) return i; } error (_("enumeration value is invalid: can't find 'POS")); @@ -8329,7 +8329,7 @@ value_val_atr (struct type *type, struct value *arg) if (pos < 0 || pos >= TYPE_NFIELDS (type)) error (_("argument to 'VAL out of range")); - return value_from_longest (type, TYPE_FIELD_BITPOS (type, pos)); + return value_from_longest (type, TYPE_FIELD_ENUMVAL (type, pos)); } else return value_from_longest (type, value_as_long (arg)); diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index 5599278..40f3058 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -274,7 +274,8 @@ static void print_enum_type (struct type *type, struct ui_file *stream) { int len = TYPE_NFIELDS (type); - int i, lastval; + int i; + LONGEST lastval; fprintf_filtered (stream, "("); wrap_here (" "); @@ -287,10 +288,11 @@ print_enum_type (struct type *type, struct ui_file *stream) fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (ada_enum_name (TYPE_FIELD_NAME (type, i)), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " => %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " => %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval += 1; } diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 1ec62ce..95ec7ec 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -109,7 +109,7 @@ print_optional_low_bound (struct ui_file *stream, struct type *type, return 0; break; case TYPE_CODE_ENUM: - if (low_bound == TYPE_FIELD_BITPOS (index_type, 0)) + if (low_bound == TYPE_FIELD_ENUMVAL (index_type, 0)) return 0; break; case TYPE_CODE_UNDEF: @@ -402,7 +402,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) len = TYPE_NFIELDS (type); for (i = 0; i < len; i++) { - if (TYPE_FIELD_BITPOS (type, i) == val) + if (TYPE_FIELD_ENUMVAL (type, i) == val) { break; } @@ -824,7 +824,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, for (i = 0; i < len; i++) { QUIT; - if (val == TYPE_FIELD_BITPOS (type, i)) + if (val == TYPE_FIELD_ENUMVAL (type, i)) { break; } diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 21887c6..7de7b12 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -717,7 +717,6 @@ c_type_print_base (struct type *type, struct ui_file *stream, { int i; int len, real_len; - int lastval; enum { s_none, s_public, s_private, s_protected @@ -1194,9 +1193,9 @@ c_type_print_base (struct type *type, struct ui_file *stream, } else if (show > 0 || TYPE_TAG_NAME (type) == NULL) { + LONGEST lastval = 0; fprintf_filtered (stream, "{"); len = TYPE_NFIELDS (type); - lastval = 0; for (i = 0; i < len; i++) { QUIT; @@ -1204,11 +1203,11 @@ c_type_print_base (struct type *type, struct ui_file *stream, fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " = %d", - TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " = %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } diff --git a/gdb/coffread.c b/gdb/coffread.c index 30bf3f7..7c59535 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -2159,7 +2159,7 @@ coff_read_enum_type (int index, int length, int lastsym, SYMBOL_TYPE (xsym) = type; TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym); - SET_FIELD_BITPOS (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); + SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); if (SYMBOL_VALUE (xsym) < 0) unsigned_enum = 0; TYPE_FIELD_BITSIZE (type, n) = 0; diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index d237efb..fdb87aa 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8047,7 +8047,7 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) FIELD_NAME (fields[num_fields]) = SYMBOL_LINKAGE_NAME (sym); FIELD_TYPE (fields[num_fields]) = NULL; - SET_FIELD_BITPOS (fields[num_fields], SYMBOL_VALUE (sym)); + SET_FIELD_ENUMVAL (fields[num_fields], SYMBOL_VALUE (sym)); FIELD_BITSIZE (fields[num_fields]) = 0; num_fields++; diff --git a/gdb/gdb-gdb.py b/gdb/gdb-gdb.py index 579500f..1ea03ce 100644 --- a/gdb/gdb-gdb.py +++ b/gdb/gdb-gdb.py @@ -99,10 +99,10 @@ class TypeFlagsPrinter: return # Note: TYPE_FLAG_MIN is a duplicate of TYPE_FLAG_UNSIGNED, # so exclude it from the list we are building. - TYPE_FLAGS = [TypeFlag(field.name, field.bitpos) + TYPE_FLAGS = [TypeFlag(field.name, field.enumval) for field in flags.fields() if field.name != 'TYPE_FLAG_MIN'] - TYPE_FLAGS += [TypeFlag(field.name, field.bitpos) + TYPE_FLAGS += [TypeFlag(field.name, field.enumval) for field in iflags.fields()] TYPE_FLAGS.sort() @@ -154,6 +154,8 @@ class StructMainTypePrettyPrinter: loc_kind = str(field_val['loc_kind']) if loc_kind == "FIELD_LOC_KIND_BITPOS": return 'bitpos = %d' % loc_val['bitpos'] + elif loc_kind == "FIELD_LOC_KIND_ENUMVAL": + return 'enumval = %d' % loc_val['enumval'] elif loc_kind == "FIELD_LOC_KIND_PHYSADDR": return 'physaddr = 0x%x' % loc_val['physaddr'] elif loc_kind == "FIELD_LOC_KIND_PHYSNAME": diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 90e33a5..28ff865 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -775,13 +775,13 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp) entries. */ int i; - *lowp = *highp = TYPE_FIELD_BITPOS (type, 0); + *lowp = *highp = TYPE_FIELD_ENUMVAL (type, 0); for (i = 0; i < TYPE_NFIELDS (type); i++) { - if (TYPE_FIELD_BITPOS (type, i) < *lowp) - *lowp = TYPE_FIELD_BITPOS (type, i); - if (TYPE_FIELD_BITPOS (type, i) > *highp) - *highp = TYPE_FIELD_BITPOS (type, i); + if (TYPE_FIELD_ENUMVAL (type, i) < *lowp) + *lowp = TYPE_FIELD_ENUMVAL (type, i); + if (TYPE_FIELD_ENUMVAL (type, i) > *highp) + *highp = TYPE_FIELD_ENUMVAL (type, i); } /* Set unsigned indicator if warranted. */ @@ -3197,10 +3197,15 @@ recursive_dump_type (struct type *type, int spaces) puts_filtered ("\n"); for (idx = 0; idx < TYPE_NFIELDS (type); idx++) { - printfi_filtered (spaces + 2, - "[%d] bitpos %d bitsize %d type ", - idx, TYPE_FIELD_BITPOS (type, idx), - TYPE_FIELD_BITSIZE (type, idx)); + if (TYPE_CODE (type) == TYPE_CODE_ENUM) + printfi_filtered (spaces + 2, + "[%d] enumval %s type ", + idx, plongest (TYPE_FIELD_ENUMVAL (type, idx))); + else + printfi_filtered (spaces + 2, + "[%d] bitpos %d bitsize %d type ", + idx, TYPE_FIELD_BITPOS (type, idx), + TYPE_FIELD_BITSIZE (type, idx)); gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); printf_filtered (" name '%s' (", TYPE_FIELD_NAME (type, idx) != NULL @@ -3397,6 +3402,10 @@ copy_type_recursive (struct objfile *objfile, SET_FIELD_BITPOS (TYPE_FIELD (new_type, i), TYPE_FIELD_BITPOS (type, i)); break; + case FIELD_LOC_KIND_ENUMVAL: + SET_FIELD_ENUMVAL (TYPE_FIELD (new_type, i), + TYPE_FIELD_ENUMVAL (type, i)); + break; case FIELD_LOC_KIND_PHYSADDR: SET_FIELD_PHYSADDR (TYPE_FIELD (new_type, i), TYPE_FIELD_STATIC_PHYSADDR (type, i)); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 07c3a86..01c62a5 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -351,6 +351,7 @@ enum type_instance_flag_value enum field_loc_kind { FIELD_LOC_KIND_BITPOS, /* bitpos */ + FIELD_LOC_KIND_ENUMVAL, /* enumval */ FIELD_LOC_KIND_PHYSADDR, /* physaddr */ FIELD_LOC_KIND_PHYSNAME, /* physname */ FIELD_LOC_KIND_DWARF_BLOCK /* dwarf_block */ @@ -511,11 +512,13 @@ struct main_type containing structure. For gdbarch_bits_big_endian=1 targets, it is the bit offset to the MSB. For gdbarch_bits_big_endian=0 targets, it is the bit offset to - the LSB. For a range bound or enum value, this is the - value itself. */ + the LSB. */ int bitpos; + /* Enum value. */ + LONGEST enumval; + /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr is the location (in the target) of the static field. Otherwise, physname is the mangled label of the static field. */ @@ -538,7 +541,7 @@ struct main_type unsigned int artificial : 1; /* Discriminant for union field_location. */ - ENUM_BITFIELD(field_loc_kind) loc_kind : 2; + ENUM_BITFIELD(field_loc_kind) loc_kind : 3; /* Size of this field, in bits, or zero if not packed. If non-zero in an array type, indicates the element size in @@ -546,7 +549,7 @@ struct main_type For an unpacked field, the field's type's length says how many bytes the field occupies. */ - unsigned int bitsize : 29; + unsigned int bitsize : 28; /* In a struct or union type, type of this field. In a function or member type, type of this argument. @@ -931,7 +934,7 @@ struct call_site union field_location loc; /* Discriminant for union field_location. */ - ENUM_BITFIELD(field_loc_kind) loc_kind : 2; + ENUM_BITFIELD(field_loc_kind) loc_kind : 3; } target; @@ -1088,12 +1091,16 @@ extern void allocate_gnat_aux_type (struct type *); #define FIELD_NAME(thisfld) ((thisfld).name) #define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind) #define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos) +#define FIELD_ENUMVAL(thisfld) ((thisfld).loc.enumval) #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) #define SET_FIELD_BITPOS(thisfld, bitpos) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \ FIELD_BITPOS (thisfld) = (bitpos)) +#define SET_FIELD_ENUMVAL(thisfld, enumval) \ + (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_ENUMVAL, \ + FIELD_ENUMVAL (thisfld) = (enumval)) #define SET_FIELD_PHYSNAME(thisfld, name) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -1111,6 +1118,7 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n)) #define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) +#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n)) diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index 9735d7f..fb3d49c 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -607,10 +607,11 @@ m2_enum (struct type *type, struct ui_file *stream, int show, int level) fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " = %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 299e94c..a20f953 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1047,7 +1047,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, if (tsym.st != stMember) break; - SET_FIELD_BITPOS (*f, tsym.value); + SET_FIELD_ENUMVAL (*f, tsym.value); FIELD_TYPE (*f) = t; FIELD_NAME (*f) = debug_info->ss + cur_fdr->issBase + tsym.iss; FIELD_BITSIZE (*f) = 0; diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index bc24495..a00f5b3 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -750,11 +750,12 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { fprintf_filtered (stream, - " := %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + " := %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } diff --git a/gdb/python/lib/gdb/printing.py b/gdb/python/lib/gdb/printing.py index 0f399d0..b4e798d 100644 --- a/gdb/python/lib/gdb/printing.py +++ b/gdb/python/lib/gdb/printing.py @@ -247,10 +247,10 @@ class FlagEnumerationPrinter(PrettyPrinter): flags = gdb.lookup_type(self.name) self.enumerators = [] for field in flags.fields(): - self.enumerators.append((field.name, field.bitpos)) + self.enumerators.append((field.name, field.enumval)) # Sorting the enumerators by value usually does the right # thing. - self.enumerators.sort(key = lambda x: x.bitpos) + self.enumerators.sort(key = lambda x: x.enumval) if self.enabled: return _EnumInstance(self.enumerators, val) diff --git a/gdb/python/lib/gdb/types.py b/gdb/python/lib/gdb/types.py index aca84f3..66c9528 100644 --- a/gdb/python/lib/gdb/types.py +++ b/gdb/python/lib/gdb/types.py @@ -86,8 +86,8 @@ def make_enum_dict(enum_type): raise TypeError("not an enum type") enum_dict = {} for field in enum_type.fields(): - # The enum's value is stored in "bitpos". - enum_dict[field.name] = field.bitpos + # The enum's value is stored in "enumval". + enum_dict[field.name] = field.enumval return enum_dict diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index d47d4c8..23808af 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -167,11 +167,23 @@ convert_field (struct type *type, int field) if (!field_is_static (&TYPE_FIELD (type, field))) { - arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field)); + const char *attrstring; + + if (TYPE_CODE (type) == TYPE_CODE_ENUM) + { + arg = gdb_py_long_from_longest (TYPE_FIELD_ENUMVAL (type, field)); + attrstring = "enumval"; + } + else + { + arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field)); + attrstring = "bitpos"; + } + if (!arg) goto fail; - if (PyObject_SetAttrString (result, "bitpos", arg) < 0) + if (PyObject_SetAttrString (result, attrstring, arg) < 0) goto failarg; } @@ -1018,6 +1030,10 @@ check_types_equal (struct type *type1, struct type *type2, if (FIELD_BITPOS (*field1) != FIELD_BITPOS (*field2)) return Py_NE; break; + case FIELD_LOC_KIND_ENUMVAL: + if (FIELD_ENUMVAL (*field1) != FIELD_ENUMVAL (*field2)) + return Py_NE; + break; case FIELD_LOC_KIND_PHYSADDR: if (FIELD_STATIC_PHYSADDR (*field1) != FIELD_STATIC_PHYSADDR (*field2)) diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 39e0d7b..af31029 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -3730,7 +3730,7 @@ read_enum_type (char **pp, struct type *type, SYMBOL_TYPE (xsym) = type; TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym); - SET_FIELD_BITPOS (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); + SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); TYPE_FIELD_BITSIZE (type, n) = 0; } if (syms == osyms) diff --git a/gdb/testsuite/gdb.base/enumval.c b/gdb/testsuite/gdb.base/enumval.c new file mode 100644 index 0000000..a71b953 --- /dev/null +++ b/gdb/testsuite/gdb.base/enumval.c @@ -0,0 +1,30 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +enum e { I, J = 0xffffffffU, K = 0xf000000000000000ULL } e = J, f = K; + +void +dummy() +{ +} + +int +main(void) +{ + dummy(); + return 0; +} diff --git a/gdb/testsuite/gdb.base/enumval.exp b/gdb/testsuite/gdb.base/enumval.exp new file mode 100644 index 0000000..fa41096 --- /dev/null +++ b/gdb/testsuite/gdb.base/enumval.exp @@ -0,0 +1,31 @@ +# This testcase is part of GDB, the GNU debugger. + +# Copyright 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set testfile "enumval" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +if { [prepare_for_testing enumval.exp "enumval" "" {debug}] } { + return -1 +} + +# Check the real contents. +gdb_test "print e" "= J" +gdb_test "print f" "= K" + +gdb_test "print J" "= J" +gdb_test "print K" "= K" diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp index feb76ba..8e64b92 100644 --- a/gdb/testsuite/gdb.python/py-type.exp +++ b/gdb/testsuite/gdb.python/py-type.exp @@ -136,8 +136,8 @@ proc test_enums {} { gdb_test "python print len(e.type)" "3" "Check the number of enum fields" gdb_test "python print e.type\['v1'\].name" "v1" "Check enum field lookup by name" gdb_test "python print e.type\['v3'\].name" "v3" "Check enum field lookup by name" - gdb_test "python print \[v.bitpos for v in e.type.itervalues()\]" {\[0L, 1L, 2L\]} "Check num fields iteration over values" - gdb_test "python print \[(n, v.bitpos) for (n, v) in e.type.items()\]" {\[\('v1', 0L\), \('v2', 1L\), \('v3', 2L\)\]} "Check enum fields items list" + gdb_test "python print \[v.enumval for v in e.type.itervalues()\]" {\[0L, 1L, 2L\]} "Check num fields iteration over values" + gdb_test "python print \[(n, v.enumval) for (n, v) in e.type.items()\]" {\[\('v1', 0L\), \('v2', 1L\), \('v3', 2L\)\]} "Check enum fields items list" } proc test_base_class {} { gdb_py_test_silent_cmd "print d" "print value" 1 diff --git a/gdb/typeprint.c b/gdb/typeprint.c index f257f47..c25e705 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -206,7 +206,7 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream) len = TYPE_NFIELDS (type); for (i = 0; i < len; i++) { - if (TYPE_FIELD_BITPOS (type, i) == val) + if (TYPE_FIELD_ENUMVAL (type, i) == val) { break; } diff --git a/gdb/valprint.c b/gdb/valprint.c index 738fef4..25b62bc 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -445,7 +445,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr, for (i = 0; i < len; i++) { QUIT; - if (val == TYPE_FIELD_BITPOS (type, i)) + if (val == TYPE_FIELD_ENUMVAL (type, i)) { break; } @@ -466,13 +466,13 @@ generic_val_print (struct type *type, const gdb_byte *valaddr, { QUIT; - if ((val & TYPE_FIELD_BITPOS (type, i)) != 0) + if ((val & TYPE_FIELD_ENUMVAL (type, i)) != 0) { if (!first) fputs_filtered (" | ", stream); first = 0; - val &= ~TYPE_FIELD_BITPOS (type, i); + val &= ~TYPE_FIELD_ENUMVAL (type, i); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); } } ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Allow 64-bit enum values 2012-04-17 14:01 ` Jan Kratochvil @ 2012-04-18 2:53 ` Siddhesh Poyarekar 2012-04-18 6:58 ` [commit] " Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-04-18 2:53 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Tom Tromey, gdb-patches On Tue, 17 Apr 2012 15:58:19 +0200, Jan wrote: > According to Tom it should the review should not depend on C++ so: > > I made there these changes, particularly to really test 64-bit enums: > > ### a/gdb/gdbtypes.c > - TYPE_FIELD_ENUMVAL (type, i)); > + TYPE_FIELD_ENUMVAL (type, i)); > ### a/gdb/python/py-type.c > - if (TYPE_CODE(type) == TYPE_CODE_ENUM) > + if (TYPE_CODE (type) == TYPE_CODE_ENUM) > - arg = PyLong_FromLong (TYPE_FIELD_ENUMVAL (type, field)); > + arg = gdb_py_long_from_longest (TYPE_FIELD_ENUMVAL (type, > field)); ### a/gdb/testsuite/gdb.base/enumval.c > -enum e { I, J = 0xffffffffU } e = J; > +enum e { I, J = 0xffffffffU, K = 0xf000000000000000ULL } e = J, f = > K; ### a/gdb/testsuite/gdb.base/enumval.exp > +gdb_test "print f" "= K" > +gdb_test "print K" "= K" > > The patch needs small rebase on HEAD due to other changes and due to: > [commit] Do not rely on FIELD_LOC_KIND_BITPOS being zero > http://sourceware.org/ml/gdb-patches/2012-04/msg00460.html > > and it should be checked in along with: > [patch!] Support 64-bit constants/enums on 32-bit host [Re: > [PATCH] Allow 64-bit enum values] > http://sourceware.org/ml/gdb-patches/2012-04/msg00463.html > > OK to check it in with these changes. > Thanks, I will resubmit the patch with these changes and the rebase, hopefully by today or latest by tomorrow. -- Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* [commit] [PATCH] Allow 64-bit enum values 2012-04-18 2:53 ` Siddhesh Poyarekar @ 2012-04-18 6:58 ` Jan Kratochvil 2012-04-18 7:06 ` [ChangeLog commit] " Jan Kratochvil 2012-04-19 16:58 ` [commit] " Ulrich Weigand 0 siblings, 2 replies; 70+ messages in thread From: Jan Kratochvil @ 2012-04-18 6:58 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Tom Tromey, gdb-patches On Wed, 18 Apr 2012 04:37:20 +0200, Siddhesh Poyarekar wrote: > Thanks, I will resubmit the patch with these changes and the rebase, > hopefully by today or latest by tomorrow. After off-list mail it is already rebased checked it in. It was not fully rebased so I added new FIELD_ENUMVAL_LVAL. I had to rewrite ChangeLog as it was too vague, it included unrelated comment fix and it used order not matching the diff+chunks. Thanks, Jan http://sourceware.org/ml/gdb-cvs/2012-04/msg00126.html + forgotten added testcases: http://sourceware.org/ml/gdb-cvs/2012-04/msg00127.html --- src/gdb/ChangeLog 2012/04/18 06:24:48 1.14122 +++ src/gdb/ChangeLog 2012/04/18 06:46:45 1.14123 @@ -1,3 +1,52 @@ +2012-04-18 Siddhesh Poyarekar <siddhesh@redhat.com> + + PR symtab/7259: + * ada-exp.y (convert_char_literal): Use TYPE_FIELD_ENUMVAL. + * ada-lang.c (ada_discrete_type_high_bound) + (ada_discrete_type_low_bound): Use TYPE_FIELD_ENUMVAL for + TYPE_CODE_ENUM. + (ada_identical_enum_types_p): Use TYPE_FIELD_ENUMVAL. + (pos_atr, value_val_atr): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. + * ada-typeprint.c (print_enum_type): Change variable lastval to LONGEST. + Use TYPE_FIELD_ENUMVAL. + * ada-valprint.c (print_optional_low_bound, ada_print_scalar) + (ada_val_print_1): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. + * c-typeprint.c (c_type_print_base): Move variable lastval to inner + block, change it to LONGEST. Use TYPE_FIELD_ENUMVAL for + TYPE_CODE_ENUM. + * coffread.c (coff_read_enum_type): Use SET_FIELD_ENUMVAL. + * dwarf2read.c (process_enumeration_scope): Likewise. + * gdb-gdb.py (TypeFlagsPrinter): Use field.enumval instead of + field.bitpos. + (class StructMainTypePrettyPrinter): Support also + FIELD_LOC_KIND_ENUMVAL. + * gdbtypes.c (get_discrete_bounds): Use TYPE_FIELD_ENUMVAL for + TYPE_CODE_ENUM. + (recursive_dump_type): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. + (copy_type_recursive): Support also FIELD_LOC_KIND_ENUMVAL. + * gdbtypes.h (enum field_loc_kind): New FIELD_LOC_KIND_ENUMVAL. + (struct main_type.flds_bnds.fields.loc): Adjust bitpos comment. New + field enumval. + (struct main_type.flds_bnds.bields): Adjust loc_kind and bitsize to + accommodate enumval. + (struct call_site): Adjust loc_kind to accommodate enumval. + (FIELD_ENUMVAL, FIELD_ENUMVAL_LVAL, SET_FIELD_ENUMVAL) + (TYPE_FIELD_ENUMVAL): New macros. + * m2-typeprint.c (m2_enum): Use TYPE_FIELD_ENUMVAL. + * mdebugread.c (parse_symbol): Use TYPE_FIELD_ENUMVAL for + TYPE_CODE_ENUM. + * p-typeprint.c (pascal_type_print_base): Likewise. + * python/lib/gdb/printing.py (class FlagEnumerationPrinter): Use + enumval. + * python/lib/gdb/types.py (make_enum_dict): Likewise. + * python/py-type.c (convert_field): New variable addrstring. Use + TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. + (check_types_equal): Support also FIELD_LOC_KIND_ENUMVAL. + * stabsread.c (read_enum_type): Use SET_FIELD_ENUMVAL. + * typepint.c (print_type_scalar): Use TYPE_FIELD_ENUMVAL for + TYPE_CODE_ENUM. + * valprint.c (generic_val_print): Likewise. + 2012-04-17 Doug Evans <dje@google.com> * dwarf2read.c (lookup_signatured_type): Return NULL instead of 0. --- src/gdb/ada-exp.y 2012/04/09 17:07:42 1.49 +++ src/gdb/ada-exp.y 2012/04/18 06:46:45 1.50 @@ -1463,7 +1463,7 @@ for (f = 0; f < TYPE_NFIELDS (type); f += 1) { if (strcmp (name, TYPE_FIELD_NAME (type, f)) == 0) - return TYPE_FIELD_BITPOS (type, f); + return TYPE_FIELD_ENUMVAL (type, f); } return val; } --- src/gdb/ada-lang.c 2012/04/17 12:43:19 1.364 +++ src/gdb/ada-lang.c 2012/04/18 06:46:45 1.365 @@ -690,7 +690,7 @@ case TYPE_CODE_RANGE: return TYPE_HIGH_BOUND (type); case TYPE_CODE_ENUM: - return TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) - 1); + return TYPE_FIELD_ENUMVAL (type, TYPE_NFIELDS (type) - 1); case TYPE_CODE_BOOL: return 1; case TYPE_CODE_CHAR: @@ -701,7 +701,7 @@ } } -/* The largest value in the domain of TYPE, a discrete type, as an integer. */ +/* The smallest value in the domain of TYPE, a discrete type, as an integer. */ LONGEST ada_discrete_type_low_bound (struct type *type) { @@ -710,7 +710,7 @@ case TYPE_CODE_RANGE: return TYPE_LOW_BOUND (type); case TYPE_CODE_ENUM: - return TYPE_FIELD_BITPOS (type, 0); + return TYPE_FIELD_ENUMVAL (type, 0); case TYPE_CODE_BOOL: return 0; case TYPE_CODE_CHAR: @@ -4479,7 +4479,7 @@ /* All enums in the type should have an identical underlying value. */ for (i = 0; i < TYPE_NFIELDS (type1); i++) - if (TYPE_FIELD_BITPOS (type1, i) != TYPE_FIELD_BITPOS (type2, i)) + if (TYPE_FIELD_ENUMVAL (type1, i) != TYPE_FIELD_ENUMVAL (type2, i)) return 0; /* All enumerals should also have the same name (modulo any numerical @@ -8298,7 +8298,7 @@ for (i = 0; i < TYPE_NFIELDS (type); i += 1) { - if (v == TYPE_FIELD_BITPOS (type, i)) + if (v == TYPE_FIELD_ENUMVAL (type, i)) return i; } error (_("enumeration value is invalid: can't find 'POS")); @@ -8329,7 +8329,7 @@ if (pos < 0 || pos >= TYPE_NFIELDS (type)) error (_("argument to 'VAL out of range")); - return value_from_longest (type, TYPE_FIELD_BITPOS (type, pos)); + return value_from_longest (type, TYPE_FIELD_ENUMVAL (type, pos)); } else return value_from_longest (type, value_as_long (arg)); --- src/gdb/ada-typeprint.c 2012/02/07 04:48:18 1.45 +++ src/gdb/ada-typeprint.c 2012/04/18 06:46:46 1.46 @@ -274,7 +274,8 @@ print_enum_type (struct type *type, struct ui_file *stream) { int len = TYPE_NFIELDS (type); - int i, lastval; + int i; + LONGEST lastval; fprintf_filtered (stream, "("); wrap_here (" "); @@ -287,10 +288,11 @@ fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (ada_enum_name (TYPE_FIELD_NAME (type, i)), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " => %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " => %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval += 1; } --- src/gdb/ada-valprint.c 2012/03/29 18:50:21 1.90 +++ src/gdb/ada-valprint.c 2012/04/18 06:46:46 1.91 @@ -109,7 +109,7 @@ return 0; break; case TYPE_CODE_ENUM: - if (low_bound == TYPE_FIELD_BITPOS (index_type, 0)) + if (low_bound == TYPE_FIELD_ENUMVAL (index_type, 0)) return 0; break; case TYPE_CODE_UNDEF: @@ -402,7 +402,7 @@ len = TYPE_NFIELDS (type); for (i = 0; i < len; i++) { - if (TYPE_FIELD_BITPOS (type, i) == val) + if (TYPE_FIELD_ENUMVAL (type, i) == val) { break; } @@ -824,7 +824,7 @@ for (i = 0; i < len; i++) { QUIT; - if (val == TYPE_FIELD_BITPOS (type, i)) + if (val == TYPE_FIELD_ENUMVAL (type, i)) { break; } --- src/gdb/c-typeprint.c 2012/02/07 04:48:18 1.73 +++ src/gdb/c-typeprint.c 2012/04/18 06:46:46 1.74 @@ -717,7 +717,6 @@ { int i; int len, real_len; - int lastval; enum { s_none, s_public, s_private, s_protected @@ -1194,9 +1193,10 @@ } else if (show > 0 || TYPE_TAG_NAME (type) == NULL) { + LONGEST lastval = 0; + fprintf_filtered (stream, "{"); len = TYPE_NFIELDS (type); - lastval = 0; for (i = 0; i < len; i++) { QUIT; @@ -1204,11 +1204,11 @@ fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " = %d", - TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " = %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } --- src/gdb/coffread.c 2012/02/07 04:48:18 1.126 +++ src/gdb/coffread.c 2012/04/18 06:46:46 1.127 @@ -2159,7 +2159,7 @@ SYMBOL_TYPE (xsym) = type; TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym); - SET_FIELD_BITPOS (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); + SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); if (SYMBOL_VALUE (xsym) < 0) unsigned_enum = 0; TYPE_FIELD_BITSIZE (type, n) = 0; --- src/gdb/dwarf2read.c 2012/04/18 06:24:48 1.635 +++ src/gdb/dwarf2read.c 2012/04/18 06:46:46 1.636 @@ -8051,7 +8051,7 @@ FIELD_NAME (fields[num_fields]) = SYMBOL_LINKAGE_NAME (sym); FIELD_TYPE (fields[num_fields]) = NULL; - SET_FIELD_BITPOS (fields[num_fields], SYMBOL_VALUE (sym)); + SET_FIELD_ENUMVAL (fields[num_fields], SYMBOL_VALUE (sym)); FIELD_BITSIZE (fields[num_fields]) = 0; num_fields++; --- src/gdb/gdb-gdb.py 2012/02/09 15:14:46 1.10 +++ src/gdb/gdb-gdb.py 2012/04/18 06:46:46 1.11 @@ -99,10 +99,10 @@ return # Note: TYPE_FLAG_MIN is a duplicate of TYPE_FLAG_UNSIGNED, # so exclude it from the list we are building. - TYPE_FLAGS = [TypeFlag(field.name, field.bitpos) + TYPE_FLAGS = [TypeFlag(field.name, field.enumval) for field in flags.fields() if field.name != 'TYPE_FLAG_MIN'] - TYPE_FLAGS += [TypeFlag(field.name, field.bitpos) + TYPE_FLAGS += [TypeFlag(field.name, field.enumval) for field in iflags.fields()] TYPE_FLAGS.sort() @@ -154,6 +154,8 @@ loc_kind = str(field_val['loc_kind']) if loc_kind == "FIELD_LOC_KIND_BITPOS": return 'bitpos = %d' % loc_val['bitpos'] + elif loc_kind == "FIELD_LOC_KIND_ENUMVAL": + return 'enumval = %d' % loc_val['enumval'] elif loc_kind == "FIELD_LOC_KIND_PHYSADDR": return 'physaddr = 0x%x' % loc_val['physaddr'] elif loc_kind == "FIELD_LOC_KIND_PHYSNAME": --- src/gdb/gdbtypes.c 2012/04/17 13:55:31 1.228 +++ src/gdb/gdbtypes.c 2012/04/18 06:46:46 1.229 @@ -775,13 +775,13 @@ entries. */ int i; - *lowp = *highp = TYPE_FIELD_BITPOS (type, 0); + *lowp = *highp = TYPE_FIELD_ENUMVAL (type, 0); for (i = 0; i < TYPE_NFIELDS (type); i++) { - if (TYPE_FIELD_BITPOS (type, i) < *lowp) - *lowp = TYPE_FIELD_BITPOS (type, i); - if (TYPE_FIELD_BITPOS (type, i) > *highp) - *highp = TYPE_FIELD_BITPOS (type, i); + if (TYPE_FIELD_ENUMVAL (type, i) < *lowp) + *lowp = TYPE_FIELD_ENUMVAL (type, i); + if (TYPE_FIELD_ENUMVAL (type, i) > *highp) + *highp = TYPE_FIELD_ENUMVAL (type, i); } /* Set unsigned indicator if warranted. */ @@ -3197,10 +3197,15 @@ puts_filtered ("\n"); for (idx = 0; idx < TYPE_NFIELDS (type); idx++) { - printfi_filtered (spaces + 2, - "[%d] bitpos %d bitsize %d type ", - idx, TYPE_FIELD_BITPOS (type, idx), - TYPE_FIELD_BITSIZE (type, idx)); + if (TYPE_CODE (type) == TYPE_CODE_ENUM) + printfi_filtered (spaces + 2, + "[%d] enumval %s type ", + idx, plongest (TYPE_FIELD_ENUMVAL (type, idx))); + else + printfi_filtered (spaces + 2, + "[%d] bitpos %d bitsize %d type ", + idx, TYPE_FIELD_BITPOS (type, idx), + TYPE_FIELD_BITSIZE (type, idx)); gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); printf_filtered (" name '%s' (", TYPE_FIELD_NAME (type, idx) != NULL @@ -3397,6 +3402,10 @@ SET_FIELD_BITPOS (TYPE_FIELD (new_type, i), TYPE_FIELD_BITPOS (type, i)); break; + case FIELD_LOC_KIND_ENUMVAL: + SET_FIELD_ENUMVAL (TYPE_FIELD (new_type, i), + TYPE_FIELD_ENUMVAL (type, i)); + break; case FIELD_LOC_KIND_PHYSADDR: SET_FIELD_PHYSADDR (TYPE_FIELD (new_type, i), TYPE_FIELD_STATIC_PHYSADDR (type, i)); --- src/gdb/gdbtypes.h 2012/04/17 13:55:31 1.164 +++ src/gdb/gdbtypes.h 2012/04/18 06:46:46 1.165 @@ -351,6 +351,7 @@ enum field_loc_kind { FIELD_LOC_KIND_BITPOS, /* bitpos */ + FIELD_LOC_KIND_ENUMVAL, /* enumval */ FIELD_LOC_KIND_PHYSADDR, /* physaddr */ FIELD_LOC_KIND_PHYSNAME, /* physname */ FIELD_LOC_KIND_DWARF_BLOCK /* dwarf_block */ @@ -511,11 +512,13 @@ containing structure. For gdbarch_bits_big_endian=1 targets, it is the bit offset to the MSB. For gdbarch_bits_big_endian=0 targets, it is the bit offset to - the LSB. For a range bound or enum value, this is the - value itself. */ + the LSB. */ int bitpos; + /* Enum value. */ + LONGEST enumval; + /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr is the location (in the target) of the static field. Otherwise, physname is the mangled label of the static field. */ @@ -538,7 +541,7 @@ unsigned int artificial : 1; /* Discriminant for union field_location. */ - ENUM_BITFIELD(field_loc_kind) loc_kind : 2; + ENUM_BITFIELD(field_loc_kind) loc_kind : 3; /* Size of this field, in bits, or zero if not packed. If non-zero in an array type, indicates the element size in @@ -546,7 +549,7 @@ For an unpacked field, the field's type's length says how many bytes the field occupies. */ - unsigned int bitsize : 29; + unsigned int bitsize : 28; /* In a struct or union type, type of this field. In a function or member type, type of this argument. @@ -931,7 +934,7 @@ union field_location loc; /* Discriminant for union field_location. */ - ENUM_BITFIELD(field_loc_kind) loc_kind : 2; + ENUM_BITFIELD(field_loc_kind) loc_kind : 3; } target; @@ -1089,12 +1092,17 @@ #define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind) #define FIELD_BITPOS_LVAL(thisfld) ((thisfld).loc.bitpos) #define FIELD_BITPOS(thisfld) (FIELD_BITPOS_LVAL (thisfld) + 0) +#define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval) +#define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0) #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) #define SET_FIELD_BITPOS(thisfld, bitpos) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \ FIELD_BITPOS_LVAL (thisfld) = (bitpos)) +#define SET_FIELD_ENUMVAL(thisfld, enumval) \ + (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_ENUMVAL, \ + FIELD_ENUMVAL_LVAL (thisfld) = (enumval)) #define SET_FIELD_PHYSNAME(thisfld, name) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -1112,6 +1120,7 @@ #define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n)) #define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) +#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n)) --- src/gdb/m2-typeprint.c 2012/01/04 08:17:05 1.29 +++ src/gdb/m2-typeprint.c 2012/04/18 06:46:46 1.30 @@ -607,10 +607,11 @@ fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " = %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } --- src/gdb/mdebugread.c 2012/02/07 04:48:21 1.129 +++ src/gdb/mdebugread.c 2012/04/18 06:46:46 1.130 @@ -1047,7 +1047,7 @@ if (tsym.st != stMember) break; - SET_FIELD_BITPOS (*f, tsym.value); + SET_FIELD_ENUMVAL (*f, tsym.value); FIELD_TYPE (*f) = t; FIELD_NAME (*f) = debug_info->ss + cur_fdr->issBase + tsym.iss; FIELD_BITSIZE (*f) = 0; --- src/gdb/p-typeprint.c 2012/03/16 11:10:04 1.45 +++ src/gdb/p-typeprint.c 2012/04/18 06:46:46 1.46 @@ -750,11 +750,12 @@ fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { fprintf_filtered (stream, - " := %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + " := %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } --- src/gdb/stabsread.c 2012/04/17 13:55:32 1.146 +++ src/gdb/stabsread.c 2012/04/18 06:46:46 1.147 @@ -3731,7 +3731,7 @@ SYMBOL_TYPE (xsym) = type; TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym); - SET_FIELD_BITPOS (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); + SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); TYPE_FIELD_BITSIZE (type, n) = 0; } if (syms == osyms) --- src/gdb/typeprint.c 2012/02/21 13:48:59 1.45 +++ src/gdb/typeprint.c 2012/04/18 06:46:46 1.46 @@ -206,7 +206,7 @@ len = TYPE_NFIELDS (type); for (i = 0; i < len; i++) { - if (TYPE_FIELD_BITPOS (type, i) == val) + if (TYPE_FIELD_ENUMVAL (type, i) == val) { break; } --- src/gdb/valprint.c 2012/04/03 14:39:53 1.122 +++ src/gdb/valprint.c 2012/04/18 06:46:46 1.123 @@ -445,7 +445,7 @@ for (i = 0; i < len; i++) { QUIT; - if (val == TYPE_FIELD_BITPOS (type, i)) + if (val == TYPE_FIELD_ENUMVAL (type, i)) { break; } @@ -466,13 +466,13 @@ { QUIT; - if ((val & TYPE_FIELD_BITPOS (type, i)) != 0) + if ((val & TYPE_FIELD_ENUMVAL (type, i)) != 0) { if (!first) fputs_filtered (" | ", stream); first = 0; - val &= ~TYPE_FIELD_BITPOS (type, i); + val &= ~TYPE_FIELD_ENUMVAL (type, i); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); } } --- src/gdb/python/py-type.c 2012/02/17 19:24:26 1.36 +++ src/gdb/python/py-type.c 2012/04/18 06:46:46 1.37 @@ -167,11 +167,23 @@ if (!field_is_static (&TYPE_FIELD (type, field))) { - arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field)); + const char *attrstring; + + if (TYPE_CODE (type) == TYPE_CODE_ENUM) + { + arg = gdb_py_long_from_longest (TYPE_FIELD_ENUMVAL (type, field)); + attrstring = "enumval"; + } + else + { + arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field)); + attrstring = "bitpos"; + } + if (!arg) goto fail; - if (PyObject_SetAttrString (result, "bitpos", arg) < 0) + if (PyObject_SetAttrString (result, attrstring, arg) < 0) goto failarg; } @@ -1018,6 +1030,10 @@ if (FIELD_BITPOS (*field1) != FIELD_BITPOS (*field2)) return Py_NE; break; + case FIELD_LOC_KIND_ENUMVAL: + if (FIELD_ENUMVAL (*field1) != FIELD_ENUMVAL (*field2)) + return Py_NE; + break; case FIELD_LOC_KIND_PHYSADDR: if (FIELD_STATIC_PHYSADDR (*field1) != FIELD_STATIC_PHYSADDR (*field2)) --- src/gdb/python/lib/gdb/printing.py 2012/01/16 19:44:15 1.8 +++ src/gdb/python/lib/gdb/printing.py 2012/04/18 06:46:46 1.9 @@ -247,10 +247,10 @@ flags = gdb.lookup_type(self.name) self.enumerators = [] for field in flags.fields(): - self.enumerators.append((field.name, field.bitpos)) + self.enumerators.append((field.name, field.enumval)) # Sorting the enumerators by value usually does the right # thing. - self.enumerators.sort(key = lambda x: x.bitpos) + self.enumerators.sort(key = lambda x: x.enumval) if self.enabled: return _EnumInstance(self.enumerators, val) --- src/gdb/python/lib/gdb/types.py 2012/01/04 08:17:24 1.5 +++ src/gdb/python/lib/gdb/types.py 2012/04/18 06:46:46 1.6 @@ -86,8 +86,8 @@ raise TypeError("not an enum type") enum_dict = {} for field in enum_type.fields(): - # The enum's value is stored in "bitpos". - enum_dict[field.name] = field.bitpos + # The enum's value is stored in "enumval". + enum_dict[field.name] = field.enumval return enum_dict --- src/gdb/testsuite/ChangeLog 2012/04/17 17:43:10 1.3166 +++ src/gdb/testsuite/ChangeLog 2012/04/18 06:46:47 1.3167 @@ -1,3 +1,12 @@ +2012-04-18 Siddhesh Poyarekar <siddhesh@redhat.com> + Jan Kratochvil <jan.kratochvil@redhat.com> + + PR symtab/7259: + * gdb.base/enumval.c: New test case. + * gdb.base/enumval.exp: New test case. + * gdb.python/py-type.exp (test_enums): Use field.enumval instead of + field.bitpos. + 2012-04-17 Pedro Alves <palves@redhat.com> * Makefile.in (site.exp): Make site.exp source --- src/gdb/testsuite/gdb.python/py-type.exp 2012/02/17 19:24:27 1.21 +++ src/gdb/testsuite/gdb.python/py-type.exp 2012/04/18 06:46:47 1.22 @@ -136,8 +136,8 @@ gdb_test "python print len(e.type)" "3" "Check the number of enum fields" gdb_test "python print e.type\['v1'\].name" "v1" "Check enum field lookup by name" gdb_test "python print e.type\['v3'\].name" "v3" "Check enum field lookup by name" - gdb_test "python print \[v.bitpos for v in e.type.itervalues()\]" {\[0L, 1L, 2L\]} "Check num fields iteration over values" - gdb_test "python print \[(n, v.bitpos) for (n, v) in e.type.items()\]" {\[\('v1', 0L\), \('v2', 1L\), \('v3', 2L\)\]} "Check enum fields items list" + gdb_test "python print \[v.enumval for v in e.type.itervalues()\]" {\[0L, 1L, 2L\]} "Check num fields iteration over values" + gdb_test "python print \[(n, v.enumval) for (n, v) in e.type.items()\]" {\[\('v1', 0L\), \('v2', 1L\), \('v3', 2L\)\]} "Check enum fields items list" } proc test_base_class {} { gdb_py_test_silent_cmd "print d" "print value" 1 --- src/gdb/testsuite/gdb.base/enumval.c +++ src/gdb/testsuite/gdb.base/enumval.c 2012-04-18 06:54:18.373302000 +0000 @@ -0,0 +1,30 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +enum e { I, J = 0xffffffffU, K = 0xf000000000000000ULL } e = J, f = K; + +void +dummy() +{ +} + +int +main(void) +{ + dummy(); + return 0; +} --- src/gdb/testsuite/gdb.base/enumval.exp +++ src/gdb/testsuite/gdb.base/enumval.exp 2012-04-18 06:54:18.742706000 +0000 @@ -0,0 +1,31 @@ +# This testcase is part of GDB, the GNU debugger. + +# Copyright 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set testfile "enumval" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +if { [prepare_for_testing enumval.exp "enumval" "" {debug}] } { + return -1 +} + +# Check the real contents. +gdb_test "print e" "= J" +gdb_test "print f" "= K" + +gdb_test "print J" "= J" +gdb_test "print K" "= K" ^ permalink raw reply [flat|nested] 70+ messages in thread
* [ChangeLog commit] [PATCH] Allow 64-bit enum values 2012-04-18 6:58 ` [commit] " Jan Kratochvil @ 2012-04-18 7:06 ` Jan Kratochvil 2012-04-19 16:58 ` [commit] " Ulrich Weigand 1 sibling, 0 replies; 70+ messages in thread From: Jan Kratochvil @ 2012-04-18 7:06 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Tom Tromey, gdb-patches On Wed, 18 Apr 2012 08:56:27 +0200, Jan Kratochvil wrote: > it included unrelated comment fix Oops, it already went with this patch, I cannot undone it now, sorry, the part was: -/* The largest value in the domain of TYPE, a discrete type, as an integer. */ +/* The smallest value in the domain of TYPE, a discrete type, as an integer. */ LONGEST ada_discrete_type_low_bound (struct type *type) So at least fixed up ChangeLog. Regards, Jan http://sourceware.org/ml/gdb-cvs/2012-04/msg00129.html --- src/gdb/ChangeLog 2012/04/18 06:52:25 1.14124 +++ src/gdb/ChangeLog 2012/04/18 07:00:24 1.14125 @@ -27,8 +27,8 @@ PR symtab/7259: * ada-exp.y (convert_char_literal): Use TYPE_FIELD_ENUMVAL. * ada-lang.c (ada_discrete_type_high_bound) - (ada_discrete_type_low_bound): Use TYPE_FIELD_ENUMVAL for - TYPE_CODE_ENUM. + (ada_discrete_type_low_bound): Fix function comment. Use + TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. (ada_identical_enum_types_p): Use TYPE_FIELD_ENUMVAL. (pos_atr, value_val_atr): Use TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. * ada-typeprint.c (print_enum_type): Change variable lastval to LONGEST. ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [commit] [PATCH] Allow 64-bit enum values 2012-04-18 6:58 ` [commit] " Jan Kratochvil 2012-04-18 7:06 ` [ChangeLog commit] " Jan Kratochvil @ 2012-04-19 16:58 ` Ulrich Weigand 2012-04-20 4:23 ` Siddhesh Poyarekar 1 sibling, 1 reply; 70+ messages in thread From: Ulrich Weigand @ 2012-04-19 16:58 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Siddhesh Poyarekar, Tom Tromey, gdb-patches Jan Kratochvil wrote: > +2012-04-18 Siddhesh Poyarekar <siddhesh@redhat.com> > + > + * python/py-type.c (convert_field): New variable addrstring. Use > + TYPE_FIELD_ENUMVAL for TYPE_CODE_ENUM. > --- src/gdb/python/py-type.c 2012/02/17 19:24:26 1.36 > +++ src/gdb/python/py-type.c 2012/04/18 06:46:46 1.37 > @@ -167,11 +167,23 @@ > > if (!field_is_static (&TYPE_FIELD (type, field))) > { > - arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field)); > + const char *attrstring; > + > + if (TYPE_CODE (type) == TYPE_CODE_ENUM) > + { > + arg = gdb_py_long_from_longest (TYPE_FIELD_ENUMVAL (type, field)); > + attrstring = "enumval"; > + } > + else > + { > + arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field)); > + attrstring = "bitpos"; > + } > + > if (!arg) > goto fail; > > - if (PyObject_SetAttrString (result, "bitpos", arg) < 0) > + if (PyObject_SetAttrString (result, attrstring, arg) < 0) > goto failarg; > } This causes a build failure for me due to: py-type.c: In function 'convert_field': py-type.c:186: warning: passing argument 2 of 'PyObject_SetAttrString' discards qualifiers from pointer target type /usr/include/python2.4/object.h has PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, char *, PyObject *); Maybe this depends on the Python version? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [commit] [PATCH] Allow 64-bit enum values 2012-04-19 16:58 ` [commit] " Ulrich Weigand @ 2012-04-20 4:23 ` Siddhesh Poyarekar 2012-04-20 7:50 ` [obv] Fix python-2.4 compilation compat. [Re: [commit] [PATCH] Allow 64-bit enum values] Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-04-20 4:23 UTC (permalink / raw) To: Ulrich Weigand; +Cc: Jan Kratochvil, Tom Tromey, gdb-patches On Thu, 19 Apr 2012 18:38:07 +0200 (CEST), Ulrich wrote: > This causes a build failure for me due to: > py-type.c: In function 'convert_field': > py-type.c:186: warning: passing argument 2 of > 'PyObject_SetAttrString' discards qualifiers from pointer target type > > /usr/include/python2.4/object.h has > PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, char *, > PyObject *); > > Maybe this depends on the Python version? Yes it does. Python 2.7 defines it as: PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, const char *, PyObject *); I think you should be able to patch that header safely. I can't see a reason to modify an attribute string and I'm pretty sure that it does not. -- Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* [obv] Fix python-2.4 compilation compat. [Re: [commit] [PATCH] Allow 64-bit enum values] 2012-04-20 4:23 ` Siddhesh Poyarekar @ 2012-04-20 7:50 ` Jan Kratochvil 2012-04-20 19:00 ` Tom Tromey 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-04-20 7:50 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Ulrich Weigand, Tom Tromey, gdb-patches On Fri, 20 Apr 2012 04:47:20 +0200, Siddhesh Poyarekar wrote: > On Thu, 19 Apr 2012 18:38:07 +0200 (CEST), Ulrich wrote: > > This causes a build failure for me due to: > > py-type.c: In function 'convert_field': > > py-type.c:186: warning: passing argument 2 of > > 'PyObject_SetAttrString' discards qualifiers from pointer target type [...] > I think you should be able to patch that header safely. GDB Python is kept compatible backwards to python-2.4 (although testsuite is lacking that compatibility). At least Red Hat even needs that compatibility for RHEL-5. Added CentOS-5 (and CentOS-6) for the automatic nightly regression testing of CVS HEAD. Checked in. I do not think autoconf-checking is worth this case. Thanks, Jan http://sourceware.org/ml/gdb-cvs/2012-04/msg00163.html --- src/gdb/ChangeLog 2012/04/19 20:18:22 1.14140 +++ src/gdb/ChangeLog 2012/04/20 07:17:53 1.14141 @@ -1,3 +1,9 @@ +2012-04-20 Jan Kratochvil <jan.kratochvil@redhat.com> + + Fix compilation compatibility with python-2.4 + * python/py-type.c (convert_field): Cast ADDRSTRING for + PyObject_SetAttrString as non-const. New comment. + 2012-04-19 Tom Tromey <tromey@redhat.com> * top.c (quit_target): Use all_cleanups. --- src/gdb/python/py-type.c 2012/04/18 06:46:46 1.37 +++ src/gdb/python/py-type.c 2012/04/20 07:17:58 1.38 @@ -183,7 +183,8 @@ if (!arg) goto fail; - if (PyObject_SetAttrString (result, attrstring, arg) < 0) + /* At least python-2.4 had the second parameter non-const. */ + if (PyObject_SetAttrString (result, (char *) attrstring, arg) < 0) goto failarg; } ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [obv] Fix python-2.4 compilation compat. [Re: [commit] [PATCH] Allow 64-bit enum values] 2012-04-20 7:50 ` [obv] Fix python-2.4 compilation compat. [Re: [commit] [PATCH] Allow 64-bit enum values] Jan Kratochvil @ 2012-04-20 19:00 ` Tom Tromey 0 siblings, 0 replies; 70+ messages in thread From: Tom Tromey @ 2012-04-20 19:00 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Siddhesh Poyarekar, Ulrich Weigand, gdb-patches >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes: Jan> Checked in. I do not think autoconf-checking is worth this case. I agree; and FWIW we have some similar workarounds elsewhere in the tree already. Tom ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Allow 64-bit enum values 2012-03-21 10:06 ` [PATCH] Allow 64-bit enum values Siddhesh Poyarekar 2012-03-27 17:00 ` Jan Kratochvil @ 2012-03-28 16:55 ` Tom Tromey 2012-03-29 10:56 ` Siddhesh Poyarekar 2012-04-17 13:11 ` [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] Jan Kratochvil 2 siblings, 1 reply; 70+ messages in thread From: Tom Tromey @ 2012-03-28 16:55 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Jan Kratochvil, gdb-patches >>>>> "Siddhesh" == Siddhesh Poyarekar <siddhesh@redhat.com> writes: Siddhesh> I took a separate approach from the one I took in: Siddhesh> http://sourceware.org/ml/gdb-patches/2012-02/msg00403.html Siddhesh> and removed the overloaded meaning of the bitpos location variable to Siddhesh> fix PR symtab/7259. In the following patch, I introduce a separate Siddhesh> field_location union member 'enumval' which can accept LONGEST and Siddhesh> hence expand enum values to 64-bit signed values. With this change, Siddhesh> bitpos now only is used for (non-negative) offsets into structures, Siddhesh> since the other overload of bitpos (range bounds) were already Siddhesh> separated into struct range_bound. I think this also needs an update in py-type.c:convert_field. Tom ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Allow 64-bit enum values 2012-03-28 16:55 ` [PATCH] Allow 64-bit enum values Tom Tromey @ 2012-03-29 10:56 ` Siddhesh Poyarekar 0 siblings, 0 replies; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-03-29 10:56 UTC (permalink / raw) To: Tom Tromey; +Cc: Jan Kratochvil, gdb-patches [-- Attachment #1: Type: text/plain, Size: 2873 bytes --] On Wed, 28 Mar 2012 10:55:13 -0600 Tom Tromey <tromey@redhat.com> wrote: > >>>>> "Siddhesh" == Siddhesh Poyarekar <siddhesh@redhat.com> writes: > > Siddhesh> I took a separate approach from the one I took in: > Siddhesh> http://sourceware.org/ml/gdb-patches/2012-02/msg00403.html > > Siddhesh> and removed the overloaded meaning of the bitpos location > Siddhesh> variable to fix PR symtab/7259. In the following patch, I > Siddhesh> introduce a separate field_location union member 'enumval' > Siddhesh> which can accept LONGEST and hence expand enum values to > Siddhesh> 64-bit signed values. With this change, bitpos now only is > Siddhesh> used for (non-negative) offsets into structures, since the > Siddhesh> other overload of bitpos (range bounds) were already > Siddhesh> separated into struct range_bound. > > I think this also needs an update in py-type.c:convert_field. Thanks, I missed that. I have attached a modified patch with this change (and other changes resulting from it) included. Updated ChangeLog below. Regards, Siddhesh ChangeLog: 2012-03-21 Siddhesh Poyarekar <siddhesh@redhat.com> PR symtab/7259: * gdbtypes.h (enum field_loc_kind): New FIELD_LOC_KIND_ENUMVAL. (struct main_type.fields): Adjust loc_kind and bitsize to accommodate FIELD_LOC_KIND_ENUMVAL. (struct main_type.fields.field_location): New enumval. New macros: FIELD_ENUMVAL, SET_FIELD_ENUMVAL and TYPE_FIELD_ENUMVAL. * ada-exp.y (convert_char_literal): use TYPE_FIELD_ENUMVAL if type is TYPE_CODE_ENUM. * ada-lang.c (ada_discrete_type_high_bound): Ditto. (ada_discrete_type_low_bound, value_val_atr): Ditto. (ada_identical_enum_types_p, pos_atr): Ditto. * ada-typeprint.c (print_enum_type): Ditto. * ada-valprint.c (print_optional_low_bound): Ditto. (ada_print_scalar, ada_val_print_1): Ditto. * c-typeprint.c (c_type_print_base): Ditto. * coffread.c (coff_read_enum_type): Ditto. * dwarf2read.c (process_enumeration_scope): Ditto. * gdbtypes.c (get_discrete_bounds): Ditto (recursive_dump_type, copy_type_recursive): Ditto. * m2-typeprint.c (m2_enum): Ditto. * mdebugread.c (parse_symbol): Ditto. * p-typeprint.c (pascal_type_print_base): Ditto. * python/py-type.c (check_types_equal, convert_field): Ditto. * stabsread.c (read_enum_type): Ditto. * typepint.c (print_type_scalar): Ditto. * valprint.c (generic_val_print): Ditto. * gdb-gdb.py (class StructMainTypePrettyPrinter): Ditto. (TypeFlagsPrinter): Use field.enumval instead of field.bitpos. * python/lib/gdb/printing.py (FlagEnumerationPrinter): Ditto. * python/lib/gdb/types.py (make_enum_dict): Ditto. testsuite/ChangeLog: 2012-03-21 Siddhesh Poyarekar <siddhesh@redhat.com> PR symtab/7259: * gdb.base/enumval.exp: New test case. * gdb.base/enumval.c: New test case. * gdb.python/py-type.exp (test_enums): Modify test to look for field.enumval instead of field.bitpos. [-- Attachment #2: 0001-Allow-64-bit-enum-values.patch --] [-- Type: text/x-patch, Size: 27414 bytes --] From 018bf097f43b815aad5f5b76b14d1cd75ceeda8a Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar <siddhesh.poyarekar@gmail.com> Date: Wed, 21 Mar 2012 14:09:26 +0530 Subject: [PATCH] Allow 64-bit enum values Hi, I took a separate approach from the one I took in: http://sourceware.org/ml/gdb-patches/2012-02/msg00403.html and removed the overloaded meaning of the bitpos location variable to fix PR symtab/7259. In the following patch, I introduce a separate variable enumval which can accept LONGEST and hence expand to 64-bit signed values. With this change, bitpos now only is used for offsets into structures, since the other overload of bitpos (range bounds) were already separated into struct range_bound. I have used the enum test from the PR here, so I will write another test for the bitpos expansion for large struct offsets. Regards, Siddhesh ChangeLog: 2012-03-21 Siddhesh Poyarekar <siddhesh@redhat.com> PR symtab/7259: * gdbtypes.h (enum field_loc_kind): New FIELD_LOC_KIND_ENUMVAL. (struct main_type.fields): Adjust loc_kind and bitsize to accommodate FIELD_LOC_KIND_ENUMVAL. (struct main_type.fields.field_location): New enumval. New macros: FIELD_ENUMVAL, SET_FIELD_ENUMVAL and TYPE_FIELD_ENUMVAL. * ada-exp.y (convert_char_literal): use TYPE_FIELD_ENUMVAL if type is TYPE_CODE_ENUM. * ada-lang.c (ada_discrete_type_high_bound): Ditto. (ada_discrete_type_low_bound, value_val_atr): Ditto. (ada_identical_enum_types_p, pos_atr): Ditto. * ada-typeprint.c (print_enum_type): Ditto. * ada-valprint.c (print_optional_low_bound): Ditto. (ada_print_scalar, ada_val_print_1): Ditto. * c-typeprint.c (c_type_print_base): Ditto. * coffread.c (coff_read_enum_type): Ditto. * dwarf2read.c (process_enumeration_scope): Ditto. * gdbtypes.c (get_discrete_bounds): Ditto (recursive_dump_type, copy_type_recursive): Ditto. * m2-typeprint.c (m2_enum): Ditto. * mdebugread.c (parse_symbol): Ditto. * p-typeprint.c (pascal_type_print_base): Ditto. * python/py-type.c (check_types_equal, convert_field): Ditto. * stabsread.c (read_enum_type): Ditto. * typepint.c (print_type_scalar): Ditto. * valprint.c (generic_val_print): Ditto. * gdb-gdb.py (class StructMainTypePrettyPrinter): Ditto. (TypeFlagsPrinter): Use field.enumval instead of field.bitpos. * python/lib/gdb/printing.py (FlagEnumerationPrinter): Ditto. * python/lib/gdb/types.py (make_enum_dict): Ditto. testsuite/ChangeLog: 2012-03-21 Siddhesh Poyarekar <siddhesh@redhat.com> PR symtab/7259: * gdb.base/enumval.exp: New test case. * gdb.base/enumval.c: New test case. * gdb.python/py-type.exp (test_enums): Modify test to look for field.enumval instead of field.bitpos. --- gdb/ada-exp.y | 2 +- gdb/ada-lang.c | 12 ++++++------ gdb/ada-typeprint.c | 10 ++++++---- gdb/ada-valprint.c | 6 +++--- gdb/c-typeprint.c | 11 +++++------ gdb/coffread.c | 2 +- gdb/dwarf2read.c | 2 +- gdb/gdb-gdb.py | 6 ++++-- gdb/gdbtypes.c | 27 ++++++++++++++++++--------- gdb/gdbtypes.h | 18 +++++++++++++----- gdb/m2-typeprint.c | 7 ++++--- gdb/mdebugread.c | 2 +- gdb/p-typeprint.c | 7 ++++--- gdb/python/lib/gdb/printing.py | 4 ++-- gdb/python/lib/gdb/types.py | 4 ++-- gdb/python/py-type.c | 20 ++++++++++++++++++-- gdb/stabsread.c | 2 +- gdb/testsuite/gdb.base/enumval.c | 30 ++++++++++++++++++++++++++++++ gdb/testsuite/gdb.base/enumval.exp | 29 +++++++++++++++++++++++++++++ gdb/testsuite/gdb.python/py-type.exp | 4 ++-- gdb/typeprint.c | 2 +- gdb/valprint.c | 6 +++--- 22 files changed, 155 insertions(+), 58 deletions(-) create mode 100644 gdb/testsuite/gdb.base/enumval.c create mode 100644 gdb/testsuite/gdb.base/enumval.exp diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 226cc1d..ef052d7 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1458,7 +1458,7 @@ convert_char_literal (struct type *type, LONGEST val) for (f = 0; f < TYPE_NFIELDS (type); f += 1) { if (strcmp (name, TYPE_FIELD_NAME (type, f)) == 0) - return TYPE_FIELD_BITPOS (type, f); + return TYPE_FIELD_ENUMVAL (type, f); } return val; } diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 78a0261..5d77b1a 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -690,7 +690,7 @@ ada_discrete_type_high_bound (struct type *type) case TYPE_CODE_RANGE: return TYPE_HIGH_BOUND (type); case TYPE_CODE_ENUM: - return TYPE_FIELD_BITPOS (type, TYPE_NFIELDS (type) - 1); + return TYPE_FIELD_ENUMVAL (type, TYPE_NFIELDS (type) - 1); case TYPE_CODE_BOOL: return 1; case TYPE_CODE_CHAR: @@ -701,7 +701,7 @@ ada_discrete_type_high_bound (struct type *type) } } -/* The largest value in the domain of TYPE, a discrete type, as an integer. */ +/* The smallest value in the domain of TYPE, a discrete type, as an integer. */ LONGEST ada_discrete_type_low_bound (struct type *type) { @@ -710,7 +710,7 @@ ada_discrete_type_low_bound (struct type *type) case TYPE_CODE_RANGE: return TYPE_LOW_BOUND (type); case TYPE_CODE_ENUM: - return TYPE_FIELD_BITPOS (type, 0); + return TYPE_FIELD_ENUMVAL (type, 0); case TYPE_CODE_BOOL: return 0; case TYPE_CODE_CHAR: @@ -4479,7 +4479,7 @@ ada_identical_enum_types_p (struct type *type1, struct type *type2) /* All enums in the type should have an identical underlying value. */ for (i = 0; i < TYPE_NFIELDS (type1); i++) - if (TYPE_FIELD_BITPOS (type1, i) != TYPE_FIELD_BITPOS (type2, i)) + if (TYPE_FIELD_ENUMVAL (type1, i) != TYPE_FIELD_ENUMVAL (type2, i)) return 0; /* All enumerals should also have the same name (modulo any numerical @@ -8284,7 +8284,7 @@ pos_atr (struct value *arg) for (i = 0; i < TYPE_NFIELDS (type); i += 1) { - if (v == TYPE_FIELD_BITPOS (type, i)) + if (v == TYPE_FIELD_ENUMVAL (type, i)) return i; } error (_("enumeration value is invalid: can't find 'POS")); @@ -8315,7 +8315,7 @@ value_val_atr (struct type *type, struct value *arg) if (pos < 0 || pos >= TYPE_NFIELDS (type)) error (_("argument to 'VAL out of range")); - return value_from_longest (type, TYPE_FIELD_BITPOS (type, pos)); + return value_from_longest (type, TYPE_FIELD_ENUMVAL (type, pos)); } else return value_from_longest (type, value_as_long (arg)); diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index 5599278..40f3058 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -274,7 +274,8 @@ static void print_enum_type (struct type *type, struct ui_file *stream) { int len = TYPE_NFIELDS (type); - int i, lastval; + int i; + LONGEST lastval; fprintf_filtered (stream, "("); wrap_here (" "); @@ -287,10 +288,11 @@ print_enum_type (struct type *type, struct ui_file *stream) fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (ada_enum_name (TYPE_FIELD_NAME (type, i)), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " => %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " => %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval += 1; } diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index a8351dd..72c6863 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -109,7 +109,7 @@ print_optional_low_bound (struct ui_file *stream, struct type *type, return 0; break; case TYPE_CODE_ENUM: - if (low_bound == TYPE_FIELD_BITPOS (index_type, 0)) + if (low_bound == TYPE_FIELD_ENUMVAL (index_type, 0)) return 0; break; case TYPE_CODE_UNDEF: @@ -402,7 +402,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) len = TYPE_NFIELDS (type); for (i = 0; i < len; i++) { - if (TYPE_FIELD_BITPOS (type, i) == val) + if (TYPE_FIELD_ENUMVAL (type, i) == val) { break; } @@ -822,7 +822,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, for (i = 0; i < len; i++) { QUIT; - if (val == TYPE_FIELD_BITPOS (type, i)) + if (val == TYPE_FIELD_ENUMVAL (type, i)) { break; } diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 21887c6..7de7b12 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -717,7 +717,6 @@ c_type_print_base (struct type *type, struct ui_file *stream, { int i; int len, real_len; - int lastval; enum { s_none, s_public, s_private, s_protected @@ -1194,9 +1193,9 @@ c_type_print_base (struct type *type, struct ui_file *stream, } else if (show > 0 || TYPE_TAG_NAME (type) == NULL) { + LONGEST lastval = 0; fprintf_filtered (stream, "{"); len = TYPE_NFIELDS (type); - lastval = 0; for (i = 0; i < len; i++) { QUIT; @@ -1204,11 +1203,11 @@ c_type_print_base (struct type *type, struct ui_file *stream, fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " = %d", - TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " = %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } diff --git a/gdb/coffread.c b/gdb/coffread.c index 30bf3f7..7c59535 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -2159,7 +2159,7 @@ coff_read_enum_type (int index, int length, int lastsym, SYMBOL_TYPE (xsym) = type; TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym); - SET_FIELD_BITPOS (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); + SET_FIELD_ENUMVAL (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); if (SYMBOL_VALUE (xsym) < 0) unsigned_enum = 0; TYPE_FIELD_BITSIZE (type, n) = 0; diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 4b49484..9fa7678 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8047,7 +8047,7 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) FIELD_NAME (fields[num_fields]) = SYMBOL_LINKAGE_NAME (sym); FIELD_TYPE (fields[num_fields]) = NULL; - SET_FIELD_BITPOS (fields[num_fields], SYMBOL_VALUE (sym)); + SET_FIELD_ENUMVAL (fields[num_fields], SYMBOL_VALUE (sym)); FIELD_BITSIZE (fields[num_fields]) = 0; num_fields++; diff --git a/gdb/gdb-gdb.py b/gdb/gdb-gdb.py index 579500f..1ea03ce 100644 --- a/gdb/gdb-gdb.py +++ b/gdb/gdb-gdb.py @@ -99,10 +99,10 @@ class TypeFlagsPrinter: return # Note: TYPE_FLAG_MIN is a duplicate of TYPE_FLAG_UNSIGNED, # so exclude it from the list we are building. - TYPE_FLAGS = [TypeFlag(field.name, field.bitpos) + TYPE_FLAGS = [TypeFlag(field.name, field.enumval) for field in flags.fields() if field.name != 'TYPE_FLAG_MIN'] - TYPE_FLAGS += [TypeFlag(field.name, field.bitpos) + TYPE_FLAGS += [TypeFlag(field.name, field.enumval) for field in iflags.fields()] TYPE_FLAGS.sort() @@ -154,6 +154,8 @@ class StructMainTypePrettyPrinter: loc_kind = str(field_val['loc_kind']) if loc_kind == "FIELD_LOC_KIND_BITPOS": return 'bitpos = %d' % loc_val['bitpos'] + elif loc_kind == "FIELD_LOC_KIND_ENUMVAL": + return 'enumval = %d' % loc_val['enumval'] elif loc_kind == "FIELD_LOC_KIND_PHYSADDR": return 'physaddr = 0x%x' % loc_val['physaddr'] elif loc_kind == "FIELD_LOC_KIND_PHYSNAME": diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index b6e8b4c..a55d93b 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -775,13 +775,13 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp) entries. */ int i; - *lowp = *highp = TYPE_FIELD_BITPOS (type, 0); + *lowp = *highp = TYPE_FIELD_ENUMVAL (type, 0); for (i = 0; i < TYPE_NFIELDS (type); i++) { - if (TYPE_FIELD_BITPOS (type, i) < *lowp) - *lowp = TYPE_FIELD_BITPOS (type, i); - if (TYPE_FIELD_BITPOS (type, i) > *highp) - *highp = TYPE_FIELD_BITPOS (type, i); + if (TYPE_FIELD_ENUMVAL (type, i) < *lowp) + *lowp = TYPE_FIELD_ENUMVAL (type, i); + if (TYPE_FIELD_ENUMVAL (type, i) > *highp) + *highp = TYPE_FIELD_ENUMVAL (type, i); } /* Set unsigned indicator if warranted. */ @@ -3197,10 +3197,15 @@ recursive_dump_type (struct type *type, int spaces) puts_filtered ("\n"); for (idx = 0; idx < TYPE_NFIELDS (type); idx++) { - printfi_filtered (spaces + 2, - "[%d] bitpos %d bitsize %d type ", - idx, TYPE_FIELD_BITPOS (type, idx), - TYPE_FIELD_BITSIZE (type, idx)); + if (TYPE_CODE (type) == TYPE_CODE_ENUM) + printfi_filtered (spaces + 2, + "[%d] enumval %s type ", + idx, plongest (TYPE_FIELD_ENUMVAL (type, idx))); + else + printfi_filtered (spaces + 2, + "[%d] bitpos %d bitsize %d type ", + idx, TYPE_FIELD_BITPOS (type, idx), + TYPE_FIELD_BITSIZE (type, idx)); gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); printf_filtered (" name '%s' (", TYPE_FIELD_NAME (type, idx) != NULL @@ -3397,6 +3402,10 @@ copy_type_recursive (struct objfile *objfile, SET_FIELD_BITPOS (TYPE_FIELD (new_type, i), TYPE_FIELD_BITPOS (type, i)); break; + case FIELD_LOC_KIND_ENUMVAL: + SET_FIELD_ENUMVAL (TYPE_FIELD (new_type, i), + TYPE_FIELD_ENUMVAL (type, i)); + break; case FIELD_LOC_KIND_PHYSADDR: SET_FIELD_PHYSADDR (TYPE_FIELD (new_type, i), TYPE_FIELD_STATIC_PHYSADDR (type, i)); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 07c3a86..01c62a5 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -351,6 +351,7 @@ enum type_instance_flag_value enum field_loc_kind { FIELD_LOC_KIND_BITPOS, /* bitpos */ + FIELD_LOC_KIND_ENUMVAL, /* enumval */ FIELD_LOC_KIND_PHYSADDR, /* physaddr */ FIELD_LOC_KIND_PHYSNAME, /* physname */ FIELD_LOC_KIND_DWARF_BLOCK /* dwarf_block */ @@ -511,11 +512,13 @@ struct main_type containing structure. For gdbarch_bits_big_endian=1 targets, it is the bit offset to the MSB. For gdbarch_bits_big_endian=0 targets, it is the bit offset to - the LSB. For a range bound or enum value, this is the - value itself. */ + the LSB. */ int bitpos; + /* Enum value. */ + LONGEST enumval; + /* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr is the location (in the target) of the static field. Otherwise, physname is the mangled label of the static field. */ @@ -538,7 +541,7 @@ struct main_type unsigned int artificial : 1; /* Discriminant for union field_location. */ - ENUM_BITFIELD(field_loc_kind) loc_kind : 2; + ENUM_BITFIELD(field_loc_kind) loc_kind : 3; /* Size of this field, in bits, or zero if not packed. If non-zero in an array type, indicates the element size in @@ -546,7 +549,7 @@ struct main_type For an unpacked field, the field's type's length says how many bytes the field occupies. */ - unsigned int bitsize : 29; + unsigned int bitsize : 28; /* In a struct or union type, type of this field. In a function or member type, type of this argument. @@ -931,7 +934,7 @@ struct call_site union field_location loc; /* Discriminant for union field_location. */ - ENUM_BITFIELD(field_loc_kind) loc_kind : 2; + ENUM_BITFIELD(field_loc_kind) loc_kind : 3; } target; @@ -1088,12 +1091,16 @@ extern void allocate_gnat_aux_type (struct type *); #define FIELD_NAME(thisfld) ((thisfld).name) #define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind) #define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos) +#define FIELD_ENUMVAL(thisfld) ((thisfld).loc.enumval) #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) #define SET_FIELD_BITPOS(thisfld, bitpos) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \ FIELD_BITPOS (thisfld) = (bitpos)) +#define SET_FIELD_ENUMVAL(thisfld, enumval) \ + (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_ENUMVAL, \ + FIELD_ENUMVAL (thisfld) = (enumval)) #define SET_FIELD_PHYSNAME(thisfld, name) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -1111,6 +1118,7 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n)) #define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) +#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n)) diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index 9735d7f..fb3d49c 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -607,10 +607,11 @@ m2_enum (struct type *type, struct ui_file *stream, int show, int level) fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { - fprintf_filtered (stream, " = %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + fprintf_filtered (stream, " = %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 299e94c..a20f953 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1047,7 +1047,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, if (tsym.st != stMember) break; - SET_FIELD_BITPOS (*f, tsym.value); + SET_FIELD_ENUMVAL (*f, tsym.value); FIELD_TYPE (*f) = t; FIELD_NAME (*f) = debug_info->ss + cur_fdr->issBase + tsym.iss; FIELD_BITSIZE (*f) = 0; diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index bc24495..a00f5b3 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -750,11 +750,12 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, fprintf_filtered (stream, ", "); wrap_here (" "); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); - if (lastval != TYPE_FIELD_BITPOS (type, i)) + if (lastval != TYPE_FIELD_ENUMVAL (type, i)) { fprintf_filtered (stream, - " := %d", TYPE_FIELD_BITPOS (type, i)); - lastval = TYPE_FIELD_BITPOS (type, i); + " := %s", + plongest (TYPE_FIELD_ENUMVAL (type, i))); + lastval = TYPE_FIELD_ENUMVAL (type, i); } lastval++; } diff --git a/gdb/python/lib/gdb/printing.py b/gdb/python/lib/gdb/printing.py index 0f399d0..b4e798d 100644 --- a/gdb/python/lib/gdb/printing.py +++ b/gdb/python/lib/gdb/printing.py @@ -247,10 +247,10 @@ class FlagEnumerationPrinter(PrettyPrinter): flags = gdb.lookup_type(self.name) self.enumerators = [] for field in flags.fields(): - self.enumerators.append((field.name, field.bitpos)) + self.enumerators.append((field.name, field.enumval)) # Sorting the enumerators by value usually does the right # thing. - self.enumerators.sort(key = lambda x: x.bitpos) + self.enumerators.sort(key = lambda x: x.enumval) if self.enabled: return _EnumInstance(self.enumerators, val) diff --git a/gdb/python/lib/gdb/types.py b/gdb/python/lib/gdb/types.py index aca84f3..66c9528 100644 --- a/gdb/python/lib/gdb/types.py +++ b/gdb/python/lib/gdb/types.py @@ -86,8 +86,8 @@ def make_enum_dict(enum_type): raise TypeError("not an enum type") enum_dict = {} for field in enum_type.fields(): - # The enum's value is stored in "bitpos". - enum_dict[field.name] = field.bitpos + # The enum's value is stored in "enumval". + enum_dict[field.name] = field.enumval return enum_dict diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index d47d4c8..230c8e2 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -167,11 +167,23 @@ convert_field (struct type *type, int field) if (!field_is_static (&TYPE_FIELD (type, field))) { - arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field)); + const char *attrstring; + + if (TYPE_CODE(type) == TYPE_CODE_ENUM) + { + arg = PyLong_FromLong (TYPE_FIELD_ENUMVAL (type, field)); + attrstring = "enumval"; + } + else + { + arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field)); + attrstring = "bitpos"; + } + if (!arg) goto fail; - if (PyObject_SetAttrString (result, "bitpos", arg) < 0) + if (PyObject_SetAttrString (result, attrstring, arg) < 0) goto failarg; } @@ -1018,6 +1030,10 @@ check_types_equal (struct type *type1, struct type *type2, if (FIELD_BITPOS (*field1) != FIELD_BITPOS (*field2)) return Py_NE; break; + case FIELD_LOC_KIND_ENUMVAL: + if (FIELD_ENUMVAL (*field1) != FIELD_ENUMVAL (*field2)) + return Py_NE; + break; case FIELD_LOC_KIND_PHYSADDR: if (FIELD_STATIC_PHYSADDR (*field1) != FIELD_STATIC_PHYSADDR (*field2)) diff --git a/gdb/stabsread.c b/gdb/stabsread.c index ac82652..bfd6c2e 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -3730,7 +3730,7 @@ read_enum_type (char **pp, struct type *type, SYMBOL_TYPE (xsym) = type; TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym); - TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym); + TYPE_FIELD_ENUMVAL (type, n) = SYMBOL_VALUE (xsym); TYPE_FIELD_BITSIZE (type, n) = 0; } if (syms == osyms) diff --git a/gdb/testsuite/gdb.base/enumval.c b/gdb/testsuite/gdb.base/enumval.c new file mode 100644 index 0000000..790d86c --- /dev/null +++ b/gdb/testsuite/gdb.base/enumval.c @@ -0,0 +1,30 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +enum e { I, J = 0xffffffffU } e = J; + +void +dummy() +{ +} + +int +main(void) +{ + dummy(); + return 0; +} diff --git a/gdb/testsuite/gdb.base/enumval.exp b/gdb/testsuite/gdb.base/enumval.exp new file mode 100644 index 0000000..5ec7950 --- /dev/null +++ b/gdb/testsuite/gdb.base/enumval.exp @@ -0,0 +1,29 @@ +# This testcase is part of GDB, the GNU debugger. + +# Copyright 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set testfile "enumval" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +if { [prepare_for_testing enumval.exp "enumval" "" {debug}] } { + return -1 +} + +# Check the real contents. +gdb_test "print e" "= J" + +gdb_test "print J" "= J" diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp index feb76ba..8e64b92 100644 --- a/gdb/testsuite/gdb.python/py-type.exp +++ b/gdb/testsuite/gdb.python/py-type.exp @@ -136,8 +136,8 @@ proc test_enums {} { gdb_test "python print len(e.type)" "3" "Check the number of enum fields" gdb_test "python print e.type\['v1'\].name" "v1" "Check enum field lookup by name" gdb_test "python print e.type\['v3'\].name" "v3" "Check enum field lookup by name" - gdb_test "python print \[v.bitpos for v in e.type.itervalues()\]" {\[0L, 1L, 2L\]} "Check num fields iteration over values" - gdb_test "python print \[(n, v.bitpos) for (n, v) in e.type.items()\]" {\[\('v1', 0L\), \('v2', 1L\), \('v3', 2L\)\]} "Check enum fields items list" + gdb_test "python print \[v.enumval for v in e.type.itervalues()\]" {\[0L, 1L, 2L\]} "Check num fields iteration over values" + gdb_test "python print \[(n, v.enumval) for (n, v) in e.type.items()\]" {\[\('v1', 0L\), \('v2', 1L\), \('v3', 2L\)\]} "Check enum fields items list" } proc test_base_class {} { gdb_py_test_silent_cmd "print d" "print value" 1 diff --git a/gdb/typeprint.c b/gdb/typeprint.c index f257f47..c25e705 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -206,7 +206,7 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream) len = TYPE_NFIELDS (type); for (i = 0; i < len; i++) { - if (TYPE_FIELD_BITPOS (type, i) == val) + if (TYPE_FIELD_ENUMVAL (type, i) == val) { break; } diff --git a/gdb/valprint.c b/gdb/valprint.c index 0037cb9..fdbd3e6 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -453,7 +453,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr, for (i = 0; i < len; i++) { QUIT; - if (val == TYPE_FIELD_BITPOS (type, i)) + if (val == TYPE_FIELD_ENUMVAL (type, i)) { break; } @@ -474,13 +474,13 @@ generic_val_print (struct type *type, const gdb_byte *valaddr, { QUIT; - if ((val & TYPE_FIELD_BITPOS (type, i)) != 0) + if ((val & TYPE_FIELD_ENUMVAL (type, i)) != 0) { if (!first) fputs_filtered (" | ", stream); first = 0; - val &= ~TYPE_FIELD_BITPOS (type, i); + val &= ~TYPE_FIELD_ENUMVAL (type, i); fputs_filtered (TYPE_FIELD_NAME (type, i), stream); } } -- 1.7.7.6 ^ permalink raw reply [flat|nested] 70+ messages in thread
* [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-03-21 10:06 ` [PATCH] Allow 64-bit enum values Siddhesh Poyarekar 2012-03-27 17:00 ` Jan Kratochvil 2012-03-28 16:55 ` [PATCH] Allow 64-bit enum values Tom Tromey @ 2012-04-17 13:11 ` Jan Kratochvil 2012-04-17 13:16 ` [patch!] " Jan Kratochvil ` (2 more replies) 2 siblings, 3 replies; 70+ messages in thread From: Jan Kratochvil @ 2012-04-17 13:11 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Tom Tromey, gdb-patches Hi Siddhesh, On Wed, 21 Mar 2012 11:06:32 +0100, Siddhesh Poyarekar wrote: > In the following patch, I introduce a separate > field_location union member 'enumval' which can accept LONGEST and > hence expand enum values to 64-bit signed values. your testcase does not test really 64-bit values. > +enum e { I, J = 0xffffffffU } e = J; When I used 64-bit entries like +enum e { I, J = 0xffffffffU, K = 0xf000000000000000ULL } e = J, f = K; it worked on amd64 but it did not work with GDB compiled on 32-bit host. This patch is unrelated. Testcase for 64-bit values going to post in the thread [PATCH] Allow 64-bit enum values It increases memory footprint but only on 32-bit hosts compiled without --enable-64-bit-bfd. sizeof (struct symbol): 44 -> 48 sizeof (struct minimal_symbol): 40 -> 44 BTW why we have minimal_symbol and expand it later when it has "the same" size? Just expanding the types would have the same effect. In all other configuration it has no memory footprint change. - /* The fact that this is a long not a LONGEST mainly limits the - range of a LOC_CONST. Since LOC_CONST_BYTES exists, I'm not - sure that is a big deal. */ - long ivalue; + LONGEST ivalue; Going to check it in, probably today, if there are any concerns about those 4 added bytes. No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu and with -gstabs+. Thanks, Jan gdb/ 2012-04-17 Jan Kratochvil <jan.kratochvil@redhat.com> Fix 64-bit constants on 32-bit hosts. * dwarf2read.c (read_unsigned_leb128): Change declaration return type from unsigned long to ULONGEST. (read_signed_leb128): Change declaration return type from long to LONGEST. (dwarf2_const_value_attr): Change declaration parameter value from long to LONGEST. (dwarf2_compute_name): Change variable value from long to LONGEST. (read_unsigned_leb128): Change return type, variable result and some casts from unsigned long to ULONGEST. (read_signed_leb128): Change return type, variable result and some casts from long to LONGEST. (dwarf2_const_value_data, dwarf2_const_value_attr): Change parameter value from long to LONGEST. (dwarf2_const_value): Change variable value from long to LONGEST. * symmisc.c (print_symbol): Change SYMBOL_VALUE format strings to use plongest and hex_string. * symtab.h (struct general_symbol_info): Change ivalue from long to LONGEST, remove the comment. * tracepoint.c (validate_actionline, collect_symbol, scope_info): Change SYMBOL_VALUE format strings to use plongest and hex_string. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 0e211ae..d237efb 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -957,9 +957,9 @@ static char *read_indirect_string (bfd *, gdb_byte *, const struct comp_unit_head *, unsigned int *); -static unsigned long read_unsigned_leb128 (bfd *, gdb_byte *, unsigned int *); +static ULONGEST read_unsigned_leb128 (bfd *, gdb_byte *, unsigned int *); -static long read_signed_leb128 (bfd *, gdb_byte *, unsigned int *); +static LONGEST read_signed_leb128 (bfd *, gdb_byte *, unsigned int *); static gdb_byte *skip_leb128 (bfd *, gdb_byte *); @@ -1008,7 +1008,7 @@ static void dwarf2_const_value_attr (struct attribute *attr, struct type *type, const char *name, struct obstack *obstack, - struct dwarf2_cu *cu, long *value, + struct dwarf2_cu *cu, LONGEST *value, gdb_byte **bytes, struct dwarf2_locexpr_baton **baton); @@ -5146,7 +5146,7 @@ dwarf2_compute_name (char *name, struct die_info *die, struct dwarf2_cu *cu, for (child = die->child; child != NULL; child = child->sibling) { struct type *type; - long value; + LONGEST value; gdb_byte *bytes; struct dwarf2_locexpr_baton *baton; struct value *v; @@ -10660,10 +10660,10 @@ read_indirect_string (bfd *abfd, gdb_byte *buf, return read_indirect_string_at_offset (abfd, str_offset); } -static unsigned long +static ULONGEST read_unsigned_leb128 (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read_ptr) { - unsigned long result; + ULONGEST result; unsigned int num_read; int i, shift; unsigned char byte; @@ -10677,7 +10677,7 @@ read_unsigned_leb128 (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read_ptr) byte = bfd_get_8 (abfd, buf); buf++; num_read++; - result |= ((unsigned long)(byte & 127) << shift); + result |= ((ULONGEST) (byte & 127) << shift); if ((byte & 128) == 0) { break; @@ -10688,10 +10688,10 @@ read_unsigned_leb128 (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read_ptr) return result; } -static long +static LONGEST read_signed_leb128 (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read_ptr) { - long result; + LONGEST result; int i, shift, num_read; unsigned char byte; @@ -10704,7 +10704,7 @@ read_signed_leb128 (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read_ptr) byte = bfd_get_8 (abfd, buf); buf++; num_read++; - result |= ((long)(byte & 127) << shift); + result |= ((LONGEST) (byte & 127) << shift); shift += 7; if ((byte & 128) == 0) { @@ -10712,7 +10712,7 @@ read_signed_leb128 (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read_ptr) } } if ((shift < 8 * sizeof (result)) && (byte & 0x40)) - result |= -(((long)1) << shift); + result |= -(((LONGEST) 1) << shift); *bytes_read_ptr = num_read; return result; } @@ -12037,7 +12037,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) static gdb_byte * dwarf2_const_value_data (struct attribute *attr, struct type *type, const char *name, struct obstack *obstack, - struct dwarf2_cu *cu, long *value, int bits) + struct dwarf2_cu *cu, LONGEST *value, int bits) { struct objfile *objfile = cu->objfile; enum bfd_endian byte_order = bfd_big_endian (objfile->obfd) ? @@ -12071,7 +12071,7 @@ static void dwarf2_const_value_attr (struct attribute *attr, struct type *type, const char *name, struct obstack *obstack, struct dwarf2_cu *cu, - long *value, gdb_byte **bytes, + LONGEST *value, gdb_byte **bytes, struct dwarf2_locexpr_baton **baton) { struct objfile *objfile = cu->objfile; @@ -12178,7 +12178,7 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym, { struct objfile *objfile = cu->objfile; struct comp_unit_head *cu_header = &cu->header; - long value; + LONGEST value; gdb_byte *bytes; struct dwarf2_locexpr_baton *baton; diff --git a/gdb/symmisc.c b/gdb/symmisc.c index daa0b43..b0ab29b 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -509,9 +509,9 @@ print_symbol (void *args) switch (SYMBOL_CLASS (symbol)) { case LOC_CONST: - fprintf_filtered (outfile, "const %ld (0x%lx)", - SYMBOL_VALUE (symbol), - SYMBOL_VALUE (symbol)); + fprintf_filtered (outfile, "const %s (%s)", + plongest (SYMBOL_VALUE (symbol)), + hex_string (SYMBOL_VALUE (symbol))); break; case LOC_CONST_BYTES: @@ -539,28 +539,31 @@ print_symbol (void *args) case LOC_REGISTER: if (SYMBOL_IS_ARGUMENT (symbol)) - fprintf_filtered (outfile, "parameter register %ld", - SYMBOL_VALUE (symbol)); + fprintf_filtered (outfile, "parameter register %s", + plongest (SYMBOL_VALUE (symbol))); else - fprintf_filtered (outfile, "register %ld", SYMBOL_VALUE (symbol)); + fprintf_filtered (outfile, "register %s", + plongest (SYMBOL_VALUE (symbol))); break; case LOC_ARG: - fprintf_filtered (outfile, "arg at offset 0x%lx", - SYMBOL_VALUE (symbol)); + fprintf_filtered (outfile, "arg at offset %s", + hex_string (SYMBOL_VALUE (symbol))); break; case LOC_REF_ARG: - fprintf_filtered (outfile, "reference arg at 0x%lx", SYMBOL_VALUE (symbol)); + fprintf_filtered (outfile, "reference arg at %s", + hex_string (SYMBOL_VALUE (symbol))); break; case LOC_REGPARM_ADDR: - fprintf_filtered (outfile, "address parameter register %ld", SYMBOL_VALUE (symbol)); + fprintf_filtered (outfile, "address parameter register %s", + plongest (SYMBOL_VALUE (symbol))); break; case LOC_LOCAL: - fprintf_filtered (outfile, "local at offset 0x%lx", - SYMBOL_VALUE (symbol)); + fprintf_filtered (outfile, "local at offset %s", + hex_string (SYMBOL_VALUE (symbol))); break; case LOC_TYPEDEF: diff --git a/gdb/symtab.h b/gdb/symtab.h index d9e5f4a..6933c0c 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -109,10 +109,7 @@ struct general_symbol_info union { - /* The fact that this is a long not a LONGEST mainly limits the - range of a LOC_CONST. Since LOC_CONST_BYTES exists, I'm not - sure that is a big deal. */ - long ivalue; + LONGEST ivalue; struct block *block; diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 057b441..86b6cfa 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -740,10 +740,10 @@ validate_actionline (char **line, struct breakpoint *b) { if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_CONST) { - error (_("constant `%s' (value %ld) " + error (_("constant `%s' (value %s) " "will not be collected."), SYMBOL_PRINT_NAME (exp->elts[2].symbol), - SYMBOL_VALUE (exp->elts[2].symbol)); + plongest (SYMBOL_VALUE (exp->elts[2].symbol))); } else if (SYMBOL_CLASS (exp->elts[2].symbol) == LOC_OPTIMIZED_OUT) @@ -980,8 +980,8 @@ collect_symbol (struct collection_list *collect, SYMBOL_CLASS (sym)); break; case LOC_CONST: - printf_filtered ("constant %s (value %ld) will not be collected.\n", - SYMBOL_PRINT_NAME (sym), SYMBOL_VALUE (sym)); + printf_filtered ("constant %s (value %s) will not be collected.\n", + SYMBOL_PRINT_NAME (sym), plongest (SYMBOL_VALUE (sym))); break; case LOC_STATIC: offset = SYMBOL_VALUE_ADDRESS (sym); @@ -2623,8 +2623,9 @@ scope_info (char *args, int from_tty) count--; /* Don't count this one. */ continue; case LOC_CONST: - printf_filtered ("a constant with value %ld (0x%lx)", - SYMBOL_VALUE (sym), SYMBOL_VALUE (sym)); + printf_filtered ("a constant with value %s (%s)", + plongest (SYMBOL_VALUE (sym)), + hex_string (SYMBOL_VALUE (sym))); break; case LOC_CONST_BYTES: printf_filtered ("constant bytes: "); @@ -2657,16 +2658,16 @@ scope_info (char *args, int from_tty) gdbarch_register_name (gdbarch, regno)); break; case LOC_ARG: - printf_filtered ("an argument at stack/frame offset %ld", - SYMBOL_VALUE (sym)); + printf_filtered ("an argument at stack/frame offset %s", + plongest (SYMBOL_VALUE (sym))); break; case LOC_LOCAL: - printf_filtered ("a local variable at frame offset %ld", - SYMBOL_VALUE (sym)); + printf_filtered ("a local variable at frame offset %s", + plongest (SYMBOL_VALUE (sym))); break; case LOC_REF_ARG: - printf_filtered ("a reference argument at offset %ld", - SYMBOL_VALUE (sym)); + printf_filtered ("a reference argument at offset %s", + plongest (SYMBOL_VALUE (sym))); break; case LOC_REGPARM_ADDR: /* Note comment at LOC_REGISTER. */ ^ permalink raw reply [flat|nested] 70+ messages in thread
* [patch!] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 13:11 ` [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] Jan Kratochvil @ 2012-04-17 13:16 ` Jan Kratochvil 2012-04-17 14:33 ` [commit] " Tom Tromey 2012-04-17 14:33 ` [patch] " Jan Kratochvil 2 siblings, 0 replies; 70+ messages in thread From: Jan Kratochvil @ 2012-04-17 13:16 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Tom Tromey, gdb-patches Just subject fix, I did not commit it yet in the end. ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 13:11 ` [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] Jan Kratochvil 2012-04-17 13:16 ` [patch!] " Jan Kratochvil @ 2012-04-17 14:33 ` Tom Tromey 2012-04-17 14:55 ` Jan Kratochvil 2012-04-17 19:32 ` Jan Kratochvil 2012-04-17 14:33 ` [patch] " Jan Kratochvil 2 siblings, 2 replies; 70+ messages in thread From: Tom Tromey @ 2012-04-17 14:33 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Siddhesh Poyarekar, gdb-patches >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes: Jan> BTW why we have minimal_symbol and expand it later when it has "the same" Jan> size? Just expanding the types would have the same effect. We discussed on irc, Jan was confused :) Jan> In all other configuration it has no memory footprint change. Jan> - /* The fact that this is a long not a LONGEST mainly limits the Jan> - range of a LOC_CONST. Since LOC_CONST_BYTES exists, I'm not Jan> - sure that is a big deal. */ Jan> - long ivalue; Jan> + LONGEST ivalue; Jan> Going to check it in, probably today, if there are any concerns about those Jan> 4 added bytes. I personally am not particularly concerned. But the comment that you removed seems to indicate another possible approach -- just use LOC_CONST_BYTES for these enum values. Would that not work for some reason? I am thinking that presumably people who build a 32-bit gdb without --enable-64-bit-bfd are interested in the smallest memory footprint. Also presumably they are not likely to be debugging many 64 bit processes or perhaps even using enums with values requiring 64 bits; certainly those would be relatively rare cases. So, if LOC_CONST_BYTES works, it would be an overall memory savings. What do you think of this? Tom ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 14:33 ` [commit] " Tom Tromey @ 2012-04-17 14:55 ` Jan Kratochvil 2012-04-17 15:18 ` Tom Tromey 2012-04-17 19:32 ` Jan Kratochvil 1 sibling, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-04-17 14:55 UTC (permalink / raw) To: Tom Tromey; +Cc: Siddhesh Poyarekar, gdb-patches On Tue, 17 Apr 2012 16:32:54 +0200, Tom Tromey wrote: > But the comment that you removed seems to indicate another possible > approach -- just use LOC_CONST_BYTES for these enum values. > > Would that not work for some reason? > > I am thinking that presumably people who build a 32-bit gdb without > --enable-64-bit-bfd are interested in the smallest memory footprint. > Also presumably they are not likely to be debugging many 64 bit > processes or perhaps even using enums with values requiring 64 bits; > certainly those would be relatively rare cases. So, if LOC_CONST_BYTES > works, it would be an overall memory savings. > > What do you think of this? I did not think such optimization is worth the work. But I am aware you and Google did various work on the memory footprint reduction. From my point of view 32-bit GDB without --enable-64-bit-bfd either does not exist (anywhere in Fedora) or it is some very special build. The problem is LOC_CONST_BYTES needs special handling and current accessor of SYMBOL_VALUE and its other union-accessors like SYMBOL_VALUE_BYTES cannot be easily protected in any way without either ({ forbidden GCC extensions }) or ->C++_accessor() so I am reluctant to break existing code blindly expecting LOC_CONST without checking it and using SYMBOL_VALUE. Also I think if 40 vs. 44 minimal_symbol size is of any concern we should do some real fixes such as lazy objfiles reading or lazy minimal_symbol expansion. partial_symbol memory cost seems to be fixed by .gdb_index already, isn't it? Full symbol tables get expanded in some cases but that should also be fixed in a real way (such as some <tab>-complation expands them while it could not have to) instead of saving 4 out of 44 bytes. Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 14:55 ` Jan Kratochvil @ 2012-04-17 15:18 ` Tom Tromey 2012-04-17 15:32 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Tom Tromey @ 2012-04-17 15:18 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Siddhesh Poyarekar, gdb-patches >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes: Jan> I did not think such optimization is worth the work. But I am Jan> aware you and Google did various work on the memory footprint Jan> reduction. From my point of view 32-bit GDB without Jan> --enable-64-bit-bfd either does not exist (anywhere in Fedora) or Jan> it is some very special build. Yeah. Jan> The problem is LOC_CONST_BYTES needs special handling and current Jan> accessor of SYMBOL_VALUE and its other union-accessors like Jan> SYMBOL_VALUE_BYTES cannot be easily protected in any way without Jan> either ({ forbidden GCC extensions }) or ->C++_accessor() so I am Jan> reluctant to break existing code blindly expecting LOC_CONST Jan> without checking it and using SYMBOL_VALUE. If that code exists it has to be a crash waiting to happen. Jan> Also I think if 40 vs. 44 minimal_symbol size is of any concern we Jan> should do some real fixes such as lazy objfiles reading or lazy Jan> minimal_symbol expansion. partial_symbol memory cost seems to be Jan> fixed by .gdb_index already, isn't it? I guess so, but it isn't universally used (and really isn't that good for all uses). And as you've pointed out, idb does fine without needing this. Jan> Full symbol tables get expanded in some cases but that should also Jan> be fixed in a real way (such as some <tab>-complation expands them Jan> while it could not have to) instead of saving 4 out of 44 bytes. The completion thing is an interesting idea. It does seem pointless to expand symtabs in this case. I wonder if there is a rationale. Tom ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 15:18 ` Tom Tromey @ 2012-04-17 15:32 ` Jan Kratochvil 0 siblings, 0 replies; 70+ messages in thread From: Jan Kratochvil @ 2012-04-17 15:32 UTC (permalink / raw) To: Tom Tromey; +Cc: Siddhesh Poyarekar, gdb-patches On Tue, 17 Apr 2012 17:17:03 +0200, Tom Tromey wrote: > The completion thing is an interesting idea. > It does seem pointless to expand symtabs in this case. > I wonder if there is a rationale. The completion works also for C++ function parameters. For the parameters you already need the symtabs expanded, to even just display them. But sure in practice (a) One completes on the function name part, not completing the parameters, so in fact one does not need the expansion. (b) If there are more than a handful options user sees just the first screen and presses rather "q <return> to quit", so collecting parameters from all the functions is also pointless. Regards, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 14:33 ` [commit] " Tom Tromey 2012-04-17 14:55 ` Jan Kratochvil @ 2012-04-17 19:32 ` Jan Kratochvil 2012-04-17 20:51 ` Tom Tromey 1 sibling, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-04-17 19:32 UTC (permalink / raw) To: Tom Tromey; +Cc: Siddhesh Poyarekar, gdb-patches On Tue, 17 Apr 2012 16:32:54 +0200, Tom Tromey wrote: > I am thinking that presumably people who build a 32-bit gdb without > --enable-64-bit-bfd are interested in the smallest memory footprint. > Also presumably they are not likely to be debugging many 64 bit > processes or perhaps even using enums with values requiring 64 bits; > certainly those would be relatively rare cases. So, if LOC_CONST_BYTES > works, it would be an overall memory savings. While I would never have that idea myself I can also do: #ifdef BFD64 LONGEST ivalue; #else long ivalue; #endif It always keeps the memory footprint and makes 64-bit constants working on 32-bit gdb --enable-64-bit-bfd builds. Regards, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 19:32 ` Jan Kratochvil @ 2012-04-17 20:51 ` Tom Tromey 2012-04-18 7:01 ` [real commit] " Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Tom Tromey @ 2012-04-17 20:51 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Siddhesh Poyarekar, gdb-patches >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes: Jan> While I would never have that idea myself I can also do: Jan> #ifdef BFD64 Jan> LONGEST ivalue; Jan> #else Jan> long ivalue; Jan> #endif Jan> It always keeps the memory footprint and makes 64-bit constants working on Jan> 32-bit gdb --enable-64-bit-bfd builds. I think on the whole I'd prefer your original patch over this. I tend to agree that these builds are not very common any more. If anyone reading this objects, let us know; we can always back it out or whatever. Tom ^ permalink raw reply [flat|nested] 70+ messages in thread
* [real commit] [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 20:51 ` Tom Tromey @ 2012-04-18 7:01 ` Jan Kratochvil 0 siblings, 0 replies; 70+ messages in thread From: Jan Kratochvil @ 2012-04-18 7:01 UTC (permalink / raw) To: Tom Tromey; +Cc: Siddhesh Poyarekar, gdb-patches On Tue, 17 Apr 2012 21:31:39 +0200, Tom Tromey wrote: > I think on the whole I'd prefer your original patch over this. > I tend to agree that these builds are not very common any more. Therefore checked it in in its original form: http://sourceware.org/ml/gdb-cvs/2012-04/msg00128.html Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [patch] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 13:11 ` [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] Jan Kratochvil 2012-04-17 13:16 ` [patch!] " Jan Kratochvil 2012-04-17 14:33 ` [commit] " Tom Tromey @ 2012-04-17 14:33 ` Jan Kratochvil 2012-04-17 15:59 ` Tom Tromey 2 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-04-17 14:33 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Tom Tromey, gdb-patches On Tue, 17 Apr 2012 15:08:33 +0200, Jan Kratochvil wrote: > It increases memory footprint but only on 32-bit hosts compiled without > --enable-64-bit-bfd. > sizeof (struct symbol): 44 -> 48 > sizeof (struct minimal_symbol): 40 -> 44 > > BTW why we have minimal_symbol and expand it later when it has "the same" > size? Just expanding the types would have the same effect. I mixed up it here a bit as found by Tom, corrected: It increases memory footprint but only on 32-bit hosts compiled without --enable-64-bit-bfd. sizeof (struct symbol): 44 -> 48 sizeof (struct partial_symbol): 24 -> 28 sizeof (struct minimal_symbol): 40 -> 44 all three share: sizeof (struct general_symbol_info): 20 -> 24 The expansion is for partial_symbol -> symbol which may have some sense as it saves almost 50% of space, both represent one DWARF symbol. Sure minimal_symbol is never expanded it is ELF symbol. (ignoring non-ELF/non-DWARF symbol files here) Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [patch] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 14:33 ` [patch] " Jan Kratochvil @ 2012-04-17 15:59 ` Tom Tromey 2012-04-17 15:42 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Tom Tromey @ 2012-04-17 15:59 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Siddhesh Poyarekar, gdb-patches >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes: Jan> The expansion is for partial_symbol -> symbol which may have some Jan> sense as it saves almost 50% of space, both represent one DWARF Jan> symbol. I looked into this recently while thinking about lazy CU expansion. The main difficulty is that you need a way to associate the psymbol with the full symbol. Right now there is no way at all to do this. In DWARF terms this means storing the DIE offset in the psymbol. But, this is a problem for two reasons. First, the bcache really helps with the size of psymbols, but if you store the DIE offset in the psymbol itself, it will defeat the purpose of the bcache. Second, of course, adding anything to psymbols makes them larger; and since most psymbols are not in fact expanded, the overall effect may be a lose. This latter consideration is why I am not yet persuaded that the change is worth doing in isolation. I think it could be done by storing the DIE offset in the psymbol lists, instead of in the psymbol itself. This could be a fairly localized change (even optional, per-objfile) in psymtab.c. Then, you could have two variants of struct symbol -- one that has a pointer to its corresponding psymbol, and one that includes the psymbol. This would mean updating all the accessors to check a bit in the symbol. Due to the way that struct symbol is packed, I think this would only save sizeof(general_symbol_info) - sizeof(void*) bytes (32 bytes per symbol on x86-64). This idea would make lazy CU expansion a bit faster, because you wouldn't have to re-scan the DIEs to make the symbol table. Then the idea would be to make symbols whose types and (for functions) blocks are uninitialized, then change SYMBOL_TYPE et al to read and interpret the necessary DIEs on demand. I think this isn't extremely hard, but the tradeoffs are still not entirely clear to me, and as you pointed out on irc, the result will still probably be slower than idb -- IOW, we're doing something really wrong, so why not start by finding that? Tom ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [patch] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 15:59 ` Tom Tromey @ 2012-04-17 15:42 ` Jan Kratochvil 2012-04-17 15:52 ` Tom Tromey 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-04-17 15:42 UTC (permalink / raw) To: Tom Tromey; +Cc: Siddhesh Poyarekar, gdb-patches On Tue, 17 Apr 2012 17:09:23 +0200, Tom Tromey wrote: > Due to the way that struct symbol is packed, I think this would only > save sizeof(general_symbol_info) - sizeof(void*) bytes (32 bytes per > symbol on x86-64). Personally I still do not think we should care too much about one 'struct symbol'. There is more a problem we create too many 'struct symbol' which are never used. > This idea would make lazy CU expansion a bit faster, because you > wouldn't have to re-scan the DIEs to make the symbol table. I think this would be a win contrary to other disadvantages; I have sure no technical arguments for that, other than accessing memory outside of the CPU cache is terribly slow and several more bytes are worth the acceleration. > and as you pointed out on irc, the result will > still probably be slower than idb -- IOW, we're doing something really > wrong, so why not start by finding that? BTW without making some big decisions one should do some more serious test of idb, or at least to be tested by a second person, I did just a quick test myself (that GDB is 800%-times slower even with .gdb_index), I could make some mistakes and I even no longer remember all the details how I specifically did the test. Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [patch] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] 2012-04-17 15:42 ` Jan Kratochvil @ 2012-04-17 15:52 ` Tom Tromey 0 siblings, 0 replies; 70+ messages in thread From: Tom Tromey @ 2012-04-17 15:52 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Siddhesh Poyarekar, gdb-patches >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes: Tom> This idea would make lazy CU expansion a bit faster, because you Tom> wouldn't have to re-scan the DIEs to make the symbol table. Jan> I think this would be a win contrary to other disadvantages; I have Jan> sure no technical arguments for that, other than accessing memory Jan> outside of the CPU cache is terribly slow and several more bytes Jan> are worth the acceleration. Yeah, that makes sense to me. Not scanning the .debug_info again seems like it could really win. Tom> and as you pointed out on irc, the result will Tom> still probably be slower than idb -- IOW, we're doing something really Tom> wrong, so why not start by finding that? Jan> BTW without making some big decisions one should do some more Jan> serious test of idb, or at least to be tested by a second person, I Jan> did just a quick test myself (that GDB is 800%-times slower even Jan> with .gdb_index), I could make some mistakes and I even no longer Jan> remember all the details how I specifically did the test. Yeah, I'd like to get to it eventually. One nice thing about the psymtab->symtab thought experiment is that I've convinced myself that the problem, whatever it may be, can at least be isolated down to dwarf2read.c. So, I feel it must be fixable without excessive work on gdb. Tom ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct 2012-02-20 14:53 [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct Siddhesh Poyarekar 2012-02-21 20:46 ` Tom Tromey @ 2012-02-21 21:39 ` Jan Kratochvil 2012-05-04 13:10 ` [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST Siddhesh Poyarekar 1 sibling, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-02-21 21:39 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches On Mon, 20 Feb 2012 14:28:24 +0100, Siddhesh Poyarekar wrote: > @@ -1318,13 +1318,13 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, > > /* The first and one-after-last bits in the field, but rounded down > and up to byte boundaries. */ > - int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; > - int bound_end = (((end + TARGET_CHAR_BIT - 1) > + LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; > + LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1) > / TARGET_CHAR_BIT) > * TARGET_CHAR_BIT); In these cases one needs to also reindent the two TARGET_CHAR_BIT lines to properly match their columns. On top of Tom's comments - have you verified you caught all the cases? In these cases I use some typedef struct { LONGEST x; } LONGESTT; which is compatible for assignment only with itself catching all the cases. Unfortunately one needs to adjust by hand all the arithmetic operations just for the purpose of this verification. I guess there exist better static analysis tools for that. Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-02-21 21:39 ` [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct Jan Kratochvil @ 2012-05-04 13:10 ` Siddhesh Poyarekar 2012-05-15 9:46 ` ping: " Siddhesh Poyarekar 2012-05-15 20:07 ` Jan Kratochvil 0 siblings, 2 replies; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-05-04 13:10 UTC (permalink / raw) To: gdb-patches; +Cc: Tom Tromey, Jan Kratochvil [-- Attachment #1: Type: text/plain, Size: 28551 bytes --] Hi, I have finally finished this off with a combined patch to expand bitpos to LONGEST and type.length to ULONGEST. A quick recap of the problem I'm trying to solve: Currently gdb stores type sizes and struct offsets in 32-bit unsigned and int respectively, which overflows for larger values. This patch extends these values and all its usages throughout the code to the longest possible values so that gdb can read larger structs, arrays and ofsets within those structs and arrays. An initial patch had gone in to avoid overloading the meaning of structure offset with enum values, primarily to allow bitpos to be defined as ULONGEST: http://sourceware.org/ml/gdb-patches/2012-04/msg00538.html This however is not possible anyway, since bitpos may be negative for vtable offsets and as a result, I have extended bitpos to LONGEST in this patch. I have attached the test case patch as a separate file. Below is the changelog. Regards, Siddhesh gdb/ChangeLog 2012-05-04 Siddhesh Poyarekar <siddhesh@redhat.com> * ada-lang.c (fat_pntr_bounds_bitpos): Return LONGEST. (fat_pntr_data_bitpos): Likewise. (desc_bound_bitpos): Likewise. (constrained_packed_array_type): Expand elt_bits parameter to LONGEST. (move_bits): Expand parameters src_offset and n to ULONGEST. (ada_index_struct_field): Expand parameters index and offset to LONGEST. (cond_offset_host): Expand parameter offset to LONGEST. (cond_offset_target): Likewise. (ada_type_of_array): Expand array_bitsize to LONGEST. (decode_constrained_packed_array_type): Expand bits to ULONGEST. (decode_constrained_packed_array): Expand bit_pos to LONGEST. (ada_value_primitive_packed_val): Expand parameter offset to LONGEST. Expand targ to LONGEST and ntarg to ULONGEST. (ada_value_assign): Expand from_size to ULONGEST. (value_assign_to_component): Expand bits to ULONGEST. (ensure_lval): Expand len to ULONGEST. (value_pointer): Likewise. (value_tag_from_contents_and_address): Expand tag_byte_offset to LONGEST. (ada_value_primitive_field): Expand parameter offset to LONGEST. Expand bit_pos to LONGEST. (find_struct_field): Expand parameters offset and byte_offset_p to LONGEST. Expand bit_pos and fld_offset to LONGEST. (ada_search_struct_field): Expand parameter offset to LONGEST. Expand var_offset to LONGEST. (ada_index_struct_field): Expand parameters index and offset to LONGEST. (ada_index_struct_field_1): Expand parameters index_p and offset to LONGEST. (ada_value_struct_elt): Expand byte_offset to LONGEST. (align_value): Return ULONGEST. Expand parameter off to LONGEST and alignment to ULONGEST. (ada_template_to_fixed_record_type_1): Expand off, bit_len and fld_bit_len to ULONGEST. Expand field_offset to LONGEST. Use pulongest function to print TYPE_LENGTH. (to_fixed_array_type): Expand len to ULONGEST. * ada-lang.h (ada_val_print): Expand parameter embedded_offset to LONGEST. (ada_printstr): Expand parameter length to ULONGEST. (ada_value_primitive_packed_val): Expand parameter offset to LONGEST. * ada-typeprint.c (ada_print_type): Use pulongest to print TYPE_LENGTH. * ada-valprint.c (val_print_packed_array_elements): Expand eltlen to ULONGEST. (char_at): Expand parameter i to ULONGEST. (printstr): Expand parameter length to ULONGEST. (ada_printstr): Likewise. (ada_val_print): Expand embedded_offset to LONGEST. (ada_val_print_array): Expand eltlen, len and temp_len to ULONGEST. (ada_val_print_1): Expand parameter offset to ULONGEST. Expand len to ULONGEST. (print_variant_part): Expand parameters offset and outer_offset to LONGEST. (print_field_values): Likewise. Expand bit_pos to LONGEST. * alpha-tdep.c (struct alpha_arg): Expand member len to ULONGEST. (alpha_push_dummy_call): Expand len to ULONGEST. (alpha_extract_return_value): Expand length to ULONGEST. (alpha_store_return_value): Likewise. * amd64-tdep.c (amd64_classify_aggregate): Expand len, bitsize, endpos to ULONGEST and pos to LONGEST. (amd64_classify): Expand len to ULONGEST. (amd64_return_value): Expand len to LONGEST. (amd64_push_arguments): Expand num_elements, element to ULONGEST and len to LONGEST. (amd64_get_longjmp_target): Expand len to ULONGEST. * amd64-windows-tdep.c (amd64_windows_return_value): Expand len to LONGEST. * arm-tdep.c (arm_push_dummy_call): Expand len to LONGEST. (arm_extract_return_value): Expand len to ULONGEST. (arm_store_return_value): Likewise. * avr-tdep.c (avr_return_value): Expand i to ULONGEST. (push_stack_item): Expand parameter len to ULONGEST. (avr_push_dummy_call): Expand last_regnum, len to ULONGEST. * ax-gdb.c (gen_trace_static_fields): Expand length to ULONGEST. (gen_traced_pop): Likewise. (gen_left_shift): Expand parameter distance to LONGEST. (gen_offset): Expand parameter offset to LONGEST. (gen_bitfield_ref): Expand parameters start, end to LONGEST. Expand bound_start, bound_endi, offset to LONGEST. (gen_primitive_field): Expand parameter offset to LONGEST. (gen_struct_ref_recursive): Likewise. * bfin-tdep.c (bfin_push_dummy_call): Expand total_len, len, container_len to ULONGEST. (bfin_extract_return_value): Expand len to LONGEST. (bfin_store_return_value): Likewise. * breakpoint.c (update_watchpoint): Expand len to ULONGEST. (can_use_hardware_watchpoint): Likewise. (invalidate_bp_value_on_memory_change): Expand parameter len to LONGEST. * breakpoint.h (struct bp_location): Expand member length to ULONGEST. * c-lang.c (c_printstr): Expand parameter length to ULONGEST. Remove unused variable width. (evaluate_subexp_c): Expand element_size, i to ULONGEST. * c-lang.h (c_val_print): Expand parameter embedded_offset to LONGEST. (c_printstr): Expand parameter length to ULONGEST. (cp_print_value_fields): Expand parameter offset to LONGEST. (cp_print_value_fields_rtti): Likewise. * c-typeprint.c (c_type_print_varspec_suffix): Remove cast down to int and use pulongest to print ULONGEST. * c-valprint.c (c_val_print): Expand parameter embedded_offset to LONGEST. Expand offset to LONGEST, eltlen to ULONGEST. (c_value_print): Expand top to LONGEST. * corefile.c (read_memory): Expand len to ULONGEST. (read_stack): Likewise. (write_memory): Likewise. * cp-abi.c (baseclass_offset): Return LONGEST. Expand parameter embedded_offset to LONGEST. Expand res to LONGEST. (value_virtual_fn_field): Expand parameter offset to LONGEST. (value_rtti_type): Expand parameter top to LONGEST *. * cp-abi.h (value_virtual_fn_field): Expand offset to LONGEST. (value_rtti_type): Expand top to LONGEST *. (baseclass_offset): Return LONGEST. Expand parameter embedded_offset to LONGEST. (struct cp_abi_ops): Expand parameter offset for virtual_fn_field to LONGEST. Expand parameter top to LONGEST * in value_rtti_type. Return LONGEST from baseclass_offset and expand parameter for embedded_offset to LONGEST. * cp-valprint.c (cp_print_value_fields): Expand parameter offset to LONGEST. (cp_print_value_fields_rtti): Likewise. Expand top to LONGEST. (cp_print_value): Expand parameter offset to LONGEST. Expand thisoffset, boffset to LONGEST. (cp_find_class_member): Expand bitsize to ULONGEST. * cris-tdep.c (push_stack_item): Expand parameter len to ULONGEST. (cris_push_dummy_call): Expand len, reg_demand, i to ULONGEST. (cris_store_return_value): Expand len to ULONGEST. (cris_extract_return_value): Likewise. * d-lang.h (d_val_print): Expand parameter embedded_offset to LONGEST. * d-valprint.c (dynamic_array_type): Likewise. (d_val_print): Likewise. * doc/observer.texi (memory_changed): Expand parameter len to LONGEST. * doublest.c (floatformat_from_length): Likewise. Use pulongest to format string for ULONGEST. * dwarf2loc.c (copy_bitwise): Expand parameters dest_offset_bits, bit_count to ULONGEST. Rename parameter source_offset_bits to source_offset and expand to ULONGEST. New variable source_offset_bits. (read_pieced_value): Expand offset, dest_offset_bits, source_offset_bits, source_offset to LONGEST. Expand type_len, this_size, this_size_bits to ULONGEST. (write_pieced_value): Expand type_len, this_size, this_size_bits to ULONGEST. Expand dest_offset_bits, source_offset_bits, dest_offset, source_offset to LONGEST. (check_pieced_value_bits): Expand parameter bit_length to ULONGEST. (check_pieced_value_validity): Likewise. (check_pieced_synthetic_pointer): Likewise. (indirect_pieced_value): Expand bit_length to ULONGEST. Expand bit_offset to LONGEST. (dwarf2_evaluate_loc_desc_full): Expand n to ULONGEST. * dwarf2read.c (struct dwarf_block): ULONGEST size. (dwarf2_const_value_length_mismatch_complaint): Expand parameters arg2 and arg3 to ULONGEST. Use pulongest to print arg2 and arg3. (dwarf2_add_field): Expand anonymous size to ULONGEST. (dump_die_shallow): Use pulongest to print dwarf_block.size. * eval.c (evaluate_struct_tuple): Expand bitpos to LONGEST. (init_array_element): Expand element_size to ULONGEST. (binop_promote): Expand promoted_len1, promoted_len2, result_len to ULONGEST. (evaluate_subexp_standard): Expand mem_offset, top to LONGEST. Expand element_size to ULONGEST. * f-lang.c (f_printstr): Expand parameter length to ULONGEST. * f-lang.h (f_val_print): Expand parameter embedded_offset to LONGEST. * f-valprint.c (f77_array_offset_tbl): Make LONGEST. (f77_create_arrayprint_offset_tbl): Expand eltlen to ULONGEST. (f77_print_array_1): Expand parameter embedded_offset to LONGEST. (f77_print_array): Likewise. (f_val_print): Likewise. Expand offset to LONGEST. * findcmd.c (parse_find_args): Expand val_bytes to ULONGEST. * findvar.c (extract_unsigned_integer): Remove unnecessary cast. (default_read_var_value): Expand len to ULONGEST. (default_value_from_register): Likewise. (read_frame_register_value): Expand offset, reg_offset to LONGEST. Expand len, reg_len to ULONGEST. * frv-tdep.c (frv_extract_return_value): Expand len to ULONGEST. Use pulongest to format print len. (frv_push_dummy_call): Expand len to ULONGEST. (frv_store_return_value): Likewise. Use pulongest to format print len. * gdbcore.h (read_memory): Expand parameter len to ULONGEST. (read_stack): Likewise. (write_memory): Likewise. * gdbtypes.c (init_type): Expand parameter length to ULONGEST. (is_unique_ancestor_worker): Expand parameters offset, embedded_offset to LONGEST. Expand this_offset to LONGEST. (recursive_dump_type): Use pulongest to format print TYPE_LENGTH. Use plongest to format print TYPE_FIELD_BITPOS. (arch_type): Expand parameter length to ULONGEST. * gdbtypes.h (type.main_type.fld_bnds.fields): Expand bitpos to LONGEST. (type): Expand length to ULONGEST. (init_type): Expand parameter length to ULONGEST. (arch_type): Likewise. * gnu-v2-abi.c (gnuv2_virtual_fn_field): Expand parameter offset to LONGEST. (gnuv2_value_rtti_type): Expand parameter top to LONGEST *. (gnuv2_baseclass_offset): Return LONGEST. Expand parameter embedded_offset to LONGEST. Expand field_offset, boffset to LONGEST, field_length to ULONGEST. * gnu-v3-abi.c (build_gdb_vtable_type): Expand offset to LONGEST. (vtable_address_point_offset): Return LONGEST. (gnuv3_rtti_type): Expand parameter top_p to LONGEST *. (gnuv3_virtual_fn_field): Expand parameter offset to LONGEST. (gnuv3_baseclass_offset): Return LONGEST. Expand parameter embedded_ofset to LONGEST. Expand cur_base_offset, base_offset to LONGEST. (gnuv3_find_method_in): Expand pos to LONGEST. * go-lang.h (go_val_print): Expand parameter embedded_offset to LONGEST. * go-valprint.c (go_val_print): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Expand stack_alloc, stack_offset, len, padded_len, offset to LONGEST. * hppa-tdep.c (hppa64_push_dummy_call): Expand len to ULONGEST. (hppa64_return_value): Likewise. * i386-darwin-tdep.c (i386_darwin_arg_type_alignment): Return ULONGEST. Expand res to ULONGEST. (i386_darwin_push_dummy_call): Expand arg_spaces, len, align to ULONGEST. * i386-nat.c (i386_handle_nonaligned_watchpoint): Expand parameter len to ULONGEST. (i386_region_ok_for_watchpoint): Expand parameter len to LONGEST. * i386-tdep.c (i386_push_dummy_call): Expand arg_space, arg_space_used, len to ULONGEST. (i386_extract_return_value): Expand len to ULONGEST. Use pulongest to format print len. (i386_store_return_value): Likewise. * ia64-tdep.c (ia64_extract_return_value): Expand n to ULONGEST. (ia64_store_return_value): Likewise. (ia64_push_dummy_call): Expand argoffset, len, nslots, memslots to ULONGEST. * infcall.c (call_function_by_hand): Expand len to ULONGEST. * infrun.c (save_infcall_suspend_state): Expand len to ULONGEST. (restore_infcall_suspend_state): Eliminate single-use variable len. * iq2000-tdep.c (iq2000_store_return_value): Expand len to ULONGEST. (iq2000_extract_return_value): Likewise. Use len instead of TYPE_LENGTH. (iq2000_push_dummy_call): Expand typelen, stackspace to ULONGEST. * jv-lang.c (java_link_class_type): Expand boffset to LONGEST. (java_printstr): Expand parameter length to ULONGEST. * jv-lang.h (java_val_print): Expand parameter embedded_offset to LONGEST. * jv-valprint.c (java_print_value_fields): Expand parameter offset to LONGEST. (java_val_print): Expand parameter embedded_offset to LONGEST. * language.c (unk_lang_printstr): Expand parameter length to ULONGEST. (unk_lang_val_print): Expand parameter embedded_offset to LONGEST. * language.h (language_defn): Expand parameter length of la_printstr to ULONGEST. Expand parameter embedded_offset of la_val_print to LONGEST. * lm32-tdep.c (lm32_push_dummy_call): Expand len to ULONGEST. (lm32_store_return_value): Likewise. * m2-lang.c (m2_printstr): Expand parameter length to ULONGEST. * m2-lang.h (m2_val_print): Expand parameter embedded_offset to ULONGEST. * m2-typeprint.c (m2_array): Use pulongest to print TYPE_LENGTH. (m2_enum): expand lastval to LONGEST. * m2-valprint.c (m2_print_long_set): Expand parameter embedded_offset to LONGEST. (m2_print_unbounded_array): Likewise. (m2_print_array_contents): Likewise. Eliminate eltlen and use TYPE_LENGTH directly. (m2_val_print): Expand parameter embedded_offset to LONGEST. Expand i, len, temp_len to ULONGEST. Remove eltlen, use TYPE_LENGTH directly. * m32r-tdep.c (m32r_push_dummy_call): Expand len to ULONGEST. (m32r_extract_return_value): Likewise. * m68hc11-tdep.c (m68hc11_push_dummy_call): Expand len to ULONGEST. (m68hc11_store_return_value): Likewise. * m68k-tdep.c (m68k_extract_return_value): Expand len to ULONGEST. Use pulongest to format print len. (m68k_svr4_extract_return_value): Replace single-use variable len with TYPE_LENGTH. (m68k_store_return_value): Expand len to ULONGEST. Use pulongest to format print len. (m68k_svr4_store_return_value): Replace single-use variable len with TYPE_LENGTH. (m68k_push_dummy_call): Expand len, container_len, offset to ULONGEST. * m88k-tdep.c (m88k_store_arguments): Expand num_register_words, num_stack_words, len to ULONGEST. (m88k_return_value): Expand len to ULONGEST. * memrange.c (mem_ranges_overlap): Expand parameters len1, len2 to ULONGEST. * memrange.h (struct mem_range): Expand member length to ULONGEST. (mem_ranges_overlap): Expand parameters len1, len2 to ULONGEST. * mep-tdep.c (push_large_arguments): Expand arg_len to ULONGEST. (mep_push_dummy_call): Expand arg_size to ULONGEST. * microblaze-tdep.c (microblaze_store_return_value): Expand len to ULONGEST. * mips-tdep.c (mips_xfer_register): Expand parameter buf_offset to LONGEST. Use plongest to format print buf_offset. (mips_eabi_push_dummy_call): Expand len to ULONGEST. Use pulongest to format print len. (mips_n32n64_fp_arg_chunk_p): Expand parameter offset to LONGEST. Expand pos to LONGEST. (mips_n32n64_return_value): Expand offset to LONGEST. Use plongest to format print offset. (mips_o32_push_dummy_call): Expand len to ULONGEST. Eliminate single-use variable arglen. Use pulongest to format print len. (mips_o64_push_dummy_call): Expand len, stack_offset to ULONGEST. Eliminate single-use variable arglen. use pulongest to format print len. * mn10300-tdep.c (mn10300_type_align): Return ULONGEST. Expand align, falign to ULONGEST. (mn10300_push_dummy_call): Expand len, arg_len to ULONGEST. * moxie-tdep.c (moxie_store_return_value): Expand len to ULONGEST. (moxie_extract_return_value): Likewise. * mt-tdep.c (mt_push_dummy_call): Expand stack_dest, typelen to ULONGEST. * objc-lang.c (objc_printstr): Expand parameter length to ULONGEST. * opencl-lang.c (lookup_opencl_vector_type): Expand parameter el_length to ULONGEST. Expand length to ULONGEST. (lval_func_read): Expand offset, n, i, j to LONGEST. Expand elsize to ULONGEST. (lval_func_write): Likewise. (lval_func_check_validity): Expand parameter length to ULONGEST. Expand elsize to ULONGEST. Expand start, end, i to LONGEST. (lval_func_check_any_valid): Expand elsize to ULONGEST. (lval_func_check_synthetic_pointer): Expand parameter offset to LONGEST. Expand parameter length to ULONGEST. Expand elsize to ULONGEST. Expand start, end, i to LONGEST. * p-lang.c (is_pascal_string_type): Expand parameter length_pos, string_pos to LONGEST *. Expand parameter length_size to ULONGEST *. (pascal_printstr): Expand parameter length to ULONGEST. * p-lang.h (pascal_val_print): Expand parameter embedded_offset to LONGEST. (is_pascal_string_type): Expand parameter length_pos, string_pos to LONGEST *. Expand parameter length_size to ULONGEST *. (pascal_printstr): Expand parameter length to ULONGEST. (pascal_object_print_value_fields): Expand parameter offset to LONGEST. * p-typeprint.c (pascal_type_print_base): Expand lastval to LONGEST. * p-valprint.c (pascal_val_print): Expand parameter embedded_offset to LONGEST. Expand eltlen, length_size to ULONGEST. Expand length_pos, string_pos to LONGEST. (pascal_object_print_value_fields): Expand parameter offset to LONGEST. (pascal_object_print_value): Likewise. Expand boffset, thisoffset to LONGEST. * ppc-linux-nat.c (check_condition): Expand parameter len to ULONGEST *. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Expand argoffset, structoffset, len, i, nelt to ULONGEST. (do_ppc_sysv_return_value): Expand i, nelt, offset to ULONGEST. (ppc64_sysv_abi_push_dummy_call): Expand len to ULONGEST. (ppc64_sysv_abi_return_value): Expand n_regs, i, offset to ULONGEST. * printcmd.c (print_formatted): Expand len to ULONGEST. (float_type_from_length): Likewise. (print_scalar_formatted): Likewise. * python/py-prettyprint.c (apply_val_pretty_printer): Expand parameter embedded_offset to LONGEST. * python/python.h (apply_val_pretty_printer): Likewise. * regcache.c (regcache_xfer_part): Expand parameter offset to LONGEST. (regcache_cooked_read_part): Likewise. (regcache_cooked_write_part): Likewise. * regcache.h (regcache_cooked_read_part): Likewise. (regcache_cooked_write_part): Likewise. * remote.c (remote_write_bytes_aux): Expand parameter len to LONGEST. (remote_write_bytes): Likewise. (remote_region_ok_for_hw_watchpoint): Likewise. * rl78-tdep.c (rl78_push_dummy_call): Expand len, container_len to ULONGEST. * rs6000-aix-tdep.c (rs6000_push_dummy_call): Expand len to ULONGEST. (ran_out_of_registers_for_arguments): Expand space, jj to ULONGEST. * s390-tdep.c (s390_value_from_register): Eliminate single use variable len. (s390_function_arg_pass_by_reference): Likewise. (s390_function_arg_float): Eliminate single-use variable length. (s390_push_dummy_call): Likewise. Expand length to ULONGEST. (s390_frame_align): Eliminate single-us variable length. (s390_return_value): Expand length to ULONGEST. * score-tdep.c (score_push_dummy_call): Expand arglen to ULONGEST. * sh-tdep.c (sh_extract_return_value_nofpu): Epand len to ULONGEST. (sh_store_return_value_nofpu): Likewise. * sh64-tdep.c (sh64_push_dummy_call): Expand stack_offset, stack_alloc, len to ULONGEST. (sh64_extract_return_value): Expand len to ULONGEST. (sh64_store_return_value): Likewise. * sparc-tdep.c (sparc32_store_arguments): Likewise. * sparc64-tdep.c (sparc64_store_floating_fields): Expand parameter bitpos to LONGEST. Expand subpos to LONGEST. (sparc64_extract_floating_fields): Likewise. (sparc64_store_arguments): Expand len to ULONGEST. * spu-tdep.c (spu_value_from_register): Likewise. * stack.c (read_frame_arg): Expand len, len_deref to ULONGEST. (print_frame_args): Expand current_offset, arg_size to ULONGEST. * symfile-mem.c (symfile_target_read_memory): New function. Wrap around target_read_memory. (symbol_file_add_from_memory): Use symfile_target_read_memory. * symmisc.c (print_symbol): Expand i to ULONGEST. Use pulongest to format print TYPE_LENGTH. * target.c (target_read_memory): Expand parameter len to LONGEST. (target_read_stack): Likewise. (target_write_memory): Likewise. (target_write_raw_memory): Likewise. (default_region_ok_for_hw_watchpoint): Likewise. (debug_to_region_ok_for_hw_watchpoint): Likewise. * target.h (struct target_ops): Expand parameter len to LONGEST for to_region_ok_for_hw_watchpoint. (target_read_memory): Expand parameter len to LONGEST. (target_read_stack): Likewise. (target_write_memory): Likewise. (target_write_raw_memory): Likewise. * tracepoint.c (collect_symbol): Expand len to ULONGEST. (encode_actions_1): Make addr as CORE_ADDR. Expand len to ULONGEST. (scope_info): Expand j to ULONGEST. Use pulongest to format print TYPE_LENGTH. * typeprint.c (whatis_exp): Expand top to LONGEST. * v850-tdep.c (v850_push_dummy_call): Expand len to ULONGEST. (v850_extract_return_value): Expand len to LONGEST. (v850_store_return_value): Expand len to ULONGEST. * valarith.c (value_subscripted_rvalue): Expand elt_size, elt_offs to ULONGEST. (value_binop): Expand len to LONGEST. (value_logical_not): Expand len1, len2 to LONGEST. * valops.c (value_allocate_space_in_inferior): Expand parameter len to ULONGEST. Use value_from_ulongest to get the value for len. (value_cast_structs): Expand top to LONGEST. (value_cast): Expand val_length, element_length to ULONGEST. (dynamic_cast_check_1): Expand parameter embedded_offset to LONGEST. Expand offset to LONGEST. (dynamic_cast_check_2): Likewise. (value_dynamic_cast): Expand top to LONGEST. (value_fetch_lazy): Expand length to ULONGEST. (read_value_memory): Expand parameter length to ULONGEST. (value_assign): Expand changed_len to ULONGEST. Expand offset to LONGEST. (value_array): Expand typelength to ULONGEST. (search_struct_field): Expand parameter offset to LONGEST. Expand new_offset, boffset to LONGEST. (search_struct_method): Expand parameter offset to LONGEST. Expand base_offset, this_offset to LONGEST. (find_method_list): Expand parameter offset to LONGEST, parameter boffset to LONGEST *. Expand base_offset to LONGEST. (value_find_oload_method_list): Expand parameter boffset to LONGEST *. (find_overload_match): Expand boffset to LONGEST. (value_struct_elt_for_reference): Expand parameter offset to LONGEST. Expand base_offset to LONGEST. (value_rtti_indirect_type): Expand parameter top to LONGEST *. (value_full_object): Expand parameter xtop to LONGEST. Expand top to LONGEST. * valprint.c (valprint_check_validity): Expand parameter embedded_offset to LONGEST. (generic_val_print): Likewise. (val_print): Likewise. (val_print_scalar_formatted): Likewise. (print_hex_chars): Expand parameter len to ULONGEST. (val_print_array_elements): Expand parameter embedded_offset to LONGEST. Expand len, eltlen to ULONGEST. (generic_printstr): Expand parameter length to ULONGEST. * valprint.h (val_print_array_elements): Expand parameter embedded_offset to LONGEST. (val_print_scalar_formatted): Likewise. (print_hex_chars): Expand parameter len to ULONGEST. (generic_val_print): Expand parameter embedded_offset to LONGEST. (generic_printstr): Expand parameter length to ULONGEST. * value.c (struct range): Expand member offset to LONGEST. Expand member length to ULONGEST. (ranges_overlap): Expand parameters offset1, offset2 to LONGEST. Expand parameters len1, len2 to ULONGEST. (range_contain): Expand parameter offset to LONGEST. Expand parameter length to ULONGEST. (struct value): Expand members offset, embedded_offset, pointed_to_offset to LONGEST. (value_bytes_available): Expand parameter offset to LONGEST, parameter length to ULONGEST. (mark_value_bytes_unavailable): Likewise. (find_first_range_overlap): Likewise. (value_available_contents_eq): Expand parameters offset1, offset2 to LONGEST. Expand parameter length to ULONGEST. (value_offset): Return LONGEST. (set_value_offset): Expand parameter offset to LONGEST. (value_contents_copy_raw): Expand parameters src_offset, dst_offset to LONGEST. Expand parameters length to ULONGEST. (value_contents_copy): Likewise. (value_contents_equal): Expand len to ULONGEST. (value_bits_valid): Expand parameter offset to LONGEST, length to ULONGEST. (value_bits_synthetic_pointer): Likewise. (value_embedded_offset): Return LONGEST. (set_value_embedded_offset): Expand parameter val to LONGEST. (value_pointed_to_offset): Return LONGEST. (set_value_pointed_to_offset): Expand parameter val to LONGEST. (set_internalvar_component): Expand parameter offset to LONGEST. (value_primitive_field): Likewise. Expand bitpos, boffset to LONGEST, container_bitpos to ULONGEST. (value_fn_field): Expand parameter offset to LONGEST. (unpack_value_bits_as_long_1): Expand parameters embedded_offset, bitpos to LONGEST. Expand read_offset to LONGEST. (unpack_value_bits_as_long): Expand parameter embeded_offset to LONGEST. (unpack_value_field_as_long_1): Likewise. Expand bitpos to LONGEST. (unpack_value_field_as_long): Expand parameter embedded_offset to LONGEST. (value_field_bitfield): Likewise. (modify_field): Expand parameter bitpos to LONGEST. Expand bytesize to ULONGEST. * value.h (value_offset): Return LONGEST. (set_value_offset): Expand parameter offset to LONGEST. (value_pointed_to_offset): Return LONGEST. (set_value_pointed_to_offset): Expand parameter val to LONGEST. (value_embedded_offset): Return LONGEST. (set_value_embedded_offset): Expand parameter val to LONGEST. (struct lval_funcs): Expand parameter offset to LONGEST, length to ULONGEST for check_validity. Likewise for check_synthetic_pointer. (valprint_check_validity): Expand parameter embedded_offset to LONGEST. (value_bits_valid): Expand parameter offset to LONGEST, length to ULONGEST. (value_bits_synthetic_pointer): Likewise. (mark_value_bytes_unavailable): Expand parameter offset to LONGEST, parameter length to ULONGEST. (value_available_contents_eq): Expand parameters offset1, offset2 to LONGEST. Expand parameter length to ULONGEST. (read_value_memory): Expand parameter length to ULONGEST. (unpack_value_bits_as_long): Expand parameter embeded_offset to LONGEST. (unpack_value_field_as_long): Likewise. (value_field_bitfield): Likewise. (value_contents_copy_raw): Expand parameters src_offset, dst_offset to LONGEST. Expand parameters length to ULONGEST. (value_contents_copy): Likewise. (value_find_oload_method_list): Expand parameter boffset to LONGEST *. (value_primitive_field): Expand parameter offset to LONGEST. (value_rtti_indirect_type): Expand parameter top to LONGEST *. (value_full_object): Expand parameter xtop to LONGEST. (set_internalvar_component): Expand parameter offset to LONGEST. (value_fn_field): Expand parameter offset to LONGEST. (modify_field): Expand parameter bitpos to LONGEST. (val_print): Expand parameter embedded_offset to LONGEST. (value_allocate_space_in_inferior): Expand parameter len to ULONGEST. * vax-tdep.c (vax_store_arguments): Expand count, len to ULONGEST. (vax_return_value): Expand len to ULONGEST. * xstormy16-tdep.c (xstormy16_extract_return_value): Expand len, i to ULONGEST. (xstormy16_store_return_value): Likewise. (xstormy16_push_dummy_call): Expand j to LONGEST, typelen to ULONGEST. (xstormy16_push_dummy_call): * xtensa-tdep.c (xtensa_extract_return_value): Expand len to ULONGEST. Use pulongest to format print len. (xtensa_store_return_value): Likewise. (xtensa_push_dummy_call): Expand size, onstack_size, length to ULONGEST. Expand offset to LONGEST. Use pulongest to format print TYPE_LENGTH. testsuite/ChangeLog: 2012-05-04 Siddhesh Poyarekar <siddhesh@redhat.com> * gdb.base/structs-longest-bitpos.c: New test case. * gdb.base/structs-longest-bitpos.exp: New test case. [-- Attachment #2: bitpos-expand.patch --] [-- Type: text/x-patch, Size: 207721 bytes --] diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 180fadb..4417cf1 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -80,7 +80,7 @@ static struct type *desc_bounds_type (struct type *); static struct value *desc_bounds (struct value *); -static int fat_pntr_bounds_bitpos (struct type *); +static LONGEST fat_pntr_bounds_bitpos (struct type *); static int fat_pntr_bounds_bitsize (struct type *); @@ -88,13 +88,13 @@ static struct type *desc_data_target_type (struct type *); static struct value *desc_data (struct value *); -static int fat_pntr_data_bitpos (struct type *); +static LONGEST fat_pntr_data_bitpos (struct type *); static int fat_pntr_data_bitsize (struct type *); static struct value *desc_one_bound (struct value *, int, int); -static int desc_bound_bitpos (struct type *, int, int); +static LONGEST desc_bound_bitpos (struct type *, int, int); static int desc_bound_bitsize (struct type *, int, int); @@ -174,7 +174,7 @@ static struct type *static_unwrap_type (struct type *type); static struct value *unwrap_value (struct value *); -static struct type *constrained_packed_array_type (struct type *, long *); +static struct type *constrained_packed_array_type (struct type *, ULONGEST *); static struct type *decode_constrained_packed_array_type (struct type *); @@ -189,7 +189,8 @@ static int ada_is_unconstrained_packed_array_type (struct type *); static struct value *value_subscript_packed (struct value *, int, struct value **); -static void move_bits (gdb_byte *, int, const gdb_byte *, int, int, int); +static void move_bits (gdb_byte *, int, const gdb_byte *, ULONGEST, ULONGEST, + int); static struct value *coerce_unspec_val_to_type (struct value *, struct type *); @@ -217,14 +218,14 @@ static struct value *value_val_atr (struct type *, struct value *); static struct symbol *standard_lookup (const char *, const struct block *, domain_enum); -static struct value *ada_search_struct_field (char *, struct value *, int, +static struct value *ada_search_struct_field (char *, struct value *, LONGEST, struct type *); -static struct value *ada_value_primitive_field (struct value *, int, int, +static struct value *ada_value_primitive_field (struct value *, LONGEST, int, struct type *); -static int find_struct_field (const char *, struct type *, int, - struct type **, int *, int *, int *, int *); +static int find_struct_field (const char *, struct type *, LONGEST, + struct type **, LONGEST *, int *, int *, int *); static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR, struct value *); @@ -240,7 +241,7 @@ static void ada_language_arch_info (struct gdbarch *, static void check_size (const struct type *); -static struct value *ada_index_struct_field (int, struct value *, int, +static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST, struct type *); static struct value *assign_aggregate (struct value *, struct value *, @@ -586,7 +587,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) } static const gdb_byte * -cond_offset_host (const gdb_byte *valaddr, long offset) +cond_offset_host (const gdb_byte *valaddr, LONGEST offset) { if (valaddr == NULL) return NULL; @@ -595,7 +596,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) } static CORE_ADDR -cond_offset_target (CORE_ADDR address, long offset) +cond_offset_target (CORE_ADDR address, LONGEST offset) { if (address == 0) return 0; @@ -1601,7 +1602,7 @@ desc_bounds (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the bounds data. */ -static int +static LONGEST fat_pntr_bounds_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 1); @@ -1667,7 +1668,7 @@ desc_data (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the data. */ -static int +static LONGEST fat_pntr_data_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 0); @@ -1702,7 +1703,7 @@ desc_one_bound (struct value *bounds, int i, int which) of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper bound, if WHICH is 1. The first bound is I=1. */ -static int +static LONGEST desc_bound_bitpos (struct type *type, int i, int which) { return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); @@ -1892,7 +1893,7 @@ ada_type_of_array (struct value *arr, int bounds) zero, and does not need to be recomputed. */ if (lo < hi) { - int array_bitsize = + ULONGEST array_bitsize = (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; @@ -2044,7 +2045,7 @@ decode_packed_array_bitsize (struct type *type) in bits. */ static struct type * -constrained_packed_array_type (struct type *type, long *elt_bits) +constrained_packed_array_type (struct type *type, ULONGEST *elt_bits) { struct type *new_elt_type; struct type *new_type; @@ -2096,7 +2097,7 @@ decode_constrained_packed_array_type (struct type *type) char *name; const char *tail; struct type *shadow_type; - long bits; + ULONGEST bits; if (!raw_name) raw_name = ada_type_name (desc_base_type (type)); @@ -2167,7 +2168,8 @@ decode_constrained_packed_array (struct value *arr) array with no wrapper. In order to interpret the value through the (left-justified) packed array type we just built, we must first left-justify it. */ - int bit_size, bit_pos; + int bit_size; + LONGEST bit_pos; ULONGEST mod; mod = ada_modulus (value_type (arr)) - 1; @@ -2268,15 +2270,16 @@ has_negatives (struct type *type) struct value * ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, - long offset, int bit_offset, int bit_size, + LONGEST offset, int bit_offset, int bit_size, struct type *type) { struct value *v; - int src, /* Index into the source area */ - targ, /* Index into the target area */ - srcBitsLeft, /* Number of source bits left to move */ - nsrc, ntarg, /* Number of source and target bytes */ - unusedLS, /* Number of bits in next significant + int src; /* Index into the source area */ + LONGEST targ; /* Index into the target area */ + int srcBitsLeft, /* Number of source bits left to move */ + nsrc; /* Number of source bytes */ + ULONGEST ntarg; /* Number of target bytes */ + int unusedLS, /* Number of bits in next significant byte of source that are unused */ accumSize; /* Number of meaningful bits in accum */ unsigned char *bytes; /* First byte containing data to unpack */ @@ -2426,7 +2429,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, not overlap. */ static void move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source, - int src_offset, int n, int bits_big_endian_p) + ULONGEST src_offset, ULONGEST n, int bits_big_endian_p) { unsigned int accum, mask; int accum_bits, chunk_size; @@ -2516,7 +2519,7 @@ ada_value_assign (struct value *toval, struct value *fromval) { int len = (value_bitpos (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; - int from_size; + ULONGEST from_size; char *buffer = (char *) alloca (len); struct value *val; CORE_ADDR to_addr = value_address (toval); @@ -2562,7 +2565,7 @@ value_assign_to_component (struct value *container, struct value *component, (LONGEST) (value_address (component) - value_address (container)); int bit_offset_in_container = value_bitpos (component) - value_bitpos (container); - int bits; + ULONGEST bits; val = value_cast (value_type (component), val); @@ -4082,7 +4085,7 @@ ensure_lval (struct value *val) if (VALUE_LVAL (val) == not_lval || VALUE_LVAL (val) == lval_internalvar) { - int len = TYPE_LENGTH (ada_check_typedef (value_type (val))); + ULONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val))); const CORE_ADDR addr = value_as_long (value_allocate_space_in_inferior (len)); @@ -4156,7 +4159,7 @@ static CORE_ADDR value_pointer (struct value *value, struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); - unsigned len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); gdb_byte *buf = alloca (len); CORE_ADDR addr; @@ -6044,7 +6047,7 @@ value_tag_from_contents_and_address (struct type *type, const gdb_byte *valaddr, CORE_ADDR address) { - int tag_byte_offset; + LONGEST tag_byte_offset; struct type *tag_type; if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, @@ -6427,7 +6430,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) only in that it can handle packed values of arbitrary type. */ static struct value * -ada_value_primitive_field (struct value *arg1, int offset, int fieldno, +ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type) { struct type *type; @@ -6439,12 +6442,13 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) { - int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); + LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); return ada_value_primitive_packed_val (arg1, value_contents (arg1), - offset + bit_pos / 8, - bit_pos % 8, bit_size, type); + offset + bit_pos / 8, + bit_pos % 8, bit_size, + type); } else return value_primitive_field (arg1, offset, fieldno, arg_type); @@ -6466,9 +6470,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, Returns 1 if found, 0 otherwise. */ static int -find_struct_field (const char *name, struct type *type, int offset, +find_struct_field (const char *name, struct type *type, LONGEST offset, struct type **field_type_p, - int *byte_offset_p, int *bit_offset_p, int *bit_size_p, + LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p, int *index_p) { int i; @@ -6486,8 +6490,8 @@ find_struct_field (const char *name, struct type *type, int offset, for (i = 0; i < TYPE_NFIELDS (type); i += 1) { - int bit_pos = TYPE_FIELD_BITPOS (type, i); - int fld_offset = offset + bit_pos / 8; + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); + LONGEST fld_offset = offset + bit_pos / 8; const char *t_field_name = TYPE_FIELD_NAME (type, i); if (t_field_name == NULL) @@ -6557,7 +6561,7 @@ num_visible_fields (struct type *type) Searches recursively through wrapper fields (e.g., '_parent'). */ static struct value * -ada_search_struct_field (char *name, struct value *arg, int offset, +ada_search_struct_field (char *name, struct value *arg, LONGEST offset, struct type *type) { int i; @@ -6590,7 +6594,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset, int j; struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i)); - int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; + LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) { @@ -6608,8 +6612,8 @@ ada_search_struct_field (char *name, struct value *arg, int offset, return NULL; } -static struct value *ada_index_struct_field_1 (int *, struct value *, - int, struct type *); +static struct value *ada_index_struct_field_1 (LONGEST *, struct value *, + LONGEST, struct type *); /* Return field #INDEX in ARG, where the index is that returned by @@ -6618,7 +6622,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, * If found, return value, else return NULL. */ static struct value * -ada_index_struct_field (int index, struct value *arg, int offset, +ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset, struct type *type) { return ada_index_struct_field_1 (&index, arg, offset, type); @@ -6630,7 +6634,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, * *INDEX_P. */ static struct value * -ada_index_struct_field_1 (int *index_p, struct value *arg, int offset, +ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset, struct type *type) { int i; @@ -6720,7 +6724,8 @@ ada_value_struct_elt (struct value *arg, char *name, int no_err) v = ada_search_struct_field (name, arg, 0, t); else { - int bit_offset, bit_size, byte_offset; + int bit_offset, bit_size; + LONGEST byte_offset; struct type *field_type; CORE_ADDR address; @@ -7026,8 +7031,8 @@ ada_coerce_ref (struct value *val0) /* Return OFF rounded upward if necessary to a multiple of ALIGNMENT (a power of 2). */ -static unsigned int -align_value (unsigned int off, unsigned int alignment) +static ULONGEST +align_value (LONGEST off, ULONGEST alignment) { return (off + alignment - 1) & ~(alignment - 1); } @@ -7406,10 +7411,10 @@ ada_template_to_fixed_record_type_1 (struct type *type, struct value *mark = value_mark (); struct value *dval; struct type *rtype; - int nfields, bit_len; + int nfields; int variant_field; - long off; - int fld_bit_len; + ULONGEST off, bit_len; + ULONGEST fld_bit_len; int f; /* Compute the number of fields in this record type that are going @@ -7480,7 +7485,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, that follow this one. */ if (ada_is_aligner_type (field_type)) { - long field_offset = TYPE_FIELD_BITPOS (field_type, f); + LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f); field_valaddr = cond_offset_host (field_valaddr, field_offset); field_address = cond_offset_target (field_address, field_offset); @@ -7599,11 +7604,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, if (TYPE_LENGTH (type) <= 0) { if (TYPE_NAME (rtype)) - warning (_("Invalid type size for `%s' detected: %d."), - TYPE_NAME (rtype), TYPE_LENGTH (type)); + warning (_("Invalid type size for `%s' detected: %s."), + TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type))); else - warning (_("Invalid type size for <unnamed> detected: %d."), - TYPE_LENGTH (type)); + warning (_("Invalid type size for <unnamed> detected: %s."), + pulongest (TYPE_LENGTH (type))); } else { @@ -7940,7 +7945,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, type was a regular (non-packed) array type. As a result, the bitsize of the array elements needs to be set again, and the array length needs to be recomputed based on that bitsize. */ - int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result)); + ULONGEST len = TYPE_LENGTH (result) / + TYPE_LENGTH (TYPE_TARGET_TYPE (result)); int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0); TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0); diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index 9a93c50..3de0723 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -168,7 +168,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int, extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream); -extern void ada_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern void ada_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -183,7 +183,7 @@ extern void ada_emit_char (int, struct type *, struct ui_file *, int, int); extern void ada_printchar (int, struct type *, struct ui_file *); extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *, - unsigned int, const char *, int, + ULONGEST, const char *, int, const struct value_print_options *); struct value *ada_convert_actual (struct value *actual, @@ -257,7 +257,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); extern struct value *ada_value_primitive_packed_val (struct value *, const gdb_byte *, - long, int, int, + LONGEST, int, int, struct type *); extern struct type *ada_coerce_to_simple_array_type (struct type *); diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index 40f3058..2a1852c 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -815,8 +815,8 @@ ada_print_type (struct type *type0, const char *varstring, const char *name = ada_type_name (type); if (!ada_is_range_type_name (name)) - fprintf_filtered (stream, _("<%d-byte integer>"), - TYPE_LENGTH (type)); + fprintf_filtered (stream, _("<%s-byte integer>"), + pulongest (TYPE_LENGTH (type))); else { fprintf_filtered (stream, "range "); @@ -837,7 +837,8 @@ ada_print_type (struct type *type0, const char *varstring, } break; case TYPE_CODE_FLT: - fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type)); + fprintf_filtered (stream, _("<%s-byte float>"), + pulongest (TYPE_LENGTH (type))); break; case TYPE_CODE_ENUM: if (show < 0) diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 95ec7ec..245fd41 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -42,19 +42,18 @@ static void print_record (struct type *, const gdb_byte *, int, const struct value_print_options *); static int print_field_values (struct type *, const gdb_byte *, - int, + LONGEST, struct ui_file *, int, const struct value *, const struct value_print_options *, - int, struct type *, int); + int, struct type *, LONGEST); static void adjust_type_signedness (struct type *); -static void ada_val_print_1 (struct type *, const gdb_byte *, int, CORE_ADDR, +static void ada_val_print_1 (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); -\f /* Make TYPE unsigned if its range of values includes no negatives. */ static void @@ -144,7 +143,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, unsigned int things_printed = 0; unsigned len; struct type *elttype, *index_type; - unsigned eltlen; + ULONGEST eltlen; unsigned long bitsize = TYPE_FIELD_BITSIZE (type, 0); struct value *mark = value_mark (); LONGEST low = 0; @@ -293,7 +292,7 @@ ada_emit_char (int c, struct type *type, struct ui_file *stream, of a character. */ static int -char_at (const gdb_byte *string, int i, int type_len, +char_at (const gdb_byte *string, ULONGEST i, int type_len, enum bfd_endian byte_order) { if (type_len == 1) @@ -465,7 +464,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) static void printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, - unsigned int length, int force_ellipses, int type_len, + ULONGEST length, int force_ellipses, int type_len, const struct value_print_options *options) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype)); @@ -556,7 +555,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, void ada_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { @@ -570,7 +569,7 @@ ada_printstr (struct ui_file *stream, struct type *type, void ada_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) @@ -602,8 +601,8 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); struct type *elttype = TYPE_TARGET_TYPE (type); - unsigned int eltlen; - unsigned int len; + ULONGEST eltlen; + ULONGEST len; /* We know that ELTTYPE cannot possibly be null, because we found that TYPE is a string-like type. Similarly, the size of ELTTYPE @@ -621,7 +620,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, elements up to it. */ if (options->stop_print_at_null) { - int temp_len; + ULONGEST temp_len; /* Look for a NULL char. */ for (temp_len = 0; @@ -654,7 +653,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, static void ada_val_print_1 (struct type *type, const gdb_byte *valaddr, - int offset, CORE_ADDR address, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -730,7 +729,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, if (ada_is_fixed_point_type (type)) { LONGEST v = unpack_long (type, valaddr + offset_aligned); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); fprintf_filtered (stream, len < 4 ? "%.11g" : "%.17g", (double) ada_fixed_to_float (type, v)); @@ -924,12 +923,12 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, static int print_variant_part (struct type *type, int field_num, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int comma_needed, - struct type *outer_type, int outer_offset) + struct type *outer_type, LONGEST outer_offset) { struct type *var_type = TYPE_FIELD_TYPE (type, field_num); int which = ada_which_variant_applies (var_type, outer_type, @@ -1036,11 +1035,11 @@ print_record (struct type *type, const gdb_byte *valaddr, static int print_field_values (struct type *type, const gdb_byte *valaddr, - int offset, struct ui_file *stream, int recurse, + LONGEST offset, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int comma_needed, - struct type *outer_type, int outer_offset) + struct type *outer_type, LONGEST outer_offset) { int i, len; @@ -1121,7 +1120,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, } else { - int bit_pos = TYPE_FIELD_BITPOS (type, i); + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); int bit_size = TYPE_FIELD_BITSIZE (type, i); struct value_print_options opts; diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 856aa0d..8b6a970 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -303,7 +303,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct alpha_arg { const gdb_byte *contents; - int len; + ULONGEST len; int offset; }; struct alpha_arg *alpha_args @@ -424,7 +424,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { const gdb_byte *contents = m_arg->contents; int offset = m_arg->offset; - int len = m_arg->len; + ULONGEST len = m_arg->len; /* Copy the bytes destined for registers into arg_reg_buffer. */ if (offset < sizeof(arg_reg_buffer)) @@ -475,7 +475,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int length = TYPE_LENGTH (valtype); + ULONGEST length = TYPE_LENGTH (valtype); gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; ULONGEST l; @@ -544,7 +544,7 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache, const gdb_byte *valbuf) { struct gdbarch *gdbarch = get_regcache_arch (regcache); - int length = TYPE_LENGTH (valtype); + ULONGEST length = TYPE_LENGTH (valtype); gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; ULONGEST l; diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 685fa48..0ec7f99 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -443,7 +443,7 @@ amd64_non_pod_p (struct type *type) static void amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) { - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); /* 1. If the size of an object is larger than two eightbytes, or in C++, is a non-POD structure or union type, or contains @@ -482,10 +482,10 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int pos = TYPE_FIELD_BITPOS (type, i) / 64; + LONGEST pos = TYPE_FIELD_BITPOS (type, i) / 64; enum amd64_reg_class subclass[2]; - int bitsize = TYPE_FIELD_BITSIZE (type, i); - int endpos; + ULONGEST bitsize = TYPE_FIELD_BITSIZE (type, i); + LONGEST endpos; if (bitsize == 0) bitsize = TYPE_LENGTH (subtype) * 8; @@ -549,7 +549,7 @@ void amd64_classify (struct type *type, enum amd64_reg_class class[2]) { enum type_code code = TYPE_CODE (type); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); class[0] = class[1] = AMD64_NO_CLASS; @@ -598,7 +598,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct type *func_type, { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum amd64_reg_class class[2]; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM }; static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM }; int integer_reg = 0; @@ -727,8 +727,8 @@ amd64_push_arguments (struct regcache *regcache, int nargs, that register number (or a negative value otherwise). */ int *arg_addr_regno = alloca (nargs * sizeof (int)); int num_stack_args = 0; - int num_elements = 0; - int element = 0; + ULONGEST num_elements = 0; + ULONGEST element = 0; int integer_reg = 0; int sse_reg = 0; int i; @@ -742,7 +742,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); enum amd64_reg_class class[2]; int needed_integer_regs = 0; int needed_sse_regs = 0; @@ -836,7 +836,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, { struct type *type = value_type (stack_args[i]); const gdb_byte *valbuf = value_contents (stack_args[i]); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); CORE_ADDR arg_addr = sp + element * 8; write_memory (arg_addr, valbuf, len); @@ -2551,7 +2551,7 @@ amd64_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc) CORE_ADDR jb_addr; struct gdbarch *gdbarch = get_frame_arch (frame); int jb_pc_offset = gdbarch_tdep (gdbarch)->jb_pc_offset; - int len = TYPE_LENGTH (builtin_type (gdbarch)->builtin_func_ptr); + ULONGEST len = TYPE_LENGTH (builtin_type (gdbarch)->builtin_func_ptr); /* If JB_PC_OFFSET is -1, we have no way to find out where the longjmp will land. */ diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c index 2b94eca..2ec936c 100644 --- a/gdb/amd64-windows-tdep.c +++ b/gdb/amd64-windows-tdep.c @@ -77,7 +77,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct type *func_type, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); int regnum = -1; /* See if our value is returned through a register. If it is, then diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index f83dc0e..51eed0c 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3577,7 +3577,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { - int len; + ULONGEST len; struct type *arg_type; struct type *target_type; enum type_code typecode; @@ -8773,7 +8773,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs, /* If the type is a plain integer, then the access is straight-forward. Otherwise we have to play around a bit more. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; ULONGEST tmp; @@ -8795,7 +8795,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs, /* For a structure or union the behaviour is as if the value had been stored to word-aligned memory and then loaded into registers with 32-bit load instruction(s). */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; bfd_byte tmpbuf[INT_REGISTER_SIZE]; @@ -8976,7 +8976,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, /* Integral values greater than one word are stored in consecutive registers starting with r0. This will always be a multiple of the regiser size. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; while (len > 0) @@ -8992,7 +8992,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, /* For a structure or union the behaviour is as if the value had been stored to word-aligned memory and then loaded into registers with 32-bit load instruction(s). */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; bfd_byte tmpbuf[INT_REGISTER_SIZE]; diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 34b0baf..c7ba3d8 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -906,7 +906,7 @@ avr_return_value (struct gdbarch *gdbarch, struct type *func_type, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int i; + ULONGEST i; /* Single byte are returned in r24. Otherwise, the MSB of the return value is always in r25, calculate which register holds the LSB. */ @@ -1177,7 +1177,8 @@ struct stack_item }; static struct stack_item * -push_stack_item (struct stack_item *prev, const bfd_byte *contents, int len) +push_stack_item (struct stack_item *prev, const bfd_byte *contents, + ULONGEST len) { struct stack_item *si; si = xmalloc (sizeof (struct stack_item)); @@ -1266,12 +1267,12 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < nargs; i++) { - int last_regnum; + ULONGEST last_regnum; int j; struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); const bfd_byte *contents = value_contents (arg); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); /* Calculate the potential last register needed. */ last_regnum = regnum - (len + (len & 1)); diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 909f282..b1b8071 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -80,12 +80,12 @@ static void gen_traced_pop (struct gdbarch *, struct agent_expr *, static void gen_sign_extend (struct agent_expr *, struct type *); static void gen_extend (struct agent_expr *, struct type *); static void gen_fetch (struct agent_expr *, struct type *); -static void gen_left_shift (struct agent_expr *, int); +static void gen_left_shift (struct agent_expr *, LONGEST); static void gen_frame_args_address (struct gdbarch *, struct agent_expr *); static void gen_frame_locals_address (struct gdbarch *, struct agent_expr *); -static void gen_offset (struct agent_expr *ax, int offset); +static void gen_offset (struct agent_expr *ax, LONGEST offset); static void gen_sym_offset (struct agent_expr *, struct symbol *); static void gen_var_ref (struct gdbarch *, struct agent_expr *ax, struct axs_value *value, struct symbol *var); @@ -133,15 +133,16 @@ static void gen_deref (struct agent_expr *, struct axs_value *); static void gen_address_of (struct agent_expr *, struct axs_value *); static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - struct type *type, int start, int end); + struct type *type, LONGEST start, LONGEST end); static void gen_primitive_field (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - int offset, int fieldno, struct type *type); + LONGEST offset, int fieldno, + struct type *type); static int gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - char *field, int offset, + char *field, LONGEST offset, struct type *type); static void gen_struct_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -363,7 +364,7 @@ gen_trace_static_fields (struct gdbarch *gdbarch, { case axs_lvalue_memory: { - int length = TYPE_LENGTH (check_typedef (value.type)); + ULONGEST length = TYPE_LENGTH (check_typedef (value.type)); ax_const_l (ax, length); ax_simple (ax, aop_trace); @@ -421,7 +422,7 @@ gen_traced_pop (struct gdbarch *gdbarch, case axs_lvalue_memory: { - int length = TYPE_LENGTH (check_typedef (value->type)); + ULONGEST length = TYPE_LENGTH (check_typedef (value->type)); if (string_trace) ax_simple (ax, aop_dup); @@ -565,7 +566,7 @@ gen_fetch (struct agent_expr *ax, struct type *type) right shift it by -DISTANCE bits if DISTANCE < 0. This generates unsigned (logical) right shifts. */ static void -gen_left_shift (struct agent_expr *ax, int distance) +gen_left_shift (struct agent_expr *ax, LONGEST distance) { if (distance > 0) { @@ -619,7 +620,7 @@ gen_frame_locals_address (struct gdbarch *gdbarch, struct agent_expr *ax) programming in ML, it would be clearer why these are the same thing. */ static void -gen_offset (struct agent_expr *ax, int offset) +gen_offset (struct agent_expr *ax, LONGEST offset) { /* It would suffice to simply push the offset and add it, but this makes it easier to read positive and negative offsets in the @@ -1275,7 +1276,7 @@ gen_address_of (struct agent_expr *ax, struct axs_value *value) static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *type, - int start, int end) + LONGEST start, LONGEST end) { /* Note that ops[i] fetches 8 << i bits. */ static enum agent_op ops[] @@ -1310,13 +1311,13 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, /* The first and one-after-last bits in the field, but rounded down and up to byte boundaries. */ - int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; - int bound_end = (((end + TARGET_CHAR_BIT - 1) - / TARGET_CHAR_BIT) - * TARGET_CHAR_BIT); + LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; + LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1) + / TARGET_CHAR_BIT) + * TARGET_CHAR_BIT); /* current bit offset within the structure */ - int offset; + LONGEST offset; /* The index in ops of the opcode we're considering. */ int op; @@ -1435,7 +1436,7 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, static void gen_primitive_field (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - int offset, int fieldno, struct type *type) + LONGEST offset, int fieldno, struct type *type) { /* Is this a bitfield? */ if (TYPE_FIELD_PACKED (type, fieldno)) @@ -1460,7 +1461,7 @@ gen_primitive_field (struct expression *exp, static int gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - char *field, int offset, struct type *type) + char *field, LONGEST offset, struct type *type) { int i, rslt; int nbases = TYPE_N_BASECLASSES (type); diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c index a48758d..e5eef86 100644 --- a/gdb/bfin-tdep.c +++ b/gdb/bfin-tdep.c @@ -506,14 +506,14 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, char buf[4]; int i; long reg_r0, reg_r1, reg_r2; - int total_len = 0; + ULONGEST total_len = 0; enum bfin_abi abi = bfin_abi (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); - int len = TYPE_LENGTH (value_type); + ULONGEST len = TYPE_LENGTH (value_type); total_len += (len + 3) & ~3; } @@ -531,8 +531,8 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, { struct type *value_type = value_enclosing_type (args[i]); struct type *arg_type = check_typedef (value_type); - int len = TYPE_LENGTH (value_type); - int container_len = (len + 3) & ~3; + ULONGEST len = TYPE_LENGTH (value_type); + ULONGEST container_len = (len + 3) & ~3; sp -= container_len; write_memory (sp, value_contents_writeable (args[i]), container_len); @@ -613,7 +613,7 @@ bfin_extract_return_value (struct type *type, struct gdbarch *gdbarch = get_regcache_arch (regs); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); ULONGEST tmp; int regno = BFIN_R0_REGNUM; @@ -642,7 +642,7 @@ bfin_store_return_value (struct type *type, registers starting with R0. This will always be a multiple of the register size. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = BFIN_R0_REGNUM; gdb_assert (len <= 8); diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index ab5f324..0e61513 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1747,7 +1747,8 @@ update_watchpoint (struct watchpoint *b, int reparse) && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR addr; - int len, type; + ULONGEST len; + int type; struct bp_location *loc, **tmp; addr = value_address (v); @@ -10495,7 +10496,7 @@ can_use_hardware_watchpoint (struct value *v) && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR vaddr = value_address (v); - int len; + ULONGEST len; int num_regs; len = (target_exact_watchpoints @@ -14091,7 +14092,7 @@ show_breakpoint_cmd (char *args, int from_tty) GDB itself. */ static void -invalidate_bp_value_on_memory_change (CORE_ADDR addr, int len, +invalidate_bp_value_on_memory_change (CORE_ADDR addr, LONGEST len, const bfd_byte *data) { struct breakpoint *bp; diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index d23561a..152aaad 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -400,7 +400,7 @@ struct bp_location /* For hardware watchpoints, the size of the memory region being watched. For hardware ranged breakpoints, the size of the breakpoint range. */ - int length; + ULONGEST length; /* Type of hardware watchpoint. */ enum target_hw_bp_type watchpoint_type; diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 28dce8d..2064011 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -189,7 +189,7 @@ c_printchar (int c, struct type *type, struct ui_file *stream) void c_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *user_encoding, int force_ellipses, const struct value_print_options *options) { @@ -202,7 +202,6 @@ c_printstr (struct ui_file *stream, struct type *type, unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; - int width = TYPE_LENGTH (type); struct obstack wchar_buf, output; struct cleanup *cleanup; struct wchar_iterator *iter; @@ -679,7 +678,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, } else { - int i; + ULONGEST i; /* Write the terminating character. */ for (i = 0; i < TYPE_LENGTH (type); ++i) @@ -688,7 +687,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, if (satisfy_expected) { LONGEST low_bound, high_bound; - int element_size = TYPE_LENGTH (type); + ULONGEST element_size = TYPE_LENGTH (type); if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type), &low_bound, &high_bound) < 0) diff --git a/gdb/c-lang.h b/gdb/c-lang.h index 5cbe34d..c02b8f4 100644 --- a/gdb/c-lang.h +++ b/gdb/c-lang.h @@ -72,7 +72,7 @@ extern void c_print_typedef (struct type *, struct ui_file *); extern void c_val_print (struct type *, const gdb_byte *, - int, CORE_ADDR, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -92,7 +92,7 @@ extern void c_printchar (int, struct type *, struct ui_file *); extern void c_printstr (struct ui_file * stream, struct type *elttype, const gdb_byte *string, - unsigned int length, + ULONGEST length, const char *user_encoding, int force_ellipses, const struct value_print_options *options); @@ -118,14 +118,14 @@ extern void cp_print_class_member (const gdb_byte *, struct type *, struct ui_file *, char *); extern void cp_print_value_fields (struct type *, struct type *, - const gdb_byte *, int, CORE_ADDR, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, struct type **, int); extern void cp_print_value_fields_rtti (struct type *, - const gdb_byte *, int, CORE_ADDR, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index a5892b5..1fd6b48 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -625,8 +625,8 @@ c_type_print_varspec_suffix (struct type *type, fprintf_filtered (stream, "["); if (get_array_bounds (type, &low_bound, &high_bound)) - fprintf_filtered (stream, "%d", - (int) (high_bound - low_bound + 1)); + fprintf_filtered (stream, "%s", + pulongest (high_bound - low_bound + 1)); fprintf_filtered (stream, "]"); c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index d1fd56d..620bde4 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -133,7 +133,7 @@ static const struct generic_val_print_decorations c_decorations = void c_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -144,7 +144,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, unsigned len; struct type *elttype, *unresolved_elttype; struct type *unresolved_type = type; - unsigned eltlen; + ULONGEST eltlen; LONGEST val; CORE_ADDR addr; @@ -346,9 +346,9 @@ c_val_print (struct type *type, const gdb_byte *valaddr, /* Print vtable entry - we only get here if NOT using -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ - int offset = (embedded_offset - + TYPE_FIELD_BITPOS (type, - VTBL_FNADDR_OFFSET) / 8); + LONGEST offset = (embedded_offset + + TYPE_FIELD_BITPOS (type, + VTBL_FNADDR_OFFSET) / 8); struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET); CORE_ADDR addr @@ -428,7 +428,8 @@ c_value_print (struct value *val, struct ui_file *stream, const struct value_print_options *options) { struct type *type, *real_type, *val_type; - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct value_print_options opts = *options; opts.deref_ref = 1; diff --git a/gdb/corefile.c b/gdb/corefile.c index 986e4f5..ff15eac 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -213,7 +213,7 @@ memory_error (int status, CORE_ADDR memaddr) /* Same as target_read_memory, but report an error if can't read. */ void -read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len) +read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len) { int status; @@ -225,7 +225,7 @@ read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len) /* Same as target_read_stack, but report an error if can't read. */ void -read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len) +read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len) { int status; @@ -352,7 +352,7 @@ read_memory_typed_address (CORE_ADDR addr, struct type *type) write. */ void write_memory (CORE_ADDR memaddr, - const bfd_byte *myaddr, int len) + const bfd_byte *myaddr, ULONGEST len) { int status; diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c index 16b5356..03f4baf 100644 --- a/gdb/cp-abi.c +++ b/gdb/cp-abi.c @@ -68,13 +68,13 @@ is_operator_name (const char *name) return (*current_cp_abi.is_operator_name) (name); } -int +LONGEST baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { volatile struct gdb_exception ex; - int res = 0; + LONGEST res = 0; gdb_assert (current_cp_abi.baseclass_offset != NULL); @@ -98,7 +98,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, struct value * value_virtual_fn_field (struct value **arg1p, struct fn_field *f, int j, - struct type *type, int offset) + struct type *type, LONGEST offset) { if ((current_cp_abi.virtual_fn_field) == NULL) return NULL; @@ -108,7 +108,7 @@ value_virtual_fn_field (struct value **arg1p, struct type * value_rtti_type (struct value *v, int *full, - int *top, int *using_enc) + LONGEST *top, int *using_enc) { struct type *ret = NULL; volatile struct gdb_exception e; diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h index 8451450..a34e9fe 100644 --- a/gdb/cp-abi.h +++ b/gdb/cp-abi.h @@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, struct fn_field *f, int j, struct type *type, - int offset); + LONGEST offset); /* Try to find the run-time type of VALUE, using C++ run-time type @@ -135,7 +135,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, FULL, TOP, and USING_ENC can each be zero, in which case we don't provide the corresponding piece of information. */ extern struct type *value_rtti_type (struct value *value, - int *full, int *top, + int *full, LONGEST *top, int *using_enc); /* Compute the offset of the baseclass which is the INDEXth baseclass @@ -144,11 +144,11 @@ extern struct type *value_rtti_type (struct value *value, contents of VAL. The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. */ -extern int baseclass_offset (struct type *type, - int index, const gdb_byte *valaddr, - int embedded_offset, - CORE_ADDR address, - const struct value *val); +extern LONGEST baseclass_offset (struct type *type, + int index, const gdb_byte *valaddr, + LONGEST embedded_offset, + CORE_ADDR address, + const struct value *val); /* Describe the target of a pointer to method. CONTENTS is the byte pattern representing the pointer to method. TYPE is the pointer to @@ -204,12 +204,13 @@ struct cp_abi_ops struct value *(*virtual_fn_field) (struct value **arg1p, struct fn_field * f, int j, struct type * type, - int offset); + LONGEST offset); struct type *(*rtti_type) (struct value *v, int *full, - int *top, int *using_enc); - int (*baseclass_offset) (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, - CORE_ADDR address, const struct value *val); + LONGEST *top, int *using_enc); + LONGEST (*baseclass_offset) (struct type *type, int index, + const bfd_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + const struct value *val); void (*print_method_ptr) (const gdb_byte *contents, struct type *type, struct ui_file *stream); diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 7dd13bb..a7b9381 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -82,7 +82,7 @@ static void cp_print_static_field (struct type *, struct value *, const struct value_print_options *); static void cp_print_value (struct type *, struct type *, - const gdb_byte *, int, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -156,7 +156,7 @@ cp_is_vtbl_member (struct type *type) void cp_print_value_fields (struct type *type, struct type *real_type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -443,7 +443,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, void cp_print_value_fields_rtti (struct type *type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -459,7 +459,8 @@ cp_print_value_fields_rtti (struct type *type, TARGET_CHAR_BIT * TYPE_LENGTH (type))) { struct value *value; - int full, top, using_enc; + int full, using_enc; + LONGEST top; /* Ugh, we have to convert back to a value here. */ value = value_from_contents_and_address (type, valaddr + offset, @@ -483,7 +484,7 @@ cp_print_value_fields_rtti (struct type *type, static void cp_print_value (struct type *type, struct type *real_type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -493,7 +494,7 @@ cp_print_value (struct type *type, struct type *real_type, = (struct type **) obstack_next_free (&dont_print_vb_obstack); struct obstack tmp_obstack = dont_print_vb_obstack; int i, n_baseclasses = TYPE_N_BASECLASSES (type); - int thisoffset; + LONGEST thisoffset; struct type *thistype; if (dont_print_vb == 0) @@ -507,7 +508,7 @@ cp_print_value (struct type *type, struct type *real_type, for (i = 0; i < n_baseclasses; i++) { - int boffset = 0; + LONGEST boffset = 0; int skip; struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); const char *basename = TYPE_NAME (baseclass); @@ -759,7 +760,7 @@ cp_find_class_member (struct type **domain_p, int *fieldno, for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) { LONGEST bitpos = TYPE_FIELD_BITPOS (domain, i); - LONGEST bitsize = 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (domain, i)); + ULONGEST bitsize = 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (domain, i)); if (offset >= bitpos && offset < bitpos + bitsize) { diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 34a2594..a0a6734 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -678,7 +678,7 @@ struct stack_item }; static struct stack_item * -push_stack_item (struct stack_item *prev, void *contents, int len) +push_stack_item (struct stack_item *prev, void *contents, ULONGEST len) { struct stack_item *si; si = xmalloc (sizeof (struct stack_item)); @@ -856,10 +856,10 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { - int len; + ULONGEST len; char *val; - int reg_demand; - int i; + ULONGEST reg_demand; + ULONGEST i; len = TYPE_LENGTH (value_type (args[argnum])); val = (char *) value_contents (args[argnum]); @@ -1669,7 +1669,7 @@ cris_store_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len <= 4) { @@ -1840,7 +1840,7 @@ cris_extract_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len <= 4) { diff --git a/gdb/d-lang.h b/gdb/d-lang.h index f93405a..84b149f 100644 --- a/gdb/d-lang.h +++ b/gdb/d-lang.h @@ -25,7 +25,7 @@ extern char *d_demangle (const char *mangled, int options); extern void d_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c index 3a8d11d..5d066e7 100644 --- a/gdb/d-valprint.c +++ b/gdb/d-valprint.c @@ -29,7 +29,7 @@ static int dynamic_array_type (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) @@ -71,9 +71,9 @@ dynamic_array_type (struct type *type, const gdb_byte *valaddr, /* Implements the la_val_print routine for language D. */ void -d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, - const struct value *val, +d_val_print (struct type *type, const gdb_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) { int ret; diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi index 24233cb..d05ebbe 100644 --- a/gdb/doc/observer.texi +++ b/gdb/doc/observer.texi @@ -216,7 +216,7 @@ The inferior @var{inf} has been removed from the list of inferiors. This method is called immediately before freeing @var{inf}. @end deftypefun -@deftypefun void memory_changed (CORE_ADDR @var{addr}, int @var{len}, const bfd_byte *@var{data}) +@deftypefun void memory_changed (CORE_ADDR @var{addr}, LONGEST @var{len}, const bfd_byte *@var{data}) Bytes from @var{data} to @var{data} + @var{len} have been written to the current inferior at @var{addr}. @end deftypefun diff --git a/gdb/doublest.c b/gdb/doublest.c index c8c9e05..71c27c5 100644 --- a/gdb/doublest.c +++ b/gdb/doublest.c @@ -770,7 +770,7 @@ floatformat_from_doublest (const struct floatformat *fmt, but not passed on by GDB. This should be fixed. */ static const struct floatformat * -floatformat_from_length (struct gdbarch *gdbarch, int len) +floatformat_from_length (struct gdbarch *gdbarch, ULONGEST len) { const struct floatformat *format; @@ -798,8 +798,8 @@ floatformat_from_length (struct gdbarch *gdbarch, int len) else format = NULL; if (format == NULL) - error (_("Unrecognized %d-bit floating-point type."), - len * TARGET_CHAR_BIT); + error (_("Unrecognized %s-bit floating-point type."), + pulongest (len * TARGET_CHAR_BIT)); return format; } diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index caef546..e83e4d5 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -1334,19 +1334,19 @@ insert_bits (unsigned int datum, BITS_BIG_ENDIAN is taken directly from gdbarch. */ static void -copy_bitwise (gdb_byte *dest, unsigned int dest_offset_bits, - const gdb_byte *source, unsigned int source_offset_bits, - unsigned int bit_count, +copy_bitwise (gdb_byte *dest, ULONGEST dest_offset_bits, + const gdb_byte *source, ULONGEST source_offset, + ULONGEST bit_count, int bits_big_endian) { - unsigned int dest_avail; + unsigned int dest_avail, source_offset_bits; int datum; /* Reduce everything to byte-size pieces. */ dest += dest_offset_bits / 8; dest_offset_bits %= 8; - source += source_offset_bits / 8; - source_offset_bits %= 8; + source += source_offset / 8; + source_offset_bits = source_offset % 8; dest_avail = 8 - dest_offset_bits % 8; @@ -1384,13 +1384,13 @@ static void read_pieced_value (struct value *v) { int i; - long offset = 0; + LONGEST offset = 0; ULONGEST bits_to_skip; gdb_byte *contents; struct piece_closure *c = (struct piece_closure *) value_computed_closure (v); struct frame_info *frame = frame_find_by_id (VALUE_FRAME_ID (v)); - size_t type_len; + ULONGEST type_len; size_t buffer_size = 0; char *buffer = NULL; struct cleanup *cleanup; @@ -1417,8 +1417,8 @@ read_pieced_value (struct value *v) for (i = 0; i < c->n_pieces && offset < type_len; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size, this_size_bits; - long dest_offset_bits, source_offset_bits, source_offset; + ULONGEST this_size, this_size_bits; + LONGEST dest_offset_bits, source_offset_bits, source_offset; const gdb_byte *intermediate_buffer; /* Compute size, source, and destination offsets for copying, in @@ -1573,7 +1573,7 @@ write_pieced_value (struct value *to, struct value *from) struct piece_closure *c = (struct piece_closure *) value_computed_closure (to); struct frame_info *frame = frame_find_by_id (VALUE_FRAME_ID (to)); - size_t type_len; + ULONGEST type_len; size_t buffer_size = 0; char *buffer = NULL; struct cleanup *cleanup; @@ -1589,7 +1589,7 @@ write_pieced_value (struct value *to, struct value *from) cleanup = make_cleanup (free_current_contents, &buffer); contents = value_contents (from); - bits_to_skip = 8 * value_offset (to); + bits_to_skip = (ULONGEST)(8 * value_offset (to)); if (value_bitsize (to)) { bits_to_skip += value_bitpos (to); @@ -1601,8 +1601,8 @@ write_pieced_value (struct value *to, struct value *from) for (i = 0; i < c->n_pieces && offset < type_len; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size_bits, this_size; - long dest_offset_bits, source_offset_bits, dest_offset, source_offset; + ULONGEST this_size_bits, this_size; + LONGEST dest_offset_bits, source_offset_bits, dest_offset, source_offset; int need_bitwise; const gdb_byte *source_buffer; @@ -1731,8 +1731,8 @@ write_pieced_value (struct value *to, struct value *from) implicit pointer. */ static int -check_pieced_value_bits (const struct value *value, int bit_offset, - int bit_length, +check_pieced_value_bits (const struct value *value, LONGEST bit_offset, + ULONGEST bit_length, enum dwarf_value_location check_for) { struct piece_closure *c @@ -1786,8 +1786,8 @@ check_pieced_value_bits (const struct value *value, int bit_offset, } static int -check_pieced_value_validity (const struct value *value, int bit_offset, - int bit_length) +check_pieced_value_validity (const struct value *value, LONGEST bit_offset, + ULONGEST bit_length) { return check_pieced_value_bits (value, bit_offset, bit_length, DWARF_VALUE_MEMORY); @@ -1805,8 +1805,8 @@ check_pieced_value_invalid (const struct value *value) a synthetic pointer. */ static int -check_pieced_synthetic_pointer (const struct value *value, int bit_offset, - int bit_length) +check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, + ULONGEST bit_length) { return check_pieced_value_bits (value, bit_offset, bit_length, DWARF_VALUE_IMPLICIT_POINTER); @@ -1831,9 +1831,10 @@ indirect_pieced_value (struct value *value) struct type *type; struct frame_info *frame; struct dwarf2_locexpr_baton baton; - int i, bit_offset, bit_length; + int i; + ULONGEST bit_length; struct dwarf_expr_piece *piece = NULL; - LONGEST byte_offset; + LONGEST byte_offset, bit_offset; type = check_typedef (value_type (value)); if (TYPE_CODE (type) != TYPE_CODE_PTR) @@ -2080,7 +2081,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, struct value *value = dwarf_expr_fetch (ctx, 0); gdb_byte *contents; const gdb_byte *val_bytes; - size_t n = TYPE_LENGTH (value_type (value)); + ULONGEST n = TYPE_LENGTH (value_type (value)); if (byte_offset + TYPE_LENGTH (type) > n) invalid_synthetic_pointer (); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 412fe5b..c71e366 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -804,7 +804,7 @@ struct die_info /* Blocks are a bunch of untyped bytes. */ struct dwarf_block { - unsigned int size; + ULONGEST size; /* Valid only if SIZE is not zero. */ gdb_byte *data; @@ -940,12 +940,12 @@ dwarf2_complex_location_expr_complaint (void) } static void -dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2, - int arg3) +dwarf2_const_value_length_mismatch_complaint (const char *arg1, ULONGEST arg2, + ULONGEST arg3) { complaint (&symfile_complaints, - _("const value length mismatch for '%s', got %d, expected %d"), - arg1, arg2, arg3); + _("const value length mismatch for '%s', got %s, expected %s"), + arg1, pulongest (arg2), pulongest (arg3)); } static void @@ -8202,7 +8202,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ - int anonymous_size; + ULONGEST anonymous_size; int bit_offset = DW_UNSND (attr); attr = dwarf2_attr (die, DW_AT_byte_size, cu); @@ -15314,12 +15314,12 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) case DW_FORM_block4: case DW_FORM_block: case DW_FORM_block1: - fprintf_unfiltered (f, "block: size %d", - DW_BLOCK (&die->attrs[i])->size); + fprintf_unfiltered (f, "block: size %s", + pulongest (DW_BLOCK (&die->attrs[i])->size)); break; case DW_FORM_exprloc: - fprintf_unfiltered (f, "expression: size %u", - DW_BLOCK (&die->attrs[i])->size); + fprintf_unfiltered (f, "expression: size %s", + pulongest (DW_BLOCK (&die->attrs[i])->size)); break; case DW_FORM_ref_addr: fprintf_unfiltered (f, "ref address: "); diff --git a/gdb/eval.c b/gdb/eval.c index de1c4bd..91028cd 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -319,7 +319,8 @@ evaluate_struct_tuple (struct value *struct_val, int pc = *pos; struct value *val = NULL; int nlabels = 0; - int bitpos, bitsize; + int bitsize; + LONGEST bitpos; bfd_byte *addr; /* Skip past the labels, and count them. */ @@ -462,7 +463,7 @@ init_array_element (struct value *array, struct value *element, enum noside noside, LONGEST low_bound, LONGEST high_bound) { LONGEST index; - int element_size = TYPE_LENGTH (value_type (element)); + ULONGEST element_size = TYPE_LENGTH (value_type (element)); if (exp->elts[*pos].opcode == BINOP_COMMA) { @@ -625,11 +626,11 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch, /* FIXME: Also mixed integral/booleans, with result an integer. */ { const struct builtin_type *builtin = builtin_type (gdbarch); - unsigned int promoted_len1 = TYPE_LENGTH (type1); - unsigned int promoted_len2 = TYPE_LENGTH (type2); + ULONGEST promoted_len1 = TYPE_LENGTH (type1); + ULONGEST promoted_len2 = TYPE_LENGTH (type2); int is_unsigned1 = TYPE_UNSIGNED (type1); int is_unsigned2 = TYPE_UNSIGNED (type2); - unsigned int result_len; + ULONGEST result_len; int unsigned_operation; /* Determine type length and signedness after promotion for @@ -796,7 +797,7 @@ evaluate_subexp_standard (struct type *expect_type, int upper, lower; int code; int ix; - long mem_offset; + LONGEST mem_offset; struct type **arg_types; int save_pos1; struct symbol *function = NULL; @@ -985,7 +986,7 @@ evaluate_subexp_standard (struct type *expect_type, struct type *range_type = TYPE_INDEX_TYPE (type); struct type *element_type = TYPE_TARGET_TYPE (type); struct value *array = allocate_value (expect_type); - int element_size = TYPE_LENGTH (check_typedef (element_type)); + ULONGEST element_size = TYPE_LENGTH (check_typedef (element_type)); LONGEST low_bound, high_bound, index; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) @@ -1994,7 +1995,8 @@ evaluate_subexp_standard (struct type *expect_type, { struct type *type = value_type (arg1); struct type *real_type; - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct value_print_options opts; get_user_print_options (&opts); diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 3368d01..e3bd983 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -138,7 +138,7 @@ f_printchar (int c, struct type *type, struct ui_file *stream) static void f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, - unsigned int length, const char *encoding, int force_ellipses, + ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { const char *type_encoding = f_get_encoding (type); diff --git a/gdb/f-lang.h b/gdb/f-lang.h index 4aae3c5..d20a46f 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h @@ -28,7 +28,7 @@ extern void f_error (char *); /* Defined in f-exp.y */ extern void f_print_type (struct type *, const char *, struct ui_file *, int, int); -extern void f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern void f_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 62a7136..f95a771 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -46,7 +46,7 @@ static void f77_create_arrayprint_offset_tbl (struct type *, struct ui_file *); static void f77_get_dynamic_length_of_aggregate (struct type *); -int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; +LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; /* Array which holds offsets to be applied to get a row's elements for a given array. Array also holds the size of each subarray. */ @@ -124,7 +124,7 @@ static void f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) { struct type *tmp_type; - int eltlen; + ULONGEST eltlen; int ndimen = 1; int upper, lower; @@ -164,7 +164,7 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) static void f77_print_array_1 (int nss, int ndimensions, struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -215,7 +215,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, static void f77_print_array (struct type *type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -258,8 +258,9 @@ static const struct generic_val_print_decorations f_decorations = function; they are identical. */ void -f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, +f_val_print (struct type *type, const gdb_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) { @@ -371,7 +372,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, fprintf_filtered (stream, "( "); for (index = 0; index < TYPE_NFIELDS (type); index++) { - int offset = TYPE_FIELD_BITPOS (type, index) / 8; + LONGEST offset = TYPE_FIELD_BITPOS (type, index) / 8; val_print (TYPE_FIELD_TYPE (type, index), valaddr, embedded_offset + offset, diff --git a/gdb/findcmd.c b/gdb/findcmd.c index 3fce269..6343a34 100644 --- a/gdb/findcmd.c +++ b/gdb/findcmd.c @@ -169,7 +169,7 @@ parse_find_args (char *args, ULONGEST *max_countp, while (*s != '\0') { LONGEST x; - int val_bytes; + ULONGEST val_bytes; while (isspace (*s)) ++s; diff --git a/gdb/findvar.c b/gdb/findvar.c index 9009e6f..d1d8266 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -92,7 +92,7 @@ extract_unsigned_integer (const gdb_byte *addr, int len, const unsigned char *startaddr = addr; const unsigned char *endaddr = startaddr + len; - if (len > (int) sizeof (ULONGEST)) + if (len > sizeof (ULONGEST)) error (_("\ That operation is not available on integers of more than %d bytes."), (int) sizeof (ULONGEST)); @@ -415,7 +415,7 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) struct value *v; struct type *type = SYMBOL_TYPE (var); CORE_ADDR addr; - int len; + ULONGEST len; /* Call check_typedef on our type to make sure that, if TYPE is a TYPE_CODE_TYPEDEF, its length is set to the length of the target type @@ -613,7 +613,7 @@ default_value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); struct value *value = allocate_value (type); VALUE_LVAL (value) = lval_register; @@ -643,10 +643,10 @@ void read_frame_register_value (struct value *value, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); - int offset = 0; - int reg_offset = value_offset (value); + LONGEST offset = 0; + LONGEST reg_offset = value_offset (value); int regnum = VALUE_REGNUM (value); - int len = TYPE_LENGTH (check_typedef (value_type (value))); + ULONGEST len = TYPE_LENGTH (check_typedef (value_type (value))); gdb_assert (VALUE_LVAL (value) == lval_register); @@ -661,7 +661,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) while (len > 0) { struct value *regval = get_frame_register_value (frame, regnum); - int reg_len = TYPE_LENGTH (value_type (regval)) - reg_offset; + ULONGEST reg_len = TYPE_LENGTH (value_type (regval)) - reg_offset; /* If the register length is larger than the number of bytes remaining to copy, then only copy the appropriate bytes. */ diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 1f2400a..e5a589d 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1123,7 +1123,7 @@ frv_extract_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len <= 4) { @@ -1142,7 +1142,7 @@ frv_extract_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Illegal return value length: %d"), len); + _("Illegal return value length: %s"), pulongest (len)); } static CORE_ADDR @@ -1213,7 +1213,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function, char valbuf[4]; struct value *arg; struct type *arg_type; - int len; + ULONGEST len; enum type_code typecode; CORE_ADDR regval; int stack_space; @@ -1331,7 +1331,7 @@ static void frv_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len <= 4) { @@ -1347,7 +1347,8 @@ frv_store_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Don't know how to return a %d-byte value."), len); + _("Don't know how to return a %s-byte value."), + pulongest (len)); } static enum return_value_convention diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h index 776ce9f..9408fc1 100644 --- a/gdb/gdbcore.h +++ b/gdb/gdbcore.h @@ -45,11 +45,11 @@ extern void memory_error (int status, CORE_ADDR memaddr); /* Like target_read_memory, but report an error if can't read. */ -extern void read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len); +extern void read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len); /* Like target_read_stack, but report an error if can't read. */ -extern void read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len); +extern void read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len); /* Read an integer from debugged memory, given address and number of bytes. */ @@ -83,7 +83,8 @@ CORE_ADDR read_memory_typed_address (CORE_ADDR addr, struct type *type); byteswapping, alignment, different sizes for host vs. target types, etc. */ -extern void write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len); +extern void write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, + ULONGEST len); /* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */ extern void write_memory_unsigned_integer (CORE_ADDR addr, int len, diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 60b0839..b56d7f1 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1905,7 +1905,7 @@ allocate_gnat_aux_type (struct type *type) where init_type is called with a NULL value for NAME). */ struct type * -init_type (enum type_code code, int length, int flags, +init_type (enum type_code code, ULONGEST length, int flags, char *name, struct objfile *objfile) { struct type *type; @@ -2137,8 +2137,8 @@ is_public_ancestor (struct type *base, struct type *dclass) static int is_unique_ancestor_worker (struct type *base, struct type *dclass, - int *offset, - const gdb_byte *valaddr, int embedded_offset, + LONGEST *offset, + const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct value *val) { int i, count = 0; @@ -2149,7 +2149,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) { struct type *iter; - int this_offset; + LONGEST this_offset; iter = check_typedef (TYPE_BASECLASS (dclass, i)); @@ -2190,7 +2190,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, int is_unique_ancestor (struct type *base, struct value *val) { - int offset = -1; + LONGEST offset = -1; return is_unique_ancestor_worker (base, value_type (val), &offset, value_contents_for_printing (val), @@ -3083,7 +3083,7 @@ recursive_dump_type (struct type *type, int spaces) break; } puts_filtered ("\n"); - printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type)); + printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type))); if (TYPE_OBJFILE_OWNED (type)) { printfi_filtered (spaces, "objfile "); @@ -3203,8 +3203,8 @@ recursive_dump_type (struct type *type, int spaces) idx, plongest (TYPE_FIELD_ENUMVAL (type, idx))); else printfi_filtered (spaces + 2, - "[%d] bitpos %d bitsize %d type ", - idx, TYPE_FIELD_BITPOS (type, idx), + "[%d] bitpos %s bitsize %d type ", + idx, plongest (TYPE_FIELD_BITPOS (type, idx)), TYPE_FIELD_BITSIZE (type, idx)); gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); printf_filtered (" name '%s' (", @@ -3486,7 +3486,7 @@ copy_type (const struct type *type) CODE, LENGTH, and NAME fields. */ struct type * arch_type (struct gdbarch *gdbarch, - enum type_code code, int length, char *name) + enum type_code code, ULONGEST length, char *name) { struct type *type; diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 887dfdb..8c4c0de 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -514,7 +514,7 @@ struct main_type gdbarch_bits_big_endian=0 targets, it is the bit offset to the LSB. */ - int bitpos; + LONGEST bitpos; /* Enum value. */ LONGEST enumval; @@ -684,7 +684,7 @@ struct type HOST_CHAR_BIT. However, this would still fail to address machines based on a ternary or decimal representation. */ - unsigned length; + ULONGEST length; /* Core type, shared by a group of qualified types. */ struct main_type *main_type; @@ -1398,11 +1398,12 @@ extern struct type *alloc_type_copy (const struct type *); extern struct gdbarch *get_type_arch (const struct type *); /* Helper function to construct objfile-owned types. */ -extern struct type *init_type (enum type_code, int, int, char *, +extern struct type *init_type (enum type_code, ULONGEST, int, char *, struct objfile *); /* Helper functions to construct architecture-owned types. */ -extern struct type *arch_type (struct gdbarch *, enum type_code, int, char *); +extern struct type *arch_type (struct gdbarch *, enum type_code, ULONGEST, + char *); extern struct type *arch_integer_type (struct gdbarch *, int, int, char *); extern struct type *arch_character_type (struct gdbarch *, int, int, char *); extern struct type *arch_boolean_type (struct gdbarch *, int, int, char *); diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index e635e8f..d6b7d27 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -85,8 +85,8 @@ gnuv2_is_operator_name (const char *name) TYPE is the type in which F is located. */ static struct value * -gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, - struct type * type, int offset) +gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field *f, int j, + struct type *type, LONGEST offset) { struct value *arg1 = *arg1p; struct type *type1 = check_typedef (value_type (arg1)); @@ -187,7 +187,8 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, static struct type * -gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc) +gnuv2_value_rtti_type (struct value *v, int *full, LONGEST *top, + int *using_enc) { struct type *known_type; struct type *rtti_type; @@ -342,9 +343,9 @@ vb_match (struct type *type, int index, struct type *basetype) target). The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. */ -static int +static LONGEST gnuv2_baseclass_offset (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, + const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { struct type *basetype = TYPE_BASECLASS (type, index); @@ -362,8 +363,8 @@ gnuv2_baseclass_offset (struct type *type, int index, if (vb_match (type, i, basetype)) { struct type *field_type; - int field_offset; - int field_length; + LONGEST field_offset; + ULONGEST field_length; CORE_ADDR addr; field_type = check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -387,7 +388,7 @@ gnuv2_baseclass_offset (struct type *type, int index, /* Don't go through baseclass_offset, as that wraps exceptions, thus, inner exceptions would be wrapped more than once. */ - int boffset = + LONGEST boffset = gnuv2_baseclass_offset (type, i, valaddr, embedded_offset, address, val); diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index ed94b84..180d96f 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -105,7 +105,7 @@ build_gdb_vtable_type (struct gdbarch *arch) { struct type *t; struct field *field_list, *field; - int offset; + ULONGEST offset; struct type *void_ptr_type = builtin_type (arch)->builtin_data_ptr; @@ -181,7 +181,7 @@ vtable_ptrdiff_type (struct gdbarch *gdbarch) /* Return the offset from the start of the imaginary `struct gdb_gnu_v3_abi_vtable' object to the vtable's "address point" (i.e., where objects' virtual table pointers point). */ -static int +static LONGEST vtable_address_point_offset (struct gdbarch *gdbarch) { struct type *vtable_type = gdbarch_data (gdbarch, vtable_type_gdbarch_data); @@ -272,7 +272,7 @@ gnuv3_get_vtable (struct gdbarch *gdbarch, static struct type * gnuv3_rtti_type (struct value *value, - int *full_p, int *top_p, int *using_enc_p) + int *full_p, LONGEST *top_p, int *using_enc_p) { struct gdbarch *gdbarch; struct type *values_type = check_typedef (value_type (value)); @@ -384,7 +384,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, static struct value * gnuv3_virtual_fn_field (struct value **value_p, struct fn_field *f, int j, - struct type *vfn_base, int offset) + struct type *vfn_base, LONGEST offset) { struct type *values_type = check_typedef (value_type (*value_p)); struct gdbarch *gdbarch; @@ -414,16 +414,16 @@ gnuv3_virtual_fn_field (struct value **value_p, -1 is returned on error. */ -static int +static LONGEST gnuv3_baseclass_offset (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, + const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { struct gdbarch *gdbarch; struct type *ptr_type; struct value *vtable; struct value *vbase_array; - long int cur_base_offset, base_offset; + LONGEST cur_base_offset, base_offset; /* Determine architecture. */ gdbarch = get_type_arch (type); @@ -446,7 +446,7 @@ gnuv3_baseclass_offset (struct type *type, int index, cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch); if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0) error (_("Misaligned vbase offset.")); - cur_base_offset = cur_base_offset / ((int) TYPE_LENGTH (ptr_type)); + cur_base_offset = cur_base_offset / ((LONGEST) TYPE_LENGTH (ptr_type)); vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset); gdb_assert (vtable != NULL); @@ -490,7 +490,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, we're out of luck. */ for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) { - int pos; + LONGEST pos; struct type *basetype; if (BASETYPE_VIA_VIRTUAL (domain, i)) diff --git a/gdb/go-lang.h b/gdb/go-lang.h index 67b5d93..51a1f7a 100644 --- a/gdb/go-lang.h +++ b/gdb/go-lang.h @@ -80,7 +80,7 @@ extern void go_print_type (struct type *type, const char *varstring, /* Defined in go-valprint.c. */ extern void go_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c index 3be4927..3a465eb 100644 --- a/gdb/go-valprint.c +++ b/gdb/go-valprint.c @@ -83,7 +83,7 @@ print_go_string (struct type *type, const gdb_byte *valaddr, /* Implements the la_val_print routine for language Go. */ void -go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +go_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index aa056f9..c3c8a7e 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -642,7 +642,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int struct_return, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int stack_alloc = 0, stack_offset = 0; + ULONGEST stack_alloc = 0, stack_offset = 0; int wordsize = BINWORD (gdbarch); int reg = E_ARG0_REGNUM; int argument; @@ -668,11 +668,11 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argument = 0; argument < nargs; argument++) { struct type *type = value_type (args[argument]); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); char *contents = (char *) value_contents (args[argument]); /* Pad the argument appropriately. */ - int padded_len = align_up (len, wordsize); + ULONGEST padded_len = align_up (len, wordsize); gdb_byte *padded = alloca (padded_len); memset (padded, 0, padded_len); @@ -700,7 +700,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Heavens to Betsy --- it's really going in registers! Note that on the h8/300s, there are gaps between the registers in the register file. */ - int offset; + ULONGEST offset; for (offset = 0; offset < padded_len; offset += wordsize) { diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 7f7fb8e..585da78 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -963,7 +963,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = value_type (arg); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); const bfd_byte *valbuf; bfd_byte fptrbuf[8]; int regnum; @@ -1158,7 +1158,7 @@ hppa64_return_value (struct gdbarch *gdbarch, struct type *func_type, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regnum, offset; if (len > 16) diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c index c353154..40a772b 100644 --- a/gdb/i386-darwin-tdep.c +++ b/gdb/i386-darwin-tdep.c @@ -119,7 +119,7 @@ i386_m128_p (struct type *type) /* Return the alignment for TYPE when passed as an argument. */ -static int +static ULONGEST i386_darwin_arg_type_alignment (struct type *type) { type = check_typedef (type); @@ -139,7 +139,7 @@ i386_darwin_arg_type_alignment (struct type *type) || TYPE_CODE (type) == TYPE_CODE_UNION) { int i; - int res = 4; + ULONGEST res = 4; for (i = 0; i < TYPE_NFIELDS (type); i++) res = max (res, i386_darwin_arg_type_alignment (TYPE_FIELD_TYPE (type, i))); @@ -166,7 +166,7 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (write_pass = 0; write_pass < 2; write_pass++) { - int args_space = 0; + ULONGEST args_space = 0; int num_m128 = 0; if (struct_return) @@ -196,8 +196,8 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else { - int len = TYPE_LENGTH (arg_type); - int align = i386_darwin_arg_type_alignment (arg_type); + ULONGEST len = TYPE_LENGTH (arg_type); + ULONGEST align = i386_darwin_arg_type_alignment (arg_type); args_space = align_up (args_space, align); if (write_pass) diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c index 753de67..0ba1ed2 100644 --- a/gdb/i386-nat.c +++ b/gdb/i386-nat.c @@ -293,7 +293,7 @@ static int i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state, valid value, bombs through internal_error. */ static int i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, i386_wp_op_t what, - CORE_ADDR addr, int len, + CORE_ADDR addr, ULONGEST len, enum target_hw_bp_type type); /* Implementation. */ @@ -505,8 +505,8 @@ i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state, static int i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, - i386_wp_op_t what, CORE_ADDR addr, int len, - enum target_hw_bp_type type) + i386_wp_op_t what, CORE_ADDR addr, + ULONGEST len, enum target_hw_bp_type type) { int retval = 0; int max_wp_len = TARGET_HAS_DR_LEN_8 ? 8 : 4; @@ -663,7 +663,7 @@ i386_remove_watchpoint (CORE_ADDR addr, int len, int type, address ADDR and whose length is LEN bytes. */ static int -i386_region_ok_for_watchpoint (CORE_ADDR addr, int len) +i386_region_ok_for_watchpoint (CORE_ADDR addr, LONGEST len) { struct i386_debug_reg_state *state = i386_debug_reg_state (); int nregs; diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 6858b5a..1d53bf1 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -2343,7 +2343,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte buf[4]; int i; int write_pass; - int args_space = 0; + ULONGEST args_space = 0; /* Determine the total space required for arguments and struct return address in a first pass (allowing for 16-byte-aligned @@ -2351,7 +2351,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (write_pass = 0; write_pass < 2; write_pass++) { - int args_space_used = 0; + ULONGEST args_space_used = 0; int have_16_byte_aligned_arg = 0; if (struct_return) @@ -2369,7 +2369,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < nargs; i++) { - int len = TYPE_LENGTH (value_enclosing_type (args[i])); + ULONGEST len = TYPE_LENGTH (value_enclosing_type (args[i])); if (write_pass) { @@ -2444,7 +2444,7 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); gdb_byte buf[I386_MAX_REGISTER_SIZE]; if (TYPE_CODE (type) == TYPE_CODE_FLT) @@ -2482,8 +2482,8 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type, } else internal_error (__FILE__, __LINE__, - _("Cannot extract return value of %d bytes long."), - len); + _("Cannot extract return value of %s bytes long."), + pulongest (len)); } } @@ -2495,7 +2495,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_FLT) { @@ -2547,7 +2547,8 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type, } else internal_error (__FILE__, __LINE__, - _("Cannot store return value of %d bytes long."), len); + _("Cannot store return value of %s bytes long."), + pulongest (len)); } } \f diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 460345b..e29f97e 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -3269,7 +3269,7 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache, int offset = 0; int regnum = IA64_GR8_REGNUM; int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM)); - int n = TYPE_LENGTH (type) / reglen; + ULONGEST n = TYPE_LENGTH (type) / reglen; int m = TYPE_LENGTH (type) % reglen; while (n-- > 0) @@ -3319,7 +3319,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache, int offset = 0; int regnum = IA64_GR8_REGNUM; int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM)); - int n = TYPE_LENGTH (type) / reglen; + ULONGEST n = TYPE_LENGTH (type) / reglen; int m = TYPE_LENGTH (type) % reglen; while (n-- > 0) @@ -3725,8 +3725,10 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argno; struct value *arg; struct type *type; - int len, argoffset; - int nslots, rseslots, memslots, slotnum, nfuncargs; + ULONGEST argoffset; + ULONGEST len; + int rseslots, slotnum, nfuncargs; + ULONGEST nslots, memslots; int floatreg; ULONGEST bsp; CORE_ADDR funcdescaddr, pc, global_pointer; diff --git a/gdb/infcall.c b/gdb/infcall.c index 8737c7b..cfc53a7 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -710,7 +710,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) if (struct_return || lang_struct_return) { - int len = TYPE_LENGTH (values_type); + ULONGEST len = TYPE_LENGTH (values_type); if (gdbarch_inner_than (gdbarch, 1, 2)) { diff --git a/gdb/infrun.c b/gdb/infrun.c index ab51806..360a9b7 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -6710,7 +6710,7 @@ save_infcall_suspend_state (void) if (gdbarch_get_siginfo_type_p (gdbarch)) { struct type *type = gdbarch_get_siginfo_type (gdbarch); - size_t len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); struct cleanup *back_to; siginfo_data = xmalloc (len); @@ -6767,11 +6767,10 @@ restore_infcall_suspend_state (struct infcall_suspend_state *inf_state) if (inf_state->siginfo_gdbarch == gdbarch) { struct type *type = gdbarch_get_siginfo_type (gdbarch); - size_t len = TYPE_LENGTH (type); /* Errors ignored. */ target_write (¤t_target, TARGET_OBJECT_SIGNAL_INFO, NULL, - inf_state->siginfo_data, 0, len); + inf_state->siginfo_data, 0, TYPE_LENGTH (type)); } /* The inferior can be gone if the user types "print exit(0)" diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c index dd8ad61..a43cf65 100644 --- a/gdb/iq2000-tdep.c +++ b/gdb/iq2000-tdep.c @@ -504,7 +504,7 @@ static void iq2000_store_return_value (struct type *type, struct regcache *regcache, const void *valbuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = E_FN_RETURN_REGNUM; while (len > 0) @@ -550,7 +550,7 @@ iq2000_extract_return_value (struct type *type, struct regcache *regcache, returned in a register, and if larger than 8 bytes, it is returned in a stack location which is pointed to by the same register. */ - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len <= (2 * 4)) { @@ -578,7 +578,7 @@ iq2000_extract_return_value (struct type *type, struct regcache *regcache, ULONGEST return_buffer; regcache_cooked_read_unsigned (regcache, E_FN_RETURN_REGNUM, &return_buffer); - read_memory (return_buffer, valbuf, TYPE_LENGTH (type)); + read_memory (return_buffer, valbuf, len); } } @@ -655,8 +655,9 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const bfd_byte *val; bfd_byte buf[4]; struct type *type; - int i, argreg, typelen, slacklen; - int stackspace = 0; + int i, argreg, slacklen; + ULONGEST typelen; + ULONGEST stackspace = 0; /* Used to copy struct arguments into the stack. */ CORE_ADDR struct_ptr; diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index c3c5298..58ed339 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -438,7 +438,7 @@ java_link_class_type (struct gdbarch *gdbarch, for (i = TYPE_N_BASECLASSES (type); i < nfields; i++) { int accflags; - int boffset; + LONGEST boffset; if (fields == NULL) { @@ -887,7 +887,7 @@ java_printchar (int c, struct type *type, struct ui_file *stream) static void java_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, - unsigned int length, const char *encoding, int force_ellipses, + ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { const char *type_encoding = java_get_encoding (type); diff --git a/gdb/jv-lang.h b/gdb/jv-lang.h index 8ea9c3c..bf77ccf 100644 --- a/gdb/jv-lang.h +++ b/gdb/jv-lang.h @@ -42,8 +42,8 @@ struct builtin_java_type extern const struct builtin_java_type *builtin_java_type (struct gdbarch *); -extern void java_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, - struct ui_file *, int, +extern void java_val_print (struct type *, const gdb_byte *, LONGEST, + CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index 12a960f..35a55b8 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -264,7 +264,7 @@ java_value_print (struct value *val, struct ui_file *stream, static void java_print_value_fields (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -482,7 +482,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, void java_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) diff --git a/gdb/language.c b/gdb/language.c index f0a8697..9ae020e 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -831,7 +831,7 @@ unk_lang_printchar (int c, struct type *type, struct ui_file *stream) static void unk_lang_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { @@ -849,7 +849,7 @@ unk_lang_print_type (struct type *type, const char *varstring, static void unk_lang_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) diff --git a/gdb/language.h b/gdb/language.h index d612c70..c571b81 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -200,7 +200,7 @@ struct language_defn struct ui_file * stream); void (*la_printstr) (struct ui_file * stream, struct type *elttype, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *); @@ -242,7 +242,7 @@ struct language_defn void (*la_val_print) (struct type *type, const gdb_byte *contents, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index 4f67542..80df079 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -262,7 +262,7 @@ lm32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); gdb_byte *contents; - int len; + ULONGEST len; int j; int reg; ULONGEST val; @@ -354,7 +354,7 @@ lm32_store_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len <= 4) { diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index 8faa6c1..0c9d394 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -104,7 +104,7 @@ m2_printchar (int c, struct type *type, struct ui_file *stream) static void m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, - unsigned int length, const char *encoding, int force_ellipses, + ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { unsigned int i; diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h index fc6de34..9d65366 100644 --- a/gdb/m2-lang.h +++ b/gdb/m2-lang.h @@ -32,7 +32,7 @@ extern void m2_print_typedef (struct type *, struct symbol *, extern int m2_is_long_set (struct type *type); extern int m2_is_unbounded_array (struct type *type); -extern void m2_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern void m2_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index fb3d49c..effe2c9 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -228,9 +228,11 @@ static void m2_array (struct type *type, struct ui_file *stream, m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1); } else - fprintf_filtered (stream, "%d", - (TYPE_LENGTH (type) - / TYPE_LENGTH (TYPE_TARGET_TYPE (type)))); + { + ULONGEST val = (TYPE_LENGTH (type) + / TYPE_LENGTH (TYPE_TARGET_TYPE (type))); + fprintf_filtered (stream, "%s", pulongest (val)); + } } fprintf_filtered (stream, "] OF "); m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level); @@ -587,7 +589,8 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show, void m2_enum (struct type *type, struct ui_file *stream, int show, int level) { - int lastval, i, len; + LONGEST lastval; + int i, len; if (show < 0) { diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c index 9e1c1ff..4d13dad 100644 --- a/gdb/m2-valprint.c +++ b/gdb/m2-valprint.c @@ -36,7 +36,7 @@ static int print_unpacked_pointer (struct type *type, struct ui_file *stream); static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -68,7 +68,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high) static void m2_print_long_set (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream) { int empty_set = 1; @@ -159,7 +159,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr, static void m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value_print_options *options) { @@ -256,22 +256,20 @@ print_variable_at_address (struct type *type, static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int len) { - int eltlen; CHECK_TYPEDEF (type); if (TYPE_LENGTH (type) > 0) { - eltlen = TYPE_LENGTH (type); if (options->prettyprint_arrays) print_spaces_filtered (2 + 2 * recurse, stream); /* For an array of chars, print with string syntax. */ - if (eltlen == 1 && + if (TYPE_LENGTH (type) == 1 && ((TYPE_CODE (type) == TYPE_CODE_INT) || ((current_language->la_language == language_m2) && (TYPE_CODE (type) == TYPE_CODE_CHAR))) @@ -304,16 +302,16 @@ static const struct generic_val_print_decorations m2_decorations = function; they are identical. */ void -m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, +m2_val_print (struct type *type, const gdb_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) { struct gdbarch *gdbarch = get_type_arch (type); - unsigned int i = 0; /* Number of characters printed. */ - unsigned len; + ULONGEST i = 0; /* Number of characters printed. */ + ULONGEST len; struct type *elttype; - unsigned eltlen; LONGEST val; CORE_ADDR addr; @@ -324,12 +322,11 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0) { elttype = check_typedef (TYPE_TARGET_TYPE (type)); - eltlen = TYPE_LENGTH (elttype); - len = TYPE_LENGTH (type) / eltlen; + len = TYPE_LENGTH (type) / TYPE_LENGTH (elttype); if (options->prettyprint_arrays) print_spaces_filtered (2 + 2 * recurse, stream); /* For an array of chars, print with string syntax. */ - if (eltlen == 1 && + if (TYPE_LENGTH (elttype) == 1 && ((TYPE_CODE (elttype) == TYPE_CODE_INT) || ((current_language->la_language == language_m2) && (TYPE_CODE (elttype) == TYPE_CODE_CHAR))) @@ -339,7 +336,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, elements up to it. */ if (options->stop_print_at_null) { - unsigned int temp_len; + ULONGEST temp_len; /* Look for a NULL char. */ for (temp_len = 0; diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index d504eb3..50d08a9 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -696,7 +696,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, CORE_ADDR regval; gdb_byte *val; gdb_byte valbuf[MAX_REGISTER_SIZE]; - int len; + ULONGEST len; int odd_sized_struct; /* First force sp to a 4-byte alignment. */ @@ -791,7 +791,7 @@ m32r_extract_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); ULONGEST tmp; /* By using store_unsigned_integer we avoid having to do diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 1215de8..e9c3ee9 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1174,7 +1174,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int first_stack_argnum; struct type *type; char *val; - int len; + ULONGEST len; char buf[2]; first_stack_argnum = 0; @@ -1266,7 +1266,7 @@ static void m68hc11_store_return_value (struct type *type, struct regcache *regcache, const void *valbuf) { - int len; + ULONGEST len; len = TYPE_LENGTH (type); diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index ee72026..a219c72 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -292,7 +292,7 @@ static void m68k_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); gdb_byte buf[M68K_MAX_REGISTER_SIZE]; if (len <= 4) @@ -308,14 +308,14 @@ m68k_extract_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Cannot extract return value of %d bytes long."), len); + _("Cannot extract return value of %s bytes long."), + pulongest (len)); } static void m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); gdb_byte buf[M68K_MAX_REGISTER_SIZE]; struct gdbarch *gdbarch = get_regcache_arch (regcache); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -326,7 +326,7 @@ m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache, regcache_raw_read (regcache, M68K_FP0_REGNUM, buf); convert_typed_floating (buf, fpreg_type, valbuf, type); } - else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4) + else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4) regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf); else m68k_extract_return_value (type, regcache, valbuf); @@ -338,7 +338,7 @@ static void m68k_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len <= 4) regcache_raw_write_part (regcache, M68K_D0_REGNUM, 4 - len, len, valbuf); @@ -350,14 +350,14 @@ m68k_store_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Cannot store return value of %d bytes long."), len); + _("Cannot store return value of %s bytes long."), + pulongest (len)); } static void m68k_svr4_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); struct gdbarch *gdbarch = get_regcache_arch (regcache); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -368,7 +368,7 @@ m68k_svr4_store_return_value (struct type *type, struct regcache *regcache, convert_typed_floating (valbuf, type, buf, fpreg_type); regcache_raw_write (regcache, M68K_FP0_REGNUM, buf); } - else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4) + else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4) { regcache_raw_write (regcache, M68K_A0_REGNUM, valbuf); regcache_raw_write (regcache, M68K_D0_REGNUM, valbuf); @@ -515,9 +515,9 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); - int len = TYPE_LENGTH (value_type); - int container_len = (len + 3) & ~3; - int offset; + ULONGEST len = TYPE_LENGTH (value_type); + ULONGEST container_len = (len + 3) & ~3; + ULONGEST offset; /* Non-scalars bigger than 4 bytes are left aligned, others are right aligned. */ diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c index 1fda594..133be43 100644 --- a/gdb/m88k-tdep.c +++ b/gdb/m88k-tdep.c @@ -259,14 +259,14 @@ m88k_store_arguments (struct regcache *regcache, int nargs, struct value **args, CORE_ADDR sp) { struct gdbarch *gdbarch = get_regcache_arch (regcache); - int num_register_words = 0; - int num_stack_words = 0; + ULONGEST num_register_words = 0; + ULONGEST num_stack_words = 0; int i; for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (m88k_integral_or_pointer_p (type) && len < 4) { @@ -387,7 +387,7 @@ m88k_return_value (struct gdbarch *gdbarch, struct type *func_type, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); gdb_byte buf[8]; if (!m88k_integral_or_pointer_p (type) && !m88k_floating_p (type)) diff --git a/gdb/memrange.c b/gdb/memrange.c index ed41b9a..a655dd5 100644 --- a/gdb/memrange.c +++ b/gdb/memrange.c @@ -21,8 +21,8 @@ #include "memrange.h" int -mem_ranges_overlap (CORE_ADDR start1, int len1, - CORE_ADDR start2, int len2) +mem_ranges_overlap (CORE_ADDR start1, ULONGEST len1, + CORE_ADDR start2, ULONGEST len2) { ULONGEST h, l; diff --git a/gdb/memrange.h b/gdb/memrange.h index 926af22..e07b962 100644 --- a/gdb/memrange.h +++ b/gdb/memrange.h @@ -30,7 +30,7 @@ struct mem_range CORE_ADDR start; /* Length of the range. */ - int length; + ULONGEST length; }; typedef struct mem_range mem_range_s; @@ -40,8 +40,8 @@ DEF_VEC_O(mem_range_s); /* Returns true if the ranges defined by [start1, start1+len1) and [start2, start2+len2) overlap. */ -extern int mem_ranges_overlap (CORE_ADDR start1, int len1, - CORE_ADDR start2, int len2); +extern int mem_ranges_overlap (CORE_ADDR start1, ULONGEST len1, + CORE_ADDR start2, ULONGEST len2); /* Sort ranges by start address, then coalesce contiguous or overlapping ranges. */ diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index fea14bf..287ef25 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -2279,7 +2279,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv, for (i = 0; i < argc; i++) { - unsigned arg_len = TYPE_LENGTH (value_type (argv[i])); + ULONGEST arg_len = TYPE_LENGTH (value_type (argv[i])); if (arg_len > MEP_GPR_SIZE) { @@ -2337,7 +2337,7 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < argc; i++) { - unsigned arg_size = TYPE_LENGTH (value_type (argv[i])); + ULONGEST arg_size = TYPE_LENGTH (value_type (argv[i])); ULONGEST value; /* Arguments that fit in a GPR get expanded to fill the GPR. */ diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 3ce3d1c..b33c556 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -591,7 +591,7 @@ static void microblaze_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + int ULONGEST len = TYPE_LENGTH (type); gdb_byte buf[8]; memset (buf, 0, sizeof(buf)); diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 9a3c7fb..8c4440d 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -302,7 +302,7 @@ static void mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, int reg_num, int length, enum bfd_endian endian, gdb_byte *in, - const gdb_byte *out, int buf_offset) + const gdb_byte *out, LONGEST buf_offset) { int reg_offset = 0; @@ -325,8 +325,8 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, } if (mips_debug) fprintf_unfiltered (gdb_stderr, - "xfer $%d, reg offset %d, buf offset %d, length %d, ", - reg_num, reg_offset, buf_offset, length); + "xfer $%d, reg offset %d, buf offset %s, length %d, ", + reg_num, reg_offset, plongest (buf_offset), length); if (mips_debug && out != NULL) { int i; @@ -3078,13 +3078,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (arg_type); + ULONGEST len = TYPE_LENGTH (arg_type); enum type_code typecode = TYPE_CODE (arg_type); if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_eabi_push_dummy_call: %d len=%d type=%d", - argnum + 1, len, (int) typecode); + "mips_eabi_push_dummy_call: %d len=%s type=%d", + argnum + 1, pulongest (len), (int) typecode); /* Function pointer arguments to mips16 code need to be made into mips16 pointers. */ @@ -3369,7 +3369,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct type *func_type, static int mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, - int offset) + LONGEST offset) { int i; @@ -3384,7 +3384,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, for (i = 0; i < TYPE_NFIELDS (arg_type); i++) { - int pos; + LONGEST pos; struct type *field_type; /* We're only looking at normal fields. */ @@ -3778,11 +3778,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type, : MIPS_V0_REGNUM); field < TYPE_NFIELDS (type); field++, regnum += 2) { - int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) - / TARGET_CHAR_BIT); + LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) + / TARGET_CHAR_BIT); if (mips_debug) - fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", - offset); + fprintf_unfiltered (gdb_stderr, "Return float struct+%s\n", + plongest (offset)); if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) { /* A 16-byte long double field goes in two consecutive @@ -3869,7 +3869,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; - int len = 0; + ULONGEST len = 0; int stack_offset = 0; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -3896,13 +3896,12 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { struct type *arg_type = check_typedef (value_type (args[argnum])); - int arglen = TYPE_LENGTH (arg_type); /* Align to double-word if necessary. */ if (mips_type_needs_double_align (arg_type)) len = align_up (len, MIPS32_REGSIZE * 2); /* Allocate space on the stack. */ - len += align_up (arglen, MIPS32_REGSIZE); + len += align_up (TYPE_LENGTH (arg_type), MIPS32_REGSIZE); } sp -= align_up (len, 16); @@ -3935,13 +3934,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (arg_type); + ULONGEST len = TYPE_LENGTH (arg_type); enum type_code typecode = TYPE_CODE (arg_type); if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o32_push_dummy_call: %d len=%d type=%d", - argnum + 1, len, (int) typecode); + "mips_o32_push_dummy_call: %d len=%s type=%d", + argnum + 1, pulongest (len), (int) typecode); val = value_contents (arg); @@ -4337,8 +4336,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; - int len = 0; - int stack_offset = 0; + ULONGEST len = 0; + ULONGEST stack_offset = 0; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); @@ -4364,10 +4363,9 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { struct type *arg_type = check_typedef (value_type (args[argnum])); - int arglen = TYPE_LENGTH (arg_type); /* Allocate space on the stack. */ - len += align_up (arglen, MIPS64_REGSIZE); + len += align_up (TYPE_LENGTH (arg_type), MIPS64_REGSIZE); } sp -= align_up (len, 16); @@ -4401,13 +4399,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (arg_type); + ULONGEST len = TYPE_LENGTH (arg_type); enum type_code typecode = TYPE_CODE (arg_type); if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o64_push_dummy_call: %d len=%d type=%d", - argnum + 1, len, (int) typecode); + "mips_o64_push_dummy_call: %d len=%s type=%d", + argnum + 1, pulongest (len), (int) typecode); val = value_contents (arg); diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 116a03e..ee68407 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -83,10 +83,11 @@ struct mn10300_prologue /* Compute the alignment required by a type. */ -static int +static ULONGEST mn10300_type_align (struct type *type) { - int i, align = 1; + int i; + ULONGEST align = 1; switch (TYPE_CODE (type)) { @@ -108,7 +109,7 @@ mn10300_type_align (struct type *type) case TYPE_CODE_UNION: for (i = 0; i < TYPE_NFIELDS (type); i++) { - int falign = mn10300_type_align (TYPE_FIELD_TYPE (type, i)); + ULONGEST falign = mn10300_type_align (TYPE_FIELD_TYPE (type, i)); while (align < falign) align <<= 1; } @@ -1228,7 +1229,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); const int push_size = register_size (gdbarch, E_PC_REGNUM); int regs_used; - int len, arg_len; + ULONGEST len, arg_len; int stack_offset = 0; int argnum; char *val, valbuf[MAX_REGISTER_SIZE]; diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c index 1f5f33f..43e2e69 100644 --- a/gdb/moxie-tdep.c +++ b/gdb/moxie-tdep.c @@ -124,7 +124,7 @@ moxie_store_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR regval; - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); /* Things always get returned in RET1_REGNUM, RET2_REGNUM. */ regval = extract_unsigned_integer (valbuf, len > 4 ? 4 : len, byte_order); @@ -321,7 +321,7 @@ moxie_extract_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); ULONGEST tmp; /* By using store_unsigned_integer we avoid having to do diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c index 268be86..fa277f4 100644 --- a/gdb/mt-tdep.c +++ b/gdb/mt-tdep.c @@ -783,9 +783,9 @@ mt_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte buf[MT_MAX_STRUCT_SIZE]; int argreg = MT_1ST_ARGREG; int split_param_len = 0; - int stack_dest = sp; + ULONGEST stack_dest = sp; int slacklen; - int typelen; + ULONGEST typelen; int i, j; /* First handle however many args we can fit into MT_1ST_ARGREG thru diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 15bf792..f0462f8 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -347,7 +347,7 @@ objc_printchar (int c, struct type *type, struct ui_file *stream) static void objc_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index 54075a4..ef74f48 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -80,11 +80,11 @@ builtin_opencl_type (struct gdbarch *gdbarch) static struct type * lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code, - unsigned int el_length, unsigned int flag_unsigned, + ULONGEST el_length, unsigned int flag_unsigned, int n) { int i; - unsigned int length; + ULONGEST length; struct type *type = NULL; struct type **types = builtin_opencl_type (gdbarch); @@ -174,9 +174,9 @@ lval_func_read (struct value *v) struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); struct type *type = check_typedef (value_type (v)); struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); - int offset = value_offset (v); - int elsize = TYPE_LENGTH (eltype); - int n, i, j = 0; + LONGEST offset = value_offset (v); + ULONGEST elsize = TYPE_LENGTH (eltype); + LONGEST n, i, j = 0; LONGEST lowb = 0; LONGEST highb = 0; @@ -203,9 +203,9 @@ lval_func_write (struct value *v, struct value *fromval) struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); struct type *type = check_typedef (value_type (v)); struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); - int offset = value_offset (v); - int elsize = TYPE_LENGTH (eltype); - int n, i, j = 0; + LONGEST offset = value_offset (v); + ULONGEST elsize = TYPE_LENGTH (eltype); + LONGEST n, i, j = 0; LONGEST lowb = 0; LONGEST highb = 0; @@ -243,17 +243,18 @@ lval_func_write (struct value *v, struct value *fromval) /* Return nonzero if all bits in V within OFFSET and LENGTH are valid. */ static int -lval_func_check_validity (const struct value *v, int offset, int length) +lval_func_check_validity (const struct value *v, LONGEST offset, + ULONGEST length) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); /* Size of the target type in bits. */ - int elsize = - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; + ULONGEST elsize = + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; int startrest = offset % elsize; - int start = offset / elsize; + LONGEST start = offset / elsize; int endrest = (offset + length) % elsize; - int end = (offset + length) / elsize; - int i; + LONGEST end = (offset + length) / elsize; + LONGEST i; if (endrest) end++; @@ -281,8 +282,8 @@ lval_func_check_any_valid (const struct value *v) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); /* Size of the target type in bits. */ - int elsize = - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; + ULONGEST elsize = + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; int i; for (i = 0; i < c->n; i++) @@ -297,17 +298,17 @@ lval_func_check_any_valid (const struct value *v) static int lval_func_check_synthetic_pointer (const struct value *v, - int offset, int length) + LONGEST offset, ULONGEST length) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); /* Size of the target type in bits. */ - int elsize = - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; + ULONGEST elsize = + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; int startrest = offset % elsize; - int start = offset / elsize; + LONGEST start = offset / elsize; int endrest = (offset + length) % elsize; - int end = (offset + length) / elsize; - int i; + LONGEST end = (offset + length) / elsize; + LONGEST i; if (endrest) end++; diff --git a/gdb/p-lang.c b/gdb/p-lang.c index c59ba0b..94f4ad6 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -96,8 +96,8 @@ pascal_main_name (void) are not multiple of TARGET_CHAR_BIT then the results are wrong but this does not happen for Free Pascal nor for GPC. */ int -is_pascal_string_type (struct type *type,int *length_pos, - int *length_size, int *string_pos, +is_pascal_string_type (struct type *type, LONGEST *length_pos, + ULONGEST *length_size, LONGEST *string_pos, struct type **char_type, const char **arrayname) { @@ -217,7 +217,7 @@ pascal_printchar (int c, struct type *type, struct ui_file *stream) void pascal_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { diff --git a/gdb/p-lang.h b/gdb/p-lang.h index b1e218c..32abab2 100644 --- a/gdb/p-lang.h +++ b/gdb/p-lang.h @@ -35,7 +35,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *, extern void pascal_print_typedef (struct type *, struct symbol *, struct ui_file *); -extern void pascal_val_print (struct type *, const gdb_byte *, int, +extern void pascal_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -49,13 +49,13 @@ extern void pascal_type_print_method_args (const char *, const char *, /* These are in p-lang.c: */ extern int - is_pascal_string_type (struct type *, int *, int *, int *, + is_pascal_string_type (struct type *, LONGEST *, ULONGEST *, LONGEST *, struct type **, const char **); extern void pascal_printchar (int, struct type *, struct ui_file *); extern void pascal_printstr (struct ui_file *, struct type *, const gdb_byte *, - unsigned int, const char *, int, + ULONGEST, const char *, int, const struct value_print_options *); extern struct type **const (pascal_builtin_types[]); @@ -69,7 +69,7 @@ extern void pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int); extern void pascal_object_print_value_fields (struct type *, const gdb_byte *, - int, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index a00f5b3..828b0ce 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -442,7 +442,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, { int i; int len; - int lastval; + LONGEST lastval; enum { s_none, s_public, s_private, s_protected diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index d6373ae..807f396 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -58,7 +58,7 @@ static const struct generic_val_print_decorations p_decorations = void pascal_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -69,8 +69,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, unsigned len; LONGEST low_bound, high_bound; struct type *elttype; - unsigned eltlen; - int length_pos, length_size, string_pos; + ULONGEST eltlen; + LONGEST length_pos, string_pos; + ULONGEST length_size; struct type *char_type; LONGEST val; CORE_ADDR addr; @@ -464,7 +465,7 @@ static void pascal_object_print_static_field (struct value *, const struct value_print_options *); static void pascal_object_print_value (struct type *, const gdb_byte *, - int, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -523,7 +524,7 @@ pascal_object_is_vtbl_member (struct type *type) void pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -718,7 +719,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, static void pascal_object_print_value (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -741,11 +742,11 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr, for (i = 0; i < n_baseclasses; i++) { - int boffset = 0; + LONGEST boffset = 0; struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); const char *basename = type_name_no_tag (baseclass); const gdb_byte *base_valaddr = NULL; - int thisoffset; + LONGEST thisoffset; volatile struct gdb_exception ex; int skip = 0; diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 9bd11fd..ca58089 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -1927,7 +1927,7 @@ num_memory_accesses (struct value *v) of the constant. */ static int check_condition (CORE_ADDR watch_addr, struct expression *cond, - CORE_ADDR *data_value, int *len) + CORE_ADDR *data_value, ULONGEST *len) { int pc = 1, num_accesses_left, num_accesses_right; struct value *left_val, *right_val, *left_chain, *right_chain; diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index 20598d0..8623c14 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -100,9 +100,9 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Next available vector register for vector arguments. */ int vreg = 2; /* Arguments start above the "LR save word" and "Back chain". */ - int argoffset = 2 * tdep->wordsize; + ULONGEST argoffset = 2 * tdep->wordsize; /* Structures start after the arguments. */ - int structoffset = argoffset + argspace; + ULONGEST structoffset = argoffset + argspace; /* If the function is returning a `struct', then the first word (which will be passed in r3) is used for struct return @@ -121,7 +121,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[argno]; struct type *type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); const bfd_byte *val = value_contents (arg); if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8 @@ -353,7 +353,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* OpenCL vectors shorter than 16 bytes are passed as if a series of independent scalars. */ struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); - int i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); + ULONGEST i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); for (i = 0; i < nelt; i++) { @@ -841,11 +841,11 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, && opencl_abi) { struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); - int i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); + ULONGEST i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); for (i = 0; i < nelt; i++) { - int offset = i * TYPE_LENGTH (eltype); + ULONGEST offset = i * TYPE_LENGTH (eltype); if (TYPE_CODE (eltype) == TYPE_CODE_FLT) { @@ -1591,7 +1591,7 @@ ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, register. Work around this by always writing the value to memory. Fortunately, doing this simplifies the code. */ - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len < tdep->wordsize) write_memory (gparam + tdep->wordsize - len, val, len); else @@ -1840,12 +1840,12 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *func_type, && TYPE_LENGTH (valtype) >= 16 && opencl_abi) { - int n_regs = TYPE_LENGTH (valtype) / 16; - int i; + ULONGEST n_regs = TYPE_LENGTH (valtype) / 16; + ULONGEST i; for (i = 0; i < n_regs; i++) { - int offset = i * 16; + ULONGEST offset = i * 16; int regnum = tdep->ppc_vr0_regnum + 2 + i; if (writebuf != NULL) diff --git a/gdb/printcmd.c b/gdb/printcmd.c index d441dfe..639bc97 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -296,7 +296,7 @@ print_formatted (struct value *val, int size, struct ui_file *stream) { struct type *type = check_typedef (value_type (val)); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (VALUE_LVAL (val) == lval_memory) next_address = value_address (val) + len; @@ -352,7 +352,7 @@ float_type_from_length (struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); const struct builtin_type *builtin = builtin_type (gdbarch); - unsigned int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len == TYPE_LENGTH (builtin->builtin_float)) type = builtin->builtin_float; @@ -375,7 +375,7 @@ print_scalar_formatted (const void *valaddr, struct type *type, { struct gdbarch *gdbarch = get_type_arch (type); LONGEST val_long = 0; - unsigned int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* String printing should go through val_print_scalar_formatted. */ diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index 86d4f2c..1ceb23b 100644 --- a/gdb/python/py-prettyprint.c +++ b/gdb/python/py-prettyprint.c @@ -676,7 +676,7 @@ print_children (PyObject *printer, const char *hint, int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -824,7 +824,7 @@ gdbpy_default_visualizer (PyObject *self, PyObject *args) int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, diff --git a/gdb/python/python.h b/gdb/python/python.h index dd7066f..2a57409 100644 --- a/gdb/python/python.h +++ b/gdb/python/python.h @@ -31,7 +31,7 @@ void eval_python_from_control_command (struct command_line *); void source_python_script (FILE *file, const char *filename); int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, diff --git a/gdb/regcache.c b/gdb/regcache.c index c716280..12ed8fa 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -902,7 +902,7 @@ typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum, static enum register_status regcache_xfer_part (struct regcache *regcache, int regnum, - int offset, int len, void *in, const void *out, + LONGEST offset, int len, void *in, const void *out, enum register_status (*read) (struct regcache *regcache, int regnum, gdb_byte *buf), @@ -968,7 +968,7 @@ regcache_raw_write_part (struct regcache *regcache, int regnum, enum register_status regcache_cooked_read_part (struct regcache *regcache, int regnum, - int offset, int len, gdb_byte *buf) + LONGEST offset, int len, gdb_byte *buf) { struct regcache_descr *descr = regcache->descr; @@ -979,7 +979,7 @@ regcache_cooked_read_part (struct regcache *regcache, int regnum, void regcache_cooked_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf) + LONGEST offset, int len, const gdb_byte *buf) { struct regcache_descr *descr = regcache->descr; diff --git a/gdb/regcache.h b/gdb/regcache.h index 93b4499..81ccda6 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -129,10 +129,10 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache, write style operations. */ enum register_status regcache_cooked_read_part (struct regcache *regcache, - int regnum, int offset, + int regnum, LONGEST offset, int len, gdb_byte *buf); void regcache_cooked_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf); + LONGEST offset, int len, const gdb_byte *buf); /* Special routines to read/write the PC. */ diff --git a/gdb/remote.c b/gdb/remote.c index 68864d1..995afe7 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -6450,7 +6450,7 @@ check_binary_download (CORE_ADDR addr) static int remote_write_bytes_aux (const char *header, CORE_ADDR memaddr, - const gdb_byte *myaddr, int len, + const gdb_byte *myaddr, LONGEST len, char packet_format, int use_length) { struct remote_state *rs = get_remote_state (); @@ -6611,7 +6611,7 @@ remote_write_bytes_aux (const char *header, CORE_ADDR memaddr, error. Only transfer a single packet. */ static int -remote_write_bytes (CORE_ADDR memaddr, const gdb_byte *myaddr, int len) +remote_write_bytes (CORE_ADDR memaddr, const gdb_byte *myaddr, LONGEST len) { char *packet_format = 0; @@ -8034,7 +8034,7 @@ int remote_hw_watchpoint_length_limit = -1; int remote_hw_breakpoint_limit = -1; static int -remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { if (remote_hw_watchpoint_length_limit == 0) return 0; diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c index 7a84769..a8b3f6a 100644 --- a/gdb/rl78-tdep.c +++ b/gdb/rl78-tdep.c @@ -1019,9 +1019,8 @@ rl78_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); - int len = TYPE_LENGTH (value_type); - int container_len = (len + 1) & ~1; - int offset; + ULONGEST len = TYPE_LENGTH (value_type); + ULONGEST container_len = (len + 1) & ~1; sp -= container_len; write_memory (rl78_make_data_address (sp), diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c index 5531326..0df6483 100644 --- a/gdb/rs6000-aix-tdep.c +++ b/gdb/rs6000-aix-tdep.c @@ -197,7 +197,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int ii; - int len = 0; + ULONGEST len = 0; int argno; /* current argument number */ int argbytes; /* current argument byte */ gdb_byte tmp_buffer[50]; @@ -327,7 +327,7 @@ ran_out_of_registers_for_arguments: if ((argno < nargs) || argbytes) { - int space = 0, jj; + ULONGEST space = 0, jj; if (argbytes) { diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 038a3ce..7ff02ac 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -376,9 +376,9 @@ s390_value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct value *value = default_value_from_register (type, regnum, frame); - int len = TYPE_LENGTH (check_typedef (type)); - if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM && len < 8) + if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM && + TYPE_LENGTH (check_typedef (type))< 8) set_value_offset (value, 0); return value; @@ -2490,8 +2490,7 @@ is_power_of_two (unsigned int n) static int s390_function_arg_pass_by_reference (struct type *type) { - unsigned length = TYPE_LENGTH (type); - if (length > 8) + if (TYPE_LENGTH (type) > 8) return 1; return (is_struct_like (type) && !is_power_of_two (TYPE_LENGTH (type))) @@ -2504,8 +2503,7 @@ s390_function_arg_pass_by_reference (struct type *type) static int s390_function_arg_float (struct type *type) { - unsigned length = TYPE_LENGTH (type); - if (length > 8) + if (TYPE_LENGTH (type) > 8) return 0; return is_float_like (type); @@ -2617,11 +2615,10 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); - unsigned length = TYPE_LENGTH (type); if (s390_function_arg_pass_by_reference (type)) { - sp -= length; + sp -= TYPE_LENGTH (type); sp = align_down (sp, alignment_of (type)); copy_addr[i] = sp; } @@ -2670,7 +2667,7 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); - unsigned length = TYPE_LENGTH (type); + ULONGEST length = TYPE_LENGTH (type); if (s390_function_arg_pass_by_reference (type)) { @@ -2800,8 +2797,7 @@ s390_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) static enum return_value_convention s390_return_value_convention (struct gdbarch *gdbarch, struct type *type) { - int length = TYPE_LENGTH (type); - if (length > 8) + if (TYPE_LENGTH (type) > 8) return RETURN_VALUE_STRUCT_CONVENTION; switch (TYPE_CODE (type)) @@ -2825,7 +2821,7 @@ s390_return_value (struct gdbarch *gdbarch, struct type *func_type, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int word_size = gdbarch_ptr_bit (gdbarch) / 8; enum return_value_convention rvc; - int length; + ULONGEST length; type = check_typedef (type); rvc = s390_return_value_convention (gdbarch, type); diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c index 90ef610..530f876 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -516,7 +516,7 @@ score_push_dummy_call (struct gdbarch *gdbarch, struct value *function, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argnum; int argreg; - int arglen = 0; + ULONGEST arglen = 0; CORE_ADDR stack_offset = 0; CORE_ADDR addr = 0; diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 7f15191..73822b2 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -1308,7 +1308,7 @@ sh_extract_return_value_nofpu (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); int return_register = R0_REGNUM; int offset; @@ -1362,7 +1362,7 @@ sh_store_return_value_nofpu (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len <= 4) { diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index 2e5d8bd..181892c 100644 --- a/gdb/sh64-tdep.c +++ b/gdb/sh64-tdep.c @@ -1059,7 +1059,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int stack_offset, stack_alloc; + ULONGEST stack_offset, stack_alloc; int int_argreg; int float_argreg; int double_argreg; @@ -1071,7 +1071,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, char *val; char valbuf[8]; char valbuf_tmp[8]; - int len; + ULONGEST len; int argreg_size; int fp_args[12]; @@ -1230,7 +1230,7 @@ sh64_extract_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_FLT) { @@ -1292,7 +1292,7 @@ sh64_store_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); char buf[64]; /* more than enough... */ - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_FLT) { diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 00bca01..fb363d5 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -470,7 +470,7 @@ sparc32_store_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (sparc_structure_or_union_p (type) || (sparc_floating_p (type) && len == 16) diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index f30022e..a9a2935 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -639,7 +639,8 @@ sparc64_16_byte_align_p (struct type *type) static void sparc64_store_floating_fields (struct regcache *regcache, struct type *type, - const gdb_byte *valbuf, int element, int bitpos) + const gdb_byte *valbuf, int element, + LONGEST bitpos) { int len = TYPE_LENGTH (type); @@ -681,7 +682,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); sparc64_store_floating_fields (regcache, subtype, valbuf, element, subpos); @@ -713,7 +714,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, static void sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, - gdb_byte *valbuf, int bitpos) + gdb_byte *valbuf, LONGEST bitpos) { if (sparc64_floating_p (type)) { @@ -750,7 +751,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos); } @@ -783,7 +784,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (sparc64_structure_or_union_p (type) || (sparc64_complex_floating_p (type) && len == 32)) diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index 78ba007..76db368 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -316,7 +316,7 @@ spu_value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct value *value = default_value_from_register (type, regnum, frame); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (regnum < SPU_NUM_GPRS && len < 16) { diff --git a/gdb/stack.c b/gdb/stack.c index bbd6b7f..54e200d 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -354,7 +354,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame, if (val && entryval && !ui_out_is_mi_like_p (current_uiout)) { - unsigned len = TYPE_LENGTH (value_type (val)); + ULONGEST len = TYPE_LENGTH (value_type (val)); if (!value_optimized_out (val) && value_lazy (val)) value_fetch_lazy (val); @@ -373,7 +373,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame, TRY_CATCH (except, RETURN_MASK_ERROR) { - unsigned len_deref; + ULONGEST len_deref; val_deref = coerce_ref (val); if (value_lazy (val_deref)) @@ -532,8 +532,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame, case LOC_ARG: case LOC_REF_ARG: { - long current_offset = SYMBOL_VALUE (sym); - int arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); + LONGEST current_offset = SYMBOL_VALUE (sym); + ULONGEST arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); /* Compute address of next argument by adding the size of this argument and rounding to an int boundary. */ diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c index 91125e1..a3c15d0 100644 --- a/gdb/symfile-mem.c +++ b/gdb/symfile-mem.c @@ -55,6 +55,11 @@ #include "auxv.h" #include "elf/common.h" +static int symfile_target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, + int len) +{ + return target_read_memory (memaddr, myaddr, len); +} /* Read inferior memory at ADDR to find the header of a loaded object file and read its in-core symbols out of inferior memory. TEMPL is a bfd @@ -77,7 +82,7 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, char *name, error (_("add-symbol-file-from-memory not supported for this target")); nbfd = bfd_elf_bfd_from_remote_memory (templ, addr, &loadbase, - target_read_memory); + symfile_target_read_memory); if (nbfd == NULL) error (_("Failed to read a valid object file image from memory.")); diff --git a/gdb/symmisc.c b/gdb/symmisc.c index b0ab29b..d5fdd92 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -516,11 +516,11 @@ print_symbol (void *args) case LOC_CONST_BYTES: { - unsigned i; + ULONGEST i; struct type *type = check_typedef (SYMBOL_TYPE (symbol)); - fprintf_filtered (outfile, "const %u hex bytes:", - TYPE_LENGTH (type)); + fprintf_filtered (outfile, "const %s hex bytes:", + pulongest (TYPE_LENGTH (type))); for (i = 0; i < TYPE_LENGTH (type); i++) fprintf_filtered (outfile, " %02x", (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]); diff --git a/gdb/target.c b/gdb/target.c index cffea2c..bc7c238 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -52,7 +52,7 @@ static void default_terminal_info (char *, int); static int default_watchpoint_addr_within_range (struct target_ops *, CORE_ADDR, CORE_ADDR, int); -static int default_region_ok_for_hw_watchpoint (CORE_ADDR, int); +static int default_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); static void tcomplain (void) ATTRIBUTE_NORETURN; @@ -128,7 +128,7 @@ static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); static int debug_to_watchpoint_addr_within_range (struct target_ops *, CORE_ADDR, CORE_ADDR, int); -static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, int); +static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, int, int, struct expression *); @@ -1757,7 +1757,7 @@ target_xfer_partial (struct target_ops *ops, it makes no progress, and then return how much was transferred). */ int -target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len) +target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len) { /* Dispatch to the topmost target, not the flattened current_target. Memory accesses check target->to_has_(all_)memory, and the @@ -1773,7 +1773,7 @@ target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len) the target's stack. This may trigger different cache behavior. */ int -target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len) +target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len) { /* Dispatch to the topmost target, not the flattened current_target. Memory accesses check target->to_has_(all_)memory, and the @@ -1792,7 +1792,7 @@ target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len) Callers that can deal with partial writes should call target_write. */ int -target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len) +target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, LONGEST len) { /* Dispatch to the topmost target, not the flattened current_target. Memory accesses check target->to_has_(all_)memory, and the @@ -1811,7 +1811,8 @@ target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len) should call target_write. */ int -target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len) +target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, + LONGEST len) { /* Dispatch to the topmost target, not the flattened current_target. Memory accesses check target->to_has_(all_)memory, and the @@ -3543,7 +3544,7 @@ target_fileio_read_stralloc (const char *filename) static int -default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +default_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { return (len <= gdbarch_ptr_bit (target_gdbarch) / TARGET_CHAR_BIT); } @@ -4217,7 +4218,7 @@ debug_to_can_use_hw_breakpoint (int type, int cnt, int from_tty) } static int -debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { CORE_ADDR retval; diff --git a/gdb/target.h b/gdb/target.h index 50a0ea6..a76f785 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -478,7 +478,7 @@ struct target_ops /* Documentation of this routine is provided with the corresponding target_* macro. */ - int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, int); + int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, LONGEST); int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int, struct expression *); @@ -996,15 +996,17 @@ extern void target_dcache_invalidate (void); extern int target_read_string (CORE_ADDR, char **, int, int *); -extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len); +extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, + LONGEST len); -extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len); +extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, + LONGEST len); extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, - int len); + LONGEST len); extern int target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, - int len); + LONGEST len); /* Fetches the target's memory map. If one is found it is sorted and returned, after some consistency checking. Otherwise, NULL diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 6e47a0a..42af6bc 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -967,7 +967,7 @@ collect_symbol (struct collection_list *collect, long frame_regno, long frame_offset, CORE_ADDR scope) { - unsigned long len; + ULONGEST len; unsigned int reg; bfd_signed_vma offset; int treat_as_expr = 0; @@ -1448,7 +1448,8 @@ encode_actions_1 (struct command_line *action, } else { - unsigned long addr, len; + CORE_ADDR addr; + ULONGEST len; struct cleanup *old_chain = NULL; struct cleanup *old_chain1 = NULL; @@ -2613,7 +2614,8 @@ scope_info (char *args, int from_tty) const char *symname; char *save_args = args; struct dict_iterator iter; - int j, count = 0; + int count = 0; + ULONGEST j; struct gdbarch *gdbarch; int regno; @@ -2743,8 +2745,10 @@ scope_info (char *args, int from_tty) break; } if (SYMBOL_TYPE (sym)) - printf_filtered (", length %d.\n", - TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)))); + { + ULONGEST len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))); + printf_filtered (", length %s.\n", pulongest (len)); + } } if (BLOCK_FUNCTION (block)) break; diff --git a/gdb/typeprint.c b/gdb/typeprint.c index c25e705..4bbf8a7 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -118,7 +118,7 @@ whatis_exp (char *exp, int show) struct type *real_type = NULL; struct type *type; int full = 0; - int top = -1; + LONGEST top = -1; int using_enc = 0; struct value_print_options opts; diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 240a154..8cbf3b3 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -810,7 +810,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argreg; int argnum; - int len = 0; + ULONGEST len = 0; int stack_offset; /* The offset onto the stack at which we will start copying parameters @@ -891,7 +891,7 @@ v850_extract_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= v850_reg_size) { @@ -918,7 +918,7 @@ v850_store_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len <= v850_reg_size) regcache_cooked_write_unsigned diff --git a/gdb/valarith.c b/gdb/valarith.c index a17c91a..16e760d 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -196,8 +196,8 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) { struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); - unsigned int elt_size = TYPE_LENGTH (elt_type); - unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound); + ULONGEST elt_size = TYPE_LENGTH (elt_type); + ULONGEST elt_offs = elt_size * (index - lowerbound); struct value *v; if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) @@ -1474,7 +1474,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) int value_logical_not (struct value *arg1) { - int len; + LONGEST len; const gdb_byte *p; struct type *type1; @@ -1505,8 +1505,8 @@ value_logical_not (struct value *arg1) static int value_strcmp (struct value *arg1, struct value *arg2) { - int len1 = TYPE_LENGTH (value_type (arg1)); - int len2 = TYPE_LENGTH (value_type (arg2)); + LONGEST len1 = TYPE_LENGTH (value_type (arg1)); + LONGEST len2 = TYPE_LENGTH (value_type (arg2)); const gdb_byte *s1 = value_contents (arg1); const gdb_byte *s2 = value_contents (arg2); int i, len = len1 < len2 ? len1 : len2; diff --git a/gdb/valops.c b/gdb/valops.c index ee450e3..5018864 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -53,11 +53,11 @@ static int typecmp (int staticp, int varargs, int nargs, struct field t1[], struct value *t2[]); static struct value *search_struct_field (const char *, struct value *, - int, struct type *, int); + LONGEST, struct type *, int); static struct value *search_struct_method (const char *, struct value **, struct value **, - int, int *, struct type *); + LONGEST, int *, struct type *); static int find_oload_champ_namespace (struct value **, int, const char *, const char *, @@ -85,7 +85,7 @@ oload_classification classify_oload_match (struct badness_vector *, int, int); static struct value *value_struct_elt_for_reference (struct type *, - int, struct type *, + LONGEST, struct type *, char *, struct type *, int, enum noside); @@ -102,8 +102,8 @@ static CORE_ADDR allocate_space_in_inferior (int); static struct value *cast_into_complex (struct type *, struct value *); static struct fn_field *find_method_list (struct value **, const char *, - int, struct type *, int *, - struct type **, int *); + LONGEST, struct type *, int *, + struct type **, LONGEST *); void _initialize_valops (void); @@ -188,14 +188,14 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) space. */ struct value * -value_allocate_space_in_inferior (int len) +value_allocate_space_in_inferior (ULONGEST len) { struct objfile *objf; struct value *val = find_function_in_inferior ("malloc", &objf); struct gdbarch *gdbarch = get_objfile_arch (objf); struct value *blocklen; - blocklen = value_from_longest (builtin_type (gdbarch)->builtin_int, len); + blocklen = value_from_ulongest (builtin_type (gdbarch)->builtin_int, len); val = call_function_by_hand (val, 1, &blocklen); if (value_logical_not (val)) { @@ -261,7 +261,8 @@ value_cast_structs (struct type *type, struct value *v2) if (TYPE_NAME (t2) != NULL) { /* Try downcasting using the run-time type of the value. */ - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct type *real_type; real_type = value_rtti_type (v2, &full, &top, &using_enc); @@ -396,12 +397,12 @@ value_cast (struct type *type, struct value *arg2) if (code1 == TYPE_CODE_ARRAY) { struct type *element_type = TYPE_TARGET_TYPE (type); - unsigned element_length = TYPE_LENGTH (check_typedef (element_type)); + ULONGEST element_length = TYPE_LENGTH (check_typedef (element_type)); if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) { struct type *range_type = TYPE_INDEX_TYPE (type); - int val_length = TYPE_LENGTH (type2); + ULONGEST val_length = TYPE_LENGTH (type2); LONGEST low_bound, high_bound, new_length; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) @@ -651,7 +652,7 @@ value_reinterpret_cast (struct type *type, struct value *arg) static int dynamic_cast_check_1 (struct type *desired_type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct value *val, struct type *search_type, @@ -663,8 +664,8 @@ dynamic_cast_check_1 (struct type *desired_type, for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) { - int offset = baseclass_offset (search_type, i, valaddr, embedded_offset, - address, val); + LONGEST offset = baseclass_offset (search_type, i, valaddr, + embedded_offset, address, val); if (class_types_same_p (desired_type, TYPE_BASECLASS (search_type, i))) { @@ -698,7 +699,7 @@ dynamic_cast_check_1 (struct type *desired_type, static int dynamic_cast_check_2 (struct type *desired_type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct value *val, struct type *search_type, @@ -708,7 +709,7 @@ dynamic_cast_check_2 (struct type *desired_type, for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) { - int offset; + LONGEST offset; if (! BASETYPE_VIA_PUBLIC (search_type, i)) continue; @@ -739,7 +740,8 @@ dynamic_cast_check_2 (struct type *desired_type, struct value * value_dynamic_cast (struct type *type, struct value *arg) { - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct type *resolved_type = check_typedef (type); struct type *arg_type = check_typedef (value_type (arg)); struct type *class_type, *rtti_type; @@ -990,7 +992,7 @@ value_fetch_lazy (struct value *val) struct value *parent = value_parent (val); LONGEST offset = value_offset (val); LONGEST num; - int length = TYPE_LENGTH (type); + ULONGEST length = TYPE_LENGTH (type); if (!value_bits_valid (val, TARGET_CHAR_BIT * offset + value_bitpos (val), @@ -1012,7 +1014,8 @@ value_fetch_lazy (struct value *val) else if (VALUE_LVAL (val) == lval_memory) { CORE_ADDR addr = value_address (val); - int length = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); + struct type *enclosing_type = value_enclosing_type (val); + ULONGEST length = TYPE_LENGTH (check_typedef (enclosing_type)); if (length) read_value_memory (val, 0, value_stack (val), @@ -1123,7 +1126,7 @@ value_fetch_lazy (struct value *val) void read_value_memory (struct value *val, int embedded_offset, int stack, CORE_ADDR memaddr, - gdb_byte *buffer, size_t length) + gdb_byte *buffer, ULONGEST length) { if (length) { @@ -1256,7 +1259,7 @@ value_assign (struct value *toval, struct value *fromval) { const gdb_byte *dest_buffer; CORE_ADDR changed_addr; - int changed_len; + ULONGEST changed_len; gdb_byte buffer[sizeof (LONGEST)]; if (value_bitsize (toval)) @@ -1329,7 +1332,7 @@ value_assign (struct value *toval, struct value *fromval) if (value_bitsize (toval)) { struct value *parent = value_parent (toval); - int offset = value_offset (parent) + value_offset (toval); + LONGEST offset = value_offset (parent) + value_offset (toval); int changed_len; gdb_byte buffer[sizeof (LONGEST)]; int optim, unavail; @@ -1794,7 +1797,7 @@ value_array (int lowbound, int highbound, struct value **elemvec) { int nelem; int idx; - unsigned int typelength; + ULONGEST typelength; struct value *val; struct type *arraytype; @@ -1985,7 +1988,7 @@ typecmp (int staticp, int varargs, int nargs, fields, look for a baseclass named NAME. */ static struct value * -search_struct_field (const char *name, struct value *arg1, int offset, +search_struct_field (const char *name, struct value *arg1, LONGEST offset, struct type *type, int looking_for_baseclass) { int i; @@ -2043,7 +2046,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, <variant field>. */ struct value *v; - int new_offset = offset; + LONGEST new_offset = offset; /* This is pretty gross. In G++, the offset in an anonymous union is relative to the beginning of the @@ -2080,7 +2083,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, if (BASETYPE_VIA_VIRTUAL (type, i)) { - int boffset; + LONGEST boffset; struct value *v2; boffset = baseclass_offset (type, i, @@ -2144,7 +2147,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, static struct value * search_struct_method (const char *name, struct value **arg1p, - struct value **args, int offset, + struct value **args, LONGEST offset, int *static_memfuncp, struct type *type) { int i; @@ -2208,9 +2211,9 @@ search_struct_method (const char *name, struct value **arg1p, for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { - int base_offset; + LONGEST base_offset; int skip = 0; - int this_offset; + LONGEST this_offset; if (BASETYPE_VIA_VIRTUAL (type, i)) { @@ -2386,8 +2389,8 @@ value_struct_elt (struct value **argp, struct value **args, static struct fn_field * find_method_list (struct value **argp, const char *method, - int offset, struct type *type, int *num_fns, - struct type **basetype, int *boffset) + LONGEST offset, struct type *type, int *num_fns, + struct type **basetype, LONGEST *boffset) { int i; struct fn_field *f; @@ -2420,7 +2423,7 @@ find_method_list (struct value **argp, const char *method, /* Not found in object, check in base subobjects. */ for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { - int base_offset; + LONGEST base_offset; if (BASETYPE_VIA_VIRTUAL (type, i)) { @@ -2456,7 +2459,7 @@ find_method_list (struct value **argp, const char *method, struct fn_field * value_find_oload_method_list (struct value **argp, const char *method, int offset, int *num_fns, - struct type **basetype, int *boffset) + struct type **basetype, LONGEST *boffset) { struct type *t; @@ -2548,7 +2551,7 @@ find_overload_match (struct value **args, int nargs, /* Number of overloaded instances being considered. */ int num_fns = 0; struct type *basetype = NULL; - int boffset; + LONGEST boffset; struct cleanup *all_cleanups = make_cleanup (null_cleanup, NULL); @@ -3255,7 +3258,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) the form "DOMAIN::NAME". */ static struct value * -value_struct_elt_for_reference (struct type *domain, int offset, +value_struct_elt_for_reference (struct type *domain, LONGEST offset, struct type *curtype, char *name, struct type *intype, int want_address, @@ -3292,7 +3295,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, if (want_address) return value_from_longest (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), - offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3)); + offset + (TYPE_FIELD_BITPOS (t, i) >> 3)); else if (noside == EVAL_AVOID_SIDE_EFFECTS) return allocate_value (TYPE_FIELD_TYPE (t, i)); else @@ -3435,7 +3438,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; - int base_offset; + LONGEST base_offset; if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; @@ -3525,7 +3528,7 @@ value_maybe_namespace_elt (const struct type *curtype, struct type * value_rtti_indirect_type (struct value *v, int *full, - int *top, int *using_enc) + LONGEST *top, int *using_enc) { struct value *target; struct type *type, *real_type, *target_type; @@ -3575,12 +3578,12 @@ value_rtti_indirect_type (struct value *v, int *full, struct value * value_full_object (struct value *argp, struct type *rtype, - int xfull, int xtop, + int xfull, LONGEST xtop, int xusing_enc) { struct type *real_type; int full = 0; - int top = -1; + LONGEST top = -1; int using_enc = 0; struct value *new_val; diff --git a/gdb/valprint.c b/gdb/valprint.c index 25b62bc..f5e168a 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -253,7 +253,7 @@ scalar_type_p (struct type *type) int valprint_check_validity (struct ui_file *stream, struct type *type, - int embedded_offset, + LONGEST embedded_offset, const struct value *val) { CHECK_TYPEDEF (type); @@ -317,7 +317,7 @@ val_print_invalid_address (struct ui_file *stream) void generic_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, @@ -680,7 +680,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr, RECURSE. */ void -val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -892,7 +892,7 @@ val_print_type_code_flags (struct type *type, const gdb_byte *valaddr, void val_print_scalar_formatted (struct type *type, - const gdb_byte *valaddr, int embedded_offset, + const gdb_byte *valaddr, LONGEST embedded_offset, const struct value *val, const struct value_print_options *options, int size, @@ -1433,7 +1433,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr, void print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr, - unsigned len, enum bfd_endian byte_order) + ULONGEST len, enum bfd_endian byte_order) { const gdb_byte *p; @@ -1550,7 +1550,7 @@ maybe_print_array_index (struct type *index_type, LONGEST index, void val_print_array_elements (struct type *type, - const gdb_byte *valaddr, int embedded_offset, + const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -1558,9 +1558,9 @@ val_print_array_elements (struct type *type, unsigned int i) { unsigned int things_printed = 0; - unsigned len; + ULONGEST len; struct type *elttype, *index_type; - unsigned eltlen; + ULONGEST eltlen; /* Position of the array element we are examining to see whether it is repeated. */ unsigned int rep1; @@ -2046,8 +2046,8 @@ generic_emit_char (int c, struct type *type, struct ui_file *stream, omitted. */ void -generic_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, +generic_printstr (struct ui_file *stream, struct type *type, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options) diff --git a/gdb/valprint.h b/gdb/valprint.h index 56c0c92..2841929 100644 --- a/gdb/valprint.h +++ b/gdb/valprint.h @@ -113,7 +113,7 @@ extern void maybe_print_array_index (struct type *index_type, LONGEST index, struct ui_file *stream, const struct value_print_options *); -extern void val_print_array_elements (struct type *, const gdb_byte *, int, +extern void val_print_array_elements (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -127,7 +127,7 @@ extern void val_print_type_code_flags (struct type *type, struct ui_file *stream); extern void val_print_scalar_formatted (struct type *, - const gdb_byte *, int, + const gdb_byte *, LONGEST, const struct value *, const struct value_print_options *, int, @@ -143,7 +143,7 @@ extern void print_decimal_chars (struct ui_file *, const gdb_byte *, unsigned int, enum bfd_endian); extern void print_hex_chars (struct ui_file *, const gdb_byte *, - unsigned int, enum bfd_endian); + ULONGEST, enum bfd_endian); extern void print_char_chars (struct ui_file *, struct type *, const gdb_byte *, unsigned int, enum bfd_endian); @@ -187,7 +187,7 @@ struct generic_val_print_decorations extern void generic_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, @@ -196,8 +196,8 @@ extern void generic_val_print (struct type *type, const gdb_byte *valaddr, extern void generic_emit_char (int c, struct type *type, struct ui_file *stream, int quoter, const char *encoding); -extern void generic_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, +extern void generic_printstr (struct ui_file *stream, struct type *type, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options); diff --git a/gdb/value.c b/gdb/value.c index d498289..30a4a42 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -67,10 +67,10 @@ struct internal_function struct range { /* Lowest offset in the range. */ - int offset; + LONGEST offset; /* Length of the range. */ - int length; + ULONGEST length; }; typedef struct range range_s; @@ -81,8 +81,8 @@ DEF_VEC_O(range_s); [offset2, offset2+len2) overlap. */ static int -ranges_overlap (int offset1, int len1, - int offset2, int len2) +ranges_overlap (LONGEST offset1, ULONGEST len1, + LONGEST offset2, ULONGEST len2) { ULONGEST h, l; @@ -106,7 +106,7 @@ range_lessthan (const range_s *r1, const range_s *r2) OFFSET+LENGTH). */ static int -ranges_contain (VEC(range_s) *ranges, int offset, int length) +ranges_contain (VEC(range_s) *ranges, LONGEST offset, ULONGEST length) { range_s what; int i; @@ -239,7 +239,7 @@ struct value lval == lval_register, this is a further offset from location.address within the registers structure. Note also the member embedded_offset below. */ - int offset; + LONGEST offset; /* Only used for bitfields; number of bits contained in them. */ int bitsize; @@ -309,8 +309,8 @@ struct value `type', and `embedded_offset' is zero, so everything works normally. */ struct type *enclosing_type; - int embedded_offset; - int pointed_to_offset; + LONGEST embedded_offset; + LONGEST pointed_to_offset; /* Values are stored in a chain, so that they can be deleted easily over calls to the inferior. Values assigned to internal @@ -332,7 +332,8 @@ struct value }; int -value_bytes_available (const struct value *value, int offset, int length) +value_bytes_available (const struct value *value, LONGEST offset, + ULONGEST length) { gdb_assert (!value->lazy); @@ -353,7 +354,8 @@ value_entirely_available (struct value *value) } void -mark_value_bytes_unavailable (struct value *value, int offset, int length) +mark_value_bytes_unavailable (struct value *value, LONGEST offset, + ULONGEST length) { range_s newr; int i; @@ -524,7 +526,7 @@ mark_value_bytes_unavailable (struct value *value, int offset, int length) static int find_first_range_overlap (VEC(range_s) *ranges, int pos, - int offset, int length) + LONGEST offset, ULONGEST length) { range_s *r; int i; @@ -537,9 +539,9 @@ find_first_range_overlap (VEC(range_s) *ranges, int pos, } int -value_available_contents_eq (const struct value *val1, int offset1, - const struct value *val2, int offset2, - int length) +value_available_contents_eq (const struct value *val1, LONGEST offset1, + const struct value *val2, LONGEST offset2, + ULONGEST length) { int idx1 = 0, idx2 = 0; @@ -767,13 +769,13 @@ deprecated_set_value_type (struct value *value, struct type *type) value->type = type; } -int +LONGEST value_offset (const struct value *value) { return value->offset; } void -set_value_offset (struct value *value, int offset) +set_value_offset (struct value *value, LONGEST offset) { value->offset = offset; } @@ -924,8 +926,9 @@ value_contents_all (struct value *value) DST_OFFSET+LENGTH) range are wholly available. */ void -value_contents_copy_raw (struct value *dst, int dst_offset, - struct value *src, int src_offset, int length) +value_contents_copy_raw (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, + ULONGEST length) { range_s *r; int i; @@ -973,8 +976,8 @@ value_contents_copy_raw (struct value *dst, int dst_offset, DST_OFFSET+LENGTH) range are wholly available. */ void -value_contents_copy (struct value *dst, int dst_offset, - struct value *src, int src_offset, int length) +value_contents_copy (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, ULONGEST length) { require_not_optimized_out (src); @@ -1034,7 +1037,7 @@ value_contents_equal (struct value *val1, struct value *val2) { struct type *type1; struct type *type2; - int len; + ULONGEST len; type1 = check_typedef (value_type (val1)); type2 = check_typedef (value_type (val2)); @@ -1069,7 +1072,7 @@ value_entirely_optimized_out (const struct value *value) } int -value_bits_valid (const struct value *value, int offset, int length) +value_bits_valid (const struct value *value, LONGEST offset, ULONGEST length) { if (!value->optimized_out) return 1; @@ -1082,7 +1085,7 @@ value_bits_valid (const struct value *value, int offset, int length) int value_bits_synthetic_pointer (const struct value *value, - int offset, int length) + LONGEST offset, ULONGEST length) { if (value->lval != lval_computed || !value->location.computed.funcs->check_synthetic_pointer) @@ -1092,26 +1095,26 @@ value_bits_synthetic_pointer (const struct value *value, length); } -int +LONGEST value_embedded_offset (struct value *value) { return value->embedded_offset; } void -set_value_embedded_offset (struct value *value, int val) +set_value_embedded_offset (struct value *value, LONGEST val) { value->embedded_offset = val; } -int +LONGEST value_pointed_to_offset (struct value *value) { return value->pointed_to_offset; } void -set_value_pointed_to_offset (struct value *value, int val) +set_value_pointed_to_offset (struct value *value, LONGEST val) { value->pointed_to_offset = val; } @@ -1914,7 +1917,7 @@ get_internalvar_function (struct internalvar *var, } void -set_internalvar_component (struct internalvar *var, int offset, int bitpos, +set_internalvar_component (struct internalvar *var, LONGEST offset, int bitpos, int bitsize, struct value *newval) { gdb_byte *addr; @@ -2583,7 +2586,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type) FIELDNO says which field. */ struct value * -value_primitive_field (struct value *arg1, int offset, +value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type) { struct value *v; @@ -2613,8 +2616,8 @@ value_primitive_field (struct value *arg1, int offset, bit. Assume that the address, offset, and embedded offset are sufficiently aligned. */ - int bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); - int container_bitsize = TYPE_LENGTH (type) * 8; + LONGEST bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); + ULONGEST container_bitsize = TYPE_LENGTH (type) * 8; v = allocate_value_lazy (type); v->bitsize = TYPE_FIELD_BITSIZE (arg_type, fieldno); @@ -2636,7 +2639,7 @@ value_primitive_field (struct value *arg1, int offset, /* This field is actually a base subobject, so preserve the entire object's contents for later references to virtual bases, etc. */ - int boffset; + LONGEST boffset; /* Lazy register values with offsets are not supported. */ if (VALUE_LVAL (arg1) == lval_register && value_lazy (arg1)) @@ -2713,7 +2716,7 @@ value_field (struct value *arg1, int fieldno) struct value * value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *type, - int offset) + LONGEST offset) { struct value *v; struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); @@ -2773,8 +2776,8 @@ value_fn_field (struct value **arg1p, struct fn_field *f, static int unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, int bitsize, - const struct value *original_value, + LONGEST embedded_offset, LONGEST bitpos, + int bitsize, const struct value *original_value, LONGEST *result) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (field_type)); @@ -2782,7 +2785,7 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, ULONGEST valmask; int lsbcount; int bytes_read; - int read_offset; + LONGEST read_offset; /* Read the minimum number of bytes required; there may not be enough bytes to read an entire ULONGEST. */ @@ -2852,7 +2855,7 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, int bitsize, + LONGEST embedded_offset, int bitpos, int bitsize, const struct value *original_value, LONGEST *result) { @@ -2870,10 +2873,10 @@ unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, static int unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result) { - int bitpos = TYPE_FIELD_BITPOS (type, fieldno); + LONGEST bitpos = TYPE_FIELD_BITPOS (type, fieldno); int bitsize = TYPE_FIELD_BITSIZE (type, fieldno); struct type *field_type = TYPE_FIELD_TYPE (type, fieldno); @@ -2889,7 +2892,7 @@ unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result) { gdb_assert (val != NULL); @@ -2921,7 +2924,7 @@ unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno) struct value * value_field_bitfield (struct type *type, int fieldno, const gdb_byte *valaddr, - int embedded_offset, const struct value *val) + LONGEST embedded_offset, const struct value *val) { LONGEST l; @@ -2948,12 +2951,12 @@ value_field_bitfield (struct type *type, int fieldno, void modify_field (struct type *type, gdb_byte *addr, - LONGEST fieldval, int bitpos, int bitsize) + LONGEST fieldval, LONGEST bitpos, unsigned int bitsize) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); ULONGEST oword; ULONGEST mask = (ULONGEST) -1 >> (8 * sizeof (ULONGEST) - bitsize); - int bytesize; + ULONGEST bytesize; /* Normalize BITPOS. */ addr += bitpos / 8; diff --git a/gdb/value.h b/gdb/value.h index 76c8e85..f953217 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -82,8 +82,8 @@ extern void set_value_parent (struct value *value, struct value *parent); within the registers structure. Note also the member embedded_offset below. */ -extern int value_offset (const struct value *); -extern void set_value_offset (struct value *, int offset); +extern LONGEST value_offset (const struct value *); +extern void set_value_offset (struct value *, LONGEST offset); /* The comment from "struct value" reads: ``Is it modifiable? Only relevant if lval != not_lval.''. Shouldn't the value instead be @@ -154,10 +154,10 @@ extern struct type *value_actual_type (struct value *value, int resolve_simple_types, int *real_type_found); -extern int value_pointed_to_offset (struct value *value); -extern void set_value_pointed_to_offset (struct value *value, int val); -extern int value_embedded_offset (struct value *value); -extern void set_value_embedded_offset (struct value *value, int val); +extern LONGEST value_pointed_to_offset (struct value *value); +extern void set_value_pointed_to_offset (struct value *value, LONGEST val); +extern LONGEST value_embedded_offset (struct value *value); +extern void set_value_embedded_offset (struct value *value, LONGEST val); /* For lval_computed values, this structure holds functions used to retrieve and set the value (or portions of the value). @@ -185,7 +185,8 @@ struct lval_funcs /* Check the validity of some bits in VALUE. This should return 1 if all the bits starting at OFFSET and extending for LENGTH bits are valid, or 0 if any bit is invalid. */ - int (*check_validity) (const struct value *value, int offset, int length); + int (*check_validity) (const struct value *value, LONGEST offset, + ULONGEST length); /* Return 1 if any bit in VALUE is valid, 0 if they are all invalid. */ int (*check_any_valid) (const struct value *value); @@ -203,7 +204,7 @@ struct lval_funcs /* If non-NULL, this is used to determine whether the indicated bits of VALUE are a synthetic pointer. */ int (*check_synthetic_pointer) (const struct value *value, - int offset, int length); + LONGEST offset, ULONGEST length); /* Return a duplicate of VALUE's closure, for use in a new value. This may simply return the same closure, if VALUE's is @@ -240,7 +241,7 @@ extern struct value *allocate_computed_value (struct type *type, Otherwise, return 1. */ extern int valprint_check_validity (struct ui_file *stream, struct type *type, - int embedded_offset, + LONGEST embedded_offset, const struct value *val); extern struct value *allocate_optimized_out_value (struct type *type); @@ -411,13 +412,13 @@ extern struct value *coerce_array (struct value *value); bits in the given range are valid, zero if any bit is invalid. */ extern int value_bits_valid (const struct value *value, - int offset, int length); + LONGEST offset, ULONGEST length); /* Given a value, determine whether the bits starting at OFFSET and extending for LENGTH bits are a synthetic pointer. */ extern int value_bits_synthetic_pointer (const struct value *value, - int offset, int length); + LONGEST offset, ULONGEST length); /* Given a value, determine whether the contents bytes starting at OFFSET and extending for LENGTH bytes are available. This returns @@ -425,7 +426,7 @@ extern int value_bits_synthetic_pointer (const struct value *value, byte is unavailable. */ extern int value_bytes_available (const struct value *value, - int offset, int length); + LONGEST offset, ULONGEST length); /* Like value_bytes_available, but return false if any byte in the whole object is unavailable. */ @@ -435,7 +436,7 @@ extern int value_entirely_available (struct value *value); LENGTH bytes as unavailable. */ extern void mark_value_bytes_unavailable (struct value *value, - int offset, int length); + LONGEST offset, ULONGEST length); /* Compare LENGTH bytes of VAL1's contents starting at OFFSET1 with LENGTH bytes of VAL2's contents starting at OFFSET2. @@ -445,7 +446,7 @@ extern void mark_value_bytes_unavailable (struct value *value, example, to compare a complete object value with itself, including its enclosing type chunk, you'd do: - int len = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); + ULONGEST len = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); value_available_contents (val, 0, val, 0, len); Returns true iff the set of available contents match. Unavailable @@ -467,9 +468,10 @@ extern void mark_value_bytes_unavailable (struct value *value, value_available_contents_eq(val, 3, val, 4, 4) => 0 */ -extern int value_available_contents_eq (const struct value *val1, int offset1, - const struct value *val2, int offset2, - int length); +extern int value_available_contents_eq (const struct value *val1, + LONGEST offset1, + const struct value *val2, + LONGEST offset2, ULONGEST length); /* Read LENGTH bytes of memory starting at MEMADDR into BUFFER, which is (or will be copied to) VAL's contents buffer offset by @@ -480,7 +482,7 @@ extern int value_available_contents_eq (const struct value *val1, int offset1, extern void read_value_memory (struct value *val, int embedded_offset, int stack, CORE_ADDR memaddr, - gdb_byte *buffer, size_t length); + gdb_byte *buffer, ULONGEST length); \f @@ -505,7 +507,7 @@ extern CORE_ADDR unpack_pointer (struct type *type, const gdb_byte *valaddr); extern int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, + LONGEST embedded_offset, int bitpos, int bitsize, const struct value *original_value, LONGEST *result); @@ -514,12 +516,12 @@ extern LONGEST unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno); extern int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result); extern struct value *value_field_bitfield (struct type *type, int fieldno, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, const struct value *val); extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); @@ -573,12 +575,12 @@ extern struct value *default_read_var_value (struct symbol *var, extern struct value *allocate_value (struct type *type); extern struct value *allocate_value_lazy (struct type *type); extern void allocate_value_contents (struct value *value); -extern void value_contents_copy (struct value *dst, int dst_offset, - struct value *src, int src_offset, - int length); -extern void value_contents_copy_raw (struct value *dst, int dst_offset, - struct value *src, int src_offset, - int length); +extern void value_contents_copy (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, + ULONGEST length); +extern void value_contents_copy_raw (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, + ULONGEST length); extern struct value *allocate_repeat_value (struct type *type, int count); @@ -644,7 +646,8 @@ extern struct value *value_static_field (struct type *type, int fieldno); extern struct fn_field *value_find_oload_method_list (struct value **, const char *, int, int *, - struct type **, int *); + struct type **, + LONGEST *); enum oload_search_type { NON_METHOD, METHOD, BOTH }; @@ -657,16 +660,16 @@ extern int find_overload_match (struct value **args, int nargs, extern struct value *value_field (struct value *arg1, int fieldno); -extern struct value *value_primitive_field (struct value *arg1, int offset, +extern struct value *value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type); -extern struct type *value_rtti_indirect_type (struct value *, int *, int *, +extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *, int *); extern struct value *value_full_object (struct value *, struct type *, int, - int, int); + LONGEST, int); extern struct value *value_cast_pointers (struct type *, struct value *); @@ -756,7 +759,7 @@ extern void set_internalvar_string (struct internalvar *var, extern void clear_internalvar (struct internalvar *var); extern void set_internalvar_component (struct internalvar *var, - int offset, + LONGEST offset, int bitpos, int bitsize, struct value *newvalue); @@ -836,7 +839,7 @@ extern struct value *value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside); extern struct value *value_fn_field (struct value **arg1p, struct fn_field *f, - int j, struct type *type, int offset); + int j, struct type *type, LONGEST offset); extern int binop_types_user_defined_p (enum exp_opcode op, struct type *type1, @@ -864,7 +867,8 @@ extern void release_value_or_incref (struct value *val); extern int record_latest_value (struct value *val); extern void modify_field (struct type *type, gdb_byte *addr, - LONGEST fieldval, int bitpos, int bitsize); + LONGEST fieldval, LONGEST bitpos, + unsigned int bitsize); extern void type_print (struct type *type, const char *varstring, struct ui_file *stream, int show); @@ -894,7 +898,7 @@ extern void value_print_array_elements (struct value *val, extern struct value *value_release_to_mark (struct value *mark); extern void val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -945,7 +949,7 @@ extern struct value *value_literal_complex (struct value *, struct value *, extern struct value *find_function_in_inferior (const char *, struct objfile **); -extern struct value *value_allocate_space_in_inferior (int); +extern struct value *value_allocate_space_in_inferior (ULONGEST); extern struct value *value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound); diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 0dcca75..378cf05 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -116,7 +116,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); gdb_byte buf[4]; - int count = 0; + ULONGEST count = 0; int i; /* We create an argument list on the stack, and make the argument @@ -125,7 +125,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, /* Push arguments in reverse order. */ for (i = nargs - 1; i >= 0; i--) { - int len = TYPE_LENGTH (value_enclosing_type (args[i])); + ULONGEST len = TYPE_LENGTH (value_enclosing_type (args[i])); sp -= (len + 3) & ~3; count += (len + 3) / 4; @@ -208,7 +208,7 @@ vax_return_value (struct gdbarch *gdbarch, struct type *func_type, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); gdb_byte buf[8]; if (TYPE_CODE (type) == TYPE_CODE_STRUCT diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index cfef755..c77e25d 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -162,8 +162,9 @@ static void xstormy16_extract_return_value (struct type *type, struct regcache *regcache, void *valbuf) { - int len = TYPE_LENGTH (type); - int i, regnum = E_1ST_ARG_REGNUM; + ULONGEST len = TYPE_LENGTH (type); + ULONGEST i; + int regnum = E_1ST_ARG_REGNUM; for (i = 0; i < len; i += xstormy16_reg_size) regcache_raw_read (regcache, regnum++, (char *) valbuf + i); @@ -188,8 +189,9 @@ xstormy16_store_return_value (struct type *type, struct regcache *regcache, } else { - int len = TYPE_LENGTH (type); - int i, regnum = E_1ST_ARG_REGNUM; + ULONGEST len = TYPE_LENGTH (type); + ULONGEST i; + int regnum = E_1ST_ARG_REGNUM; for (i = 0; i < len; i += xstormy16_reg_size) regcache_raw_write (regcache, regnum++, (char *) valbuf + i); @@ -235,8 +237,9 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR stack_dest = sp; int argreg = E_1ST_ARG_REGNUM; - int i, j; - int typelen, slacklen; + int i, slacklen; + LONGEST j; + ULONGEST typelen; const gdb_byte *val; char buf[xstormy16_pc_size]; diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 78d8888..79308b7 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -1581,7 +1581,7 @@ xtensa_extract_return_value (struct type *type, { struct gdbarch *gdbarch = get_regcache_arch (regcache); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); ULONGEST pc, wb; int callsize, areg; int offset = 0; @@ -1599,8 +1599,8 @@ xtensa_extract_return_value (struct type *type, /* On Xtensa, we can return up to 4 words (or 2 for call12). */ if (len > (callsize > 8 ? 8 : 16)) internal_error (__FILE__, __LINE__, - _("cannot extract return value of %d bytes long"), - len); + _("cannot extract return value of %s bytes long"), + pulongest (len)); /* Get the register offset of the return register (A2) in the caller window. */ @@ -1615,7 +1615,8 @@ xtensa_extract_return_value (struct type *type, areg = gdbarch_tdep (gdbarch)->a0_base + C0_ARGS; } - DEBUGINFO ("[xtensa_extract_return_value] areg %d len %d\n", areg, len); + DEBUGINFO ("[xtensa_extract_return_value] areg %d len %s\n", areg, + pulongest (len)); if (len < 4 && gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) offset = 4 - len; @@ -1640,7 +1641,7 @@ xtensa_store_return_value (struct type *type, unsigned int areg; ULONGEST pc, wb; int callsize; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int offset = 0; DEBUGTRACE ("xtensa_store_return_value (...)\n"); @@ -1654,8 +1655,8 @@ xtensa_store_return_value (struct type *type, if (len > (callsize > 8 ? 8 : 16)) internal_error (__FILE__, __LINE__, - _("unimplemented for this length: %d"), - TYPE_LENGTH (type)); + _("unimplemented for this length: %s"), + pulongest (TYPE_LENGTH (type))); areg = arreg_number (gdbarch, gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb); @@ -1729,18 +1730,18 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int i; - int size, onstack_size; + ULONGEST size, onstack_size; gdb_byte *buf = (gdb_byte *) alloca (16); CORE_ADDR ra, ps; struct argument_info { const bfd_byte *contents; - int length; + ULONGEST length; int onstack; /* onstack == 0 => in reg */ int align; /* alignment */ union { - int offset; /* stack offset if on stack. */ + LONGEST offset; /* stack offset if on stack. */ int regno; /* regno if in register. */ } u; }; @@ -1764,9 +1765,9 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); - fprintf_unfiltered (gdb_stdlog, "%2d: %s %3d ", i, + fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i, host_address_to_string (arg), - TYPE_LENGTH (arg_type)); + pulongest (TYPE_LENGTH (arg_type))); switch (TYPE_CODE (arg_type)) { case TYPE_CODE_INT: [-- Attachment #3: bitpos-expand-testcase.patch --] [-- Type: text/x-patch, Size: 2557 bytes --] diff --git a/gdb/testsuite/gdb.base/structs-longest-bitpos.c b/gdb/testsuite/gdb.base/structs-longest-bitpos.c new file mode 100644 index 0000000..6fb4614 --- /dev/null +++ b/gdb/testsuite/gdb.base/structs-longest-bitpos.c @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +struct foo +{ + char buf[0xffff000000]; + char buf2[2]; +} *f; + +int +main () +{ + return 0; +} diff --git a/gdb/testsuite/gdb.base/structs-longest-bitpos.exp b/gdb/testsuite/gdb.base/structs-longest-bitpos.exp new file mode 100644 index 0000000..ba49518 --- /dev/null +++ b/gdb/testsuite/gdb.base/structs-longest-bitpos.exp @@ -0,0 +1,30 @@ +# This testcase is part of GDB, the GNU debugger. + +# Copyright 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set testfile "structs-longest-bitpos" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +if { [prepare_for_testing structs-longest-bitpos.exp "structs-longest-bitpos" "" {debug}] } { + return -1 +} + +# The array size should not overflow +gdb_test "print &f->buf" "= \\(char \\(\\*\\)\\\[1099494850560\\\]\\) 0x0" + +# The offset should not overflow +gdb_test "print &f->buf2" "= \\(char \\(\\*\\)\\\[2\\\]\\) 0xffff000000" ^ permalink raw reply [flat|nested] 70+ messages in thread
* ping: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-04 13:10 ` [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST Siddhesh Poyarekar @ 2012-05-15 9:46 ` Siddhesh Poyarekar 2012-05-15 9:49 ` Jan Kratochvil 2012-05-15 20:07 ` Jan Kratochvil 1 sibling, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-05-15 9:46 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey Ping? Regards, Siddhesh On Fri, 4 May 2012 18:38:58 +0530, Siddhesh wrote: > Hi, > > I have finally finished this off with a combined patch to expand > bitpos to LONGEST and type.length to ULONGEST. A quick recap of the > problem I'm trying to solve: > > Currently gdb stores type sizes and struct offsets in 32-bit unsigned > and int respectively, which overflows for larger values. This patch > extends these values and all its usages throughout the code to the > longest possible values so that gdb can read larger structs, arrays > and ofsets within those structs and arrays. > > An initial patch had gone in to avoid overloading the meaning of > structure offset with enum values, primarily to allow bitpos to be > defined as ULONGEST: > > http://sourceware.org/ml/gdb-patches/2012-04/msg00538.html > > This however is not possible anyway, since bitpos may be negative for > vtable offsets and as a result, I have extended bitpos to LONGEST in > this patch. > > I have attached the test case patch as a separate file. Below is the > changelog. > > Regards, > Siddhesh > > > gdb/ChangeLog > > 2012-05-04 Siddhesh Poyarekar <siddhesh@redhat.com> > > * ada-lang.c (fat_pntr_bounds_bitpos): Return LONGEST. > (fat_pntr_data_bitpos): Likewise. > (desc_bound_bitpos): Likewise. > (constrained_packed_array_type): Expand elt_bits parameter to > LONGEST. > (move_bits): Expand parameters src_offset and n to ULONGEST. > (ada_index_struct_field): Expand parameters index and offset > to LONGEST. > (cond_offset_host): Expand parameter offset to LONGEST. > (cond_offset_target): Likewise. > (ada_type_of_array): Expand array_bitsize to LONGEST. > (decode_constrained_packed_array_type): Expand bits to > ULONGEST. (decode_constrained_packed_array): Expand bit_pos to > LONGEST. (ada_value_primitive_packed_val): Expand parameter offset to > LONGEST. Expand targ to LONGEST and ntarg to ULONGEST. > (ada_value_assign): Expand from_size to ULONGEST. > (value_assign_to_component): Expand bits to ULONGEST. > (ensure_lval): Expand len to ULONGEST. > (value_pointer): Likewise. > (value_tag_from_contents_and_address): Expand tag_byte_offset > to LONGEST. > (ada_value_primitive_field): Expand parameter offset to > LONGEST. Expand bit_pos to LONGEST. > (find_struct_field): Expand parameters offset and > byte_offset_p to LONGEST. Expand bit_pos and fld_offset to LONGEST. > (ada_search_struct_field): Expand parameter offset to LONGEST. > Expand var_offset to LONGEST. > (ada_index_struct_field): Expand parameters index and offset > to LONGEST. > (ada_index_struct_field_1): Expand parameters index_p and > offset to LONGEST. > (ada_value_struct_elt): Expand byte_offset to LONGEST. > (align_value): Return ULONGEST. Expand parameter off to > LONGEST and alignment to ULONGEST. > (ada_template_to_fixed_record_type_1): Expand off, bit_len and > fld_bit_len to ULONGEST. Expand field_offset to LONGEST. Use > pulongest function to print TYPE_LENGTH. > (to_fixed_array_type): Expand len to ULONGEST. > * ada-lang.h (ada_val_print): Expand parameter embedded_offset > to LONGEST. > (ada_printstr): Expand parameter length to ULONGEST. > (ada_value_primitive_packed_val): Expand parameter offset to > LONGEST. > * ada-typeprint.c (ada_print_type): Use pulongest to print > TYPE_LENGTH. > * ada-valprint.c (val_print_packed_array_elements): Expand > eltlen to ULONGEST. > (char_at): Expand parameter i to ULONGEST. > (printstr): Expand parameter length to ULONGEST. > (ada_printstr): Likewise. > (ada_val_print): Expand embedded_offset to LONGEST. > (ada_val_print_array): Expand eltlen, len and temp_len to > ULONGEST. > (ada_val_print_1): Expand parameter offset to ULONGEST. Expand > len to ULONGEST. > (print_variant_part): Expand parameters offset and > outer_offset to LONGEST. > (print_field_values): Likewise. Expand bit_pos to LONGEST. > * alpha-tdep.c (struct alpha_arg): Expand member len to > ULONGEST. > (alpha_push_dummy_call): Expand len to ULONGEST. > (alpha_extract_return_value): Expand length to ULONGEST. > (alpha_store_return_value): Likewise. > * amd64-tdep.c (amd64_classify_aggregate): Expand len, > bitsize, endpos to ULONGEST and pos to LONGEST. > (amd64_classify): Expand len to ULONGEST. > (amd64_return_value): Expand len to LONGEST. > (amd64_push_arguments): Expand num_elements, element to > ULONGEST and len to LONGEST. > (amd64_get_longjmp_target): Expand len to ULONGEST. > * amd64-windows-tdep.c (amd64_windows_return_value): Expand > len to LONGEST. > * arm-tdep.c (arm_push_dummy_call): Expand len to LONGEST. > (arm_extract_return_value): Expand len to ULONGEST. > (arm_store_return_value): Likewise. > * avr-tdep.c (avr_return_value): Expand i to ULONGEST. > (push_stack_item): Expand parameter len to ULONGEST. > (avr_push_dummy_call): Expand last_regnum, len to ULONGEST. > * ax-gdb.c (gen_trace_static_fields): Expand length to > ULONGEST. > (gen_traced_pop): Likewise. > (gen_left_shift): Expand parameter distance to LONGEST. > (gen_offset): Expand parameter offset to LONGEST. > (gen_bitfield_ref): Expand parameters start, end to LONGEST. > Expand bound_start, bound_endi, offset to LONGEST. > (gen_primitive_field): Expand parameter offset to LONGEST. > (gen_struct_ref_recursive): Likewise. > * bfin-tdep.c (bfin_push_dummy_call): Expand total_len, len, > container_len to ULONGEST. > (bfin_extract_return_value): Expand len to LONGEST. > (bfin_store_return_value): Likewise. > * breakpoint.c (update_watchpoint): Expand len to ULONGEST. > (can_use_hardware_watchpoint): Likewise. > (invalidate_bp_value_on_memory_change): Expand parameter len > to LONGEST. > * breakpoint.h (struct bp_location): Expand member length to > ULONGEST. > * c-lang.c (c_printstr): Expand parameter length to ULONGEST. > Remove unused variable width. > (evaluate_subexp_c): Expand element_size, i to ULONGEST. > * c-lang.h (c_val_print): Expand parameter embedded_offset to > LONGEST. > (c_printstr): Expand parameter length to ULONGEST. > (cp_print_value_fields): Expand parameter offset to LONGEST. > (cp_print_value_fields_rtti): Likewise. > * c-typeprint.c (c_type_print_varspec_suffix): Remove cast > down to int and use pulongest to print ULONGEST. > * c-valprint.c (c_val_print): Expand parameter embedded_offset > to LONGEST. Expand offset to LONGEST, eltlen to ULONGEST. > (c_value_print): Expand top to LONGEST. > * corefile.c (read_memory): Expand len to ULONGEST. > (read_stack): Likewise. > (write_memory): Likewise. > * cp-abi.c (baseclass_offset): Return LONGEST. Expand > parameter embedded_offset to LONGEST. Expand res to LONGEST. > (value_virtual_fn_field): Expand parameter offset to LONGEST. > (value_rtti_type): Expand parameter top to LONGEST *. > * cp-abi.h (value_virtual_fn_field): Expand offset to LONGEST. > (value_rtti_type): Expand top to LONGEST *. > (baseclass_offset): Return LONGEST. Expand parameter > embedded_offset to LONGEST. > (struct cp_abi_ops): Expand parameter offset for > virtual_fn_field to LONGEST. Expand parameter top to LONGEST > * in value_rtti_type. Return LONGEST from baseclass_offset > and expand parameter for embedded_offset to LONGEST. > * cp-valprint.c (cp_print_value_fields): Expand parameter > offset to LONGEST. > (cp_print_value_fields_rtti): Likewise. Expand top to LONGEST. > (cp_print_value): Expand parameter offset to LONGEST. Expand > thisoffset, boffset to LONGEST. > (cp_find_class_member): Expand bitsize to ULONGEST. > * cris-tdep.c (push_stack_item): Expand parameter len to > ULONGEST. > (cris_push_dummy_call): Expand len, reg_demand, i to ULONGEST. > (cris_store_return_value): Expand len to ULONGEST. > (cris_extract_return_value): Likewise. > * d-lang.h (d_val_print): Expand parameter embedded_offset to > LONGEST. > * d-valprint.c (dynamic_array_type): Likewise. > (d_val_print): Likewise. > * doc/observer.texi (memory_changed): Expand parameter len to > LONGEST. > * doublest.c (floatformat_from_length): Likewise. Use > pulongest to format string for ULONGEST. > * dwarf2loc.c (copy_bitwise): Expand parameters > dest_offset_bits, bit_count to ULONGEST. Rename parameter > source_offset_bits to source_offset and expand to ULONGEST. > New variable source_offset_bits. > (read_pieced_value): Expand offset, dest_offset_bits, > source_offset_bits, source_offset to LONGEST. Expand type_len, > this_size, this_size_bits to ULONGEST. > (write_pieced_value): Expand type_len, this_size, > this_size_bits to ULONGEST. Expand dest_offset_bits, > source_offset_bits, dest_offset, source_offset to LONGEST. > (check_pieced_value_bits): Expand parameter bit_length to > ULONGEST. > (check_pieced_value_validity): Likewise. > (check_pieced_synthetic_pointer): Likewise. > (indirect_pieced_value): Expand bit_length to ULONGEST. Expand > bit_offset to LONGEST. > (dwarf2_evaluate_loc_desc_full): Expand n to ULONGEST. > * dwarf2read.c (struct dwarf_block): ULONGEST size. > (dwarf2_const_value_length_mismatch_complaint): Expand > parameters arg2 and arg3 to ULONGEST. Use pulongest to print > arg2 and arg3. (dwarf2_add_field): Expand anonymous size to > ULONGEST. (dump_die_shallow): Use pulongest to print > dwarf_block.size. > * eval.c (evaluate_struct_tuple): Expand bitpos to LONGEST. > (init_array_element): Expand element_size to ULONGEST. > (binop_promote): Expand promoted_len1, promoted_len2, > result_len to ULONGEST. > (evaluate_subexp_standard): Expand mem_offset, top to LONGEST. > Expand element_size to ULONGEST. > * f-lang.c (f_printstr): Expand parameter length to ULONGEST. > * f-lang.h (f_val_print): Expand parameter embedded_offset to > LONGEST. > * f-valprint.c (f77_array_offset_tbl): Make LONGEST. > (f77_create_arrayprint_offset_tbl): Expand eltlen to ULONGEST. > (f77_print_array_1): Expand parameter embedded_offset to > LONGEST. (f77_print_array): Likewise. > (f_val_print): Likewise. Expand offset to LONGEST. > * findcmd.c (parse_find_args): Expand val_bytes to ULONGEST. > * findvar.c (extract_unsigned_integer): Remove unnecessary > cast. > (default_read_var_value): Expand len to ULONGEST. > (default_value_from_register): Likewise. > (read_frame_register_value): Expand offset, reg_offset to > LONGEST. Expand len, reg_len to ULONGEST. > * frv-tdep.c (frv_extract_return_value): Expand len to > ULONGEST. Use pulongest to format print len. > (frv_push_dummy_call): Expand len to ULONGEST. > (frv_store_return_value): Likewise. Use pulongest to format > print len. > * gdbcore.h (read_memory): Expand parameter len to ULONGEST. > (read_stack): Likewise. > (write_memory): Likewise. > * gdbtypes.c (init_type): Expand parameter length to ULONGEST. > (is_unique_ancestor_worker): Expand parameters offset, > embedded_offset to LONGEST. Expand this_offset to LONGEST. > (recursive_dump_type): Use pulongest to format print > TYPE_LENGTH. Use plongest to format print TYPE_FIELD_BITPOS. > (arch_type): Expand parameter length to ULONGEST. > * gdbtypes.h (type.main_type.fld_bnds.fields): Expand bitpos > to LONGEST. > (type): Expand length to ULONGEST. > (init_type): Expand parameter length to ULONGEST. > (arch_type): Likewise. > * gnu-v2-abi.c (gnuv2_virtual_fn_field): Expand parameter > offset to LONGEST. > (gnuv2_value_rtti_type): Expand parameter top to LONGEST *. > (gnuv2_baseclass_offset): Return LONGEST. Expand parameter > embedded_offset to LONGEST. Expand field_offset, boffset to > LONGEST, field_length to ULONGEST. > * gnu-v3-abi.c (build_gdb_vtable_type): Expand offset to > LONGEST. > (vtable_address_point_offset): Return LONGEST. > (gnuv3_rtti_type): Expand parameter top_p to LONGEST *. > (gnuv3_virtual_fn_field): Expand parameter offset to LONGEST. > (gnuv3_baseclass_offset): Return LONGEST. Expand parameter > embedded_ofset to LONGEST. Expand cur_base_offset, base_offset > to LONGEST. > (gnuv3_find_method_in): Expand pos to LONGEST. > * go-lang.h (go_val_print): Expand parameter embedded_offset > to LONGEST. > * go-valprint.c (go_val_print): Likewise. > * h8300-tdep.c (h8300_push_dummy_call): Expand stack_alloc, > stack_offset, len, padded_len, offset to LONGEST. > * hppa-tdep.c (hppa64_push_dummy_call): Expand len to > ULONGEST. > (hppa64_return_value): Likewise. > * i386-darwin-tdep.c (i386_darwin_arg_type_alignment): Return > ULONGEST. Expand res to ULONGEST. > (i386_darwin_push_dummy_call): Expand arg_spaces, len, align > to ULONGEST. > * i386-nat.c (i386_handle_nonaligned_watchpoint): Expand > parameter len to ULONGEST. > (i386_region_ok_for_watchpoint): Expand parameter len to > LONGEST. > * i386-tdep.c (i386_push_dummy_call): Expand arg_space, > arg_space_used, len to ULONGEST. > (i386_extract_return_value): Expand len to ULONGEST. Use > pulongest to format print len. > (i386_store_return_value): Likewise. > * ia64-tdep.c (ia64_extract_return_value): Expand n to > ULONGEST. > (ia64_store_return_value): Likewise. > (ia64_push_dummy_call): Expand argoffset, len, nslots, > memslots to ULONGEST. > * infcall.c (call_function_by_hand): Expand len to ULONGEST. > * infrun.c (save_infcall_suspend_state): Expand len to > ULONGEST. > (restore_infcall_suspend_state): Eliminate single-use variable > len. > * iq2000-tdep.c (iq2000_store_return_value): Expand len to > ULONGEST. > (iq2000_extract_return_value): Likewise. Use len instead of > TYPE_LENGTH. > (iq2000_push_dummy_call): Expand typelen, stackspace to > ULONGEST. > * jv-lang.c (java_link_class_type): Expand boffset to LONGEST. > (java_printstr): Expand parameter length to ULONGEST. > * jv-lang.h (java_val_print): Expand parameter embedded_offset > to LONGEST. > * jv-valprint.c (java_print_value_fields): Expand parameter > offset to LONGEST. > (java_val_print): Expand parameter embedded_offset to LONGEST. > * language.c (unk_lang_printstr): Expand parameter length to > ULONGEST. > (unk_lang_val_print): Expand parameter embedded_offset to > LONGEST. > * language.h (language_defn): Expand parameter length of > la_printstr to ULONGEST. Expand parameter embedded_offset of > la_val_print to LONGEST. > * lm32-tdep.c (lm32_push_dummy_call): Expand len to ULONGEST. > (lm32_store_return_value): Likewise. > * m2-lang.c (m2_printstr): Expand parameter length to > ULONGEST. > * m2-lang.h (m2_val_print): Expand parameter embedded_offset > to ULONGEST. > * m2-typeprint.c (m2_array): Use pulongest to print > TYPE_LENGTH. > (m2_enum): expand lastval to LONGEST. > * m2-valprint.c (m2_print_long_set): Expand parameter > embedded_offset to LONGEST. > (m2_print_unbounded_array): Likewise. > (m2_print_array_contents): Likewise. Eliminate eltlen and use > TYPE_LENGTH directly. > (m2_val_print): Expand parameter embedded_offset to LONGEST. > Expand i, len, temp_len to ULONGEST. Remove eltlen, use > TYPE_LENGTH directly. > * m32r-tdep.c (m32r_push_dummy_call): Expand len to ULONGEST. > (m32r_extract_return_value): Likewise. > * m68hc11-tdep.c (m68hc11_push_dummy_call): Expand len to > ULONGEST. > (m68hc11_store_return_value): Likewise. > * m68k-tdep.c (m68k_extract_return_value): Expand len to > ULONGEST. Use pulongest to format print len. > (m68k_svr4_extract_return_value): Replace single-use variable > len with TYPE_LENGTH. > (m68k_store_return_value): Expand len to ULONGEST. Use > pulongest to format print len. > (m68k_svr4_store_return_value): Replace single-use variable > len with TYPE_LENGTH. > (m68k_push_dummy_call): Expand len, container_len, offset to > ULONGEST. > * m88k-tdep.c (m88k_store_arguments): Expand > num_register_words, num_stack_words, len to ULONGEST. > (m88k_return_value): Expand len to ULONGEST. > * memrange.c (mem_ranges_overlap): Expand parameters len1, > len2 to ULONGEST. > * memrange.h (struct mem_range): Expand member length to > ULONGEST. > (mem_ranges_overlap): Expand parameters len1, len2 to > ULONGEST. > * mep-tdep.c (push_large_arguments): Expand arg_len to > ULONGEST. > (mep_push_dummy_call): Expand arg_size to ULONGEST. > * microblaze-tdep.c (microblaze_store_return_value): Expand > len to ULONGEST. > * mips-tdep.c (mips_xfer_register): Expand parameter > buf_offset to LONGEST. Use plongest to format print > buf_offset. (mips_eabi_push_dummy_call): Expand len to ULONGEST. Use > pulongest to format print len. > (mips_n32n64_fp_arg_chunk_p): Expand parameter offset to > LONGEST. Expand pos to LONGEST. > (mips_n32n64_return_value): Expand offset to LONGEST. Use > plongest to format print offset. > (mips_o32_push_dummy_call): Expand len to ULONGEST. Eliminate > single-use variable arglen. Use pulongest to format print len. > (mips_o64_push_dummy_call): Expand len, stack_offset to > ULONGEST. Eliminate single-use variable arglen. use pulongest > to format print len. > * mn10300-tdep.c (mn10300_type_align): Return ULONGEST. > Expand align, falign to ULONGEST. > (mn10300_push_dummy_call): Expand len, arg_len to ULONGEST. > * moxie-tdep.c (moxie_store_return_value): Expand len to > ULONGEST. > (moxie_extract_return_value): Likewise. > * mt-tdep.c (mt_push_dummy_call): Expand stack_dest, typelen > to ULONGEST. > * objc-lang.c (objc_printstr): Expand parameter length to > ULONGEST. > * opencl-lang.c (lookup_opencl_vector_type): Expand parameter > el_length to ULONGEST. Expand length to ULONGEST. > (lval_func_read): Expand offset, n, i, j to LONGEST. Expand > elsize to ULONGEST. > (lval_func_write): Likewise. > (lval_func_check_validity): Expand parameter length to > ULONGEST. Expand elsize to ULONGEST. Expand start, end, i to LONGEST. > (lval_func_check_any_valid): Expand elsize to ULONGEST. > (lval_func_check_synthetic_pointer): Expand parameter offset > to LONGEST. Expand parameter length to ULONGEST. Expand elsize to > ULONGEST. Expand start, end, i to LONGEST. > * p-lang.c (is_pascal_string_type): Expand parameter > length_pos, string_pos to LONGEST *. Expand parameter > length_size to ULONGEST *. > (pascal_printstr): Expand parameter length to ULONGEST. > * p-lang.h (pascal_val_print): Expand parameter > embedded_offset to LONGEST. > (is_pascal_string_type): Expand parameter length_pos, > string_pos to LONGEST *. Expand parameter length_size to ULONGEST *. > (pascal_printstr): Expand parameter length to ULONGEST. > (pascal_object_print_value_fields): Expand parameter offset to > LONGEST. > * p-typeprint.c (pascal_type_print_base): Expand lastval to > LONGEST. > * p-valprint.c (pascal_val_print): Expand parameter > embedded_offset to LONGEST. Expand eltlen, length_size to > ULONGEST. Expand length_pos, string_pos to LONGEST. > (pascal_object_print_value_fields): Expand parameter offset to > LONGEST. > (pascal_object_print_value): Likewise. Expand boffset, > thisoffset to LONGEST. > * ppc-linux-nat.c (check_condition): Expand parameter len to > ULONGEST *. > * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Expand > argoffset, structoffset, len, i, nelt to ULONGEST. > (do_ppc_sysv_return_value): Expand i, nelt, offset to > ULONGEST. (ppc64_sysv_abi_push_dummy_call): Expand len to ULONGEST. > (ppc64_sysv_abi_return_value): Expand n_regs, i, offset to > ULONGEST. > * printcmd.c (print_formatted): Expand len to ULONGEST. > (float_type_from_length): Likewise. > (print_scalar_formatted): Likewise. > * python/py-prettyprint.c (apply_val_pretty_printer): Expand > parameter embedded_offset to LONGEST. > * python/python.h (apply_val_pretty_printer): Likewise. > * regcache.c (regcache_xfer_part): Expand parameter offset to > LONGEST. > (regcache_cooked_read_part): Likewise. > (regcache_cooked_write_part): Likewise. > * regcache.h (regcache_cooked_read_part): Likewise. > (regcache_cooked_write_part): Likewise. > * remote.c (remote_write_bytes_aux): Expand parameter len to > LONGEST. > (remote_write_bytes): Likewise. > (remote_region_ok_for_hw_watchpoint): Likewise. > * rl78-tdep.c (rl78_push_dummy_call): Expand len, > container_len to ULONGEST. > * rs6000-aix-tdep.c (rs6000_push_dummy_call): Expand len to > ULONGEST. > (ran_out_of_registers_for_arguments): Expand space, jj to > ULONGEST. > * s390-tdep.c (s390_value_from_register): Eliminate single use > variable len. > (s390_function_arg_pass_by_reference): Likewise. > (s390_function_arg_float): Eliminate single-use variable > length. (s390_push_dummy_call): Likewise. Expand length to ULONGEST. > (s390_frame_align): Eliminate single-us variable length. > (s390_return_value): Expand length to ULONGEST. > * score-tdep.c (score_push_dummy_call): Expand arglen to > ULONGEST. > * sh-tdep.c (sh_extract_return_value_nofpu): Epand len to > ULONGEST. > (sh_store_return_value_nofpu): Likewise. > * sh64-tdep.c (sh64_push_dummy_call): Expand stack_offset, > stack_alloc, len to ULONGEST. > (sh64_extract_return_value): Expand len to ULONGEST. > (sh64_store_return_value): Likewise. > * sparc-tdep.c (sparc32_store_arguments): Likewise. > * sparc64-tdep.c (sparc64_store_floating_fields): Expand > parameter bitpos to LONGEST. Expand subpos to LONGEST. > (sparc64_extract_floating_fields): Likewise. > (sparc64_store_arguments): Expand len to ULONGEST. > * spu-tdep.c (spu_value_from_register): Likewise. > * stack.c (read_frame_arg): Expand len, len_deref to ULONGEST. > (print_frame_args): Expand current_offset, arg_size to > ULONGEST. > * symfile-mem.c (symfile_target_read_memory): New > function. Wrap around target_read_memory. > (symbol_file_add_from_memory): Use symfile_target_read_memory. > * symmisc.c (print_symbol): Expand i to ULONGEST. Use > pulongest to format print TYPE_LENGTH. > * target.c (target_read_memory): Expand parameter len to > LONGEST. > (target_read_stack): Likewise. > (target_write_memory): Likewise. > (target_write_raw_memory): Likewise. > (default_region_ok_for_hw_watchpoint): Likewise. > (debug_to_region_ok_for_hw_watchpoint): Likewise. > * target.h (struct target_ops): Expand parameter len to > LONGEST for to_region_ok_for_hw_watchpoint. > (target_read_memory): Expand parameter len to LONGEST. > (target_read_stack): Likewise. > (target_write_memory): Likewise. > (target_write_raw_memory): Likewise. > * tracepoint.c (collect_symbol): Expand len to ULONGEST. > (encode_actions_1): Make addr as CORE_ADDR. Expand len to > ULONGEST. > (scope_info): Expand j to ULONGEST. Use pulongest to format > print TYPE_LENGTH. > * typeprint.c (whatis_exp): Expand top to LONGEST. > * v850-tdep.c (v850_push_dummy_call): Expand len to ULONGEST. > (v850_extract_return_value): Expand len to LONGEST. > (v850_store_return_value): Expand len to ULONGEST. > * valarith.c (value_subscripted_rvalue): Expand elt_size, > elt_offs to ULONGEST. > (value_binop): Expand len to LONGEST. > (value_logical_not): Expand len1, len2 to LONGEST. > * valops.c (value_allocate_space_in_inferior): Expand > parameter len to ULONGEST. Use value_from_ulongest to get the > value for len. > (value_cast_structs): Expand top to LONGEST. > (value_cast): Expand val_length, element_length to ULONGEST. > (dynamic_cast_check_1): Expand parameter embedded_offset to > LONGEST. Expand offset to LONGEST. > (dynamic_cast_check_2): Likewise. > (value_dynamic_cast): Expand top to LONGEST. > (value_fetch_lazy): Expand length to ULONGEST. > (read_value_memory): Expand parameter length to ULONGEST. > (value_assign): Expand changed_len to ULONGEST. Expand offset > to LONGEST. > (value_array): Expand typelength to ULONGEST. > (search_struct_field): Expand parameter offset to LONGEST. > Expand new_offset, boffset to LONGEST. > (search_struct_method): Expand parameter offset to LONGEST. > Expand base_offset, this_offset to LONGEST. > (find_method_list): Expand parameter offset to LONGEST, > parameter boffset to LONGEST *. Expand base_offset to > LONGEST. (value_find_oload_method_list): Expand parameter boffset to > LONGEST *. > (find_overload_match): Expand boffset to LONGEST. > (value_struct_elt_for_reference): Expand parameter offset to > LONGEST. Expand base_offset to LONGEST. > (value_rtti_indirect_type): Expand parameter top to LONGEST *. > (value_full_object): Expand parameter xtop to LONGEST. Expand > top to LONGEST. > * valprint.c (valprint_check_validity): Expand parameter > embedded_offset to LONGEST. > (generic_val_print): Likewise. > (val_print): Likewise. > (val_print_scalar_formatted): Likewise. > (print_hex_chars): Expand parameter len to ULONGEST. > (val_print_array_elements): Expand parameter embedded_offset > to LONGEST. Expand len, eltlen to ULONGEST. > (generic_printstr): Expand parameter length to ULONGEST. > * valprint.h (val_print_array_elements): Expand parameter > embedded_offset to LONGEST. > (val_print_scalar_formatted): Likewise. > (print_hex_chars): Expand parameter len to ULONGEST. > (generic_val_print): Expand parameter embedded_offset to > LONGEST. (generic_printstr): Expand parameter length to > ULONGEST. > * value.c (struct range): Expand member offset to LONGEST. > Expand member length to ULONGEST. > (ranges_overlap): Expand parameters offset1, offset2 to > LONGEST. Expand parameters len1, len2 to ULONGEST. > (range_contain): Expand parameter offset to LONGEST. Expand > parameter length to ULONGEST. > (struct value): Expand members offset, embedded_offset, > pointed_to_offset to LONGEST. > (value_bytes_available): Expand parameter offset to LONGEST, > parameter length to ULONGEST. > (mark_value_bytes_unavailable): Likewise. > (find_first_range_overlap): Likewise. > (value_available_contents_eq): Expand parameters offset1, > offset2 to LONGEST. Expand parameter length to ULONGEST. > (value_offset): Return LONGEST. > (set_value_offset): Expand parameter offset to LONGEST. > (value_contents_copy_raw): Expand parameters src_offset, > dst_offset to LONGEST. Expand parameters length to ULONGEST. > (value_contents_copy): Likewise. > (value_contents_equal): Expand len to ULONGEST. > (value_bits_valid): Expand parameter offset to LONGEST, length > to ULONGEST. > (value_bits_synthetic_pointer): Likewise. > (value_embedded_offset): Return LONGEST. > (set_value_embedded_offset): Expand parameter val to LONGEST. > (value_pointed_to_offset): Return LONGEST. > (set_value_pointed_to_offset): Expand parameter val to > LONGEST. (set_internalvar_component): Expand parameter offset to > LONGEST. (value_primitive_field): Likewise. Expand bitpos, boffset to > LONGEST, container_bitpos to ULONGEST. > (value_fn_field): Expand parameter offset to LONGEST. > (unpack_value_bits_as_long_1): Expand parameters > embedded_offset, bitpos to LONGEST. Expand read_offset to > LONGEST. (unpack_value_bits_as_long): Expand parameter > embeded_offset to LONGEST. > (unpack_value_field_as_long_1): Likewise. Expand bitpos to > LONGEST. > (unpack_value_field_as_long): Expand parameter embedded_offset > to LONGEST. > (value_field_bitfield): Likewise. > (modify_field): Expand parameter bitpos to LONGEST. Expand > bytesize to ULONGEST. > * value.h (value_offset): Return LONGEST. > (set_value_offset): Expand parameter offset to LONGEST. > (value_pointed_to_offset): Return LONGEST. > (set_value_pointed_to_offset): Expand parameter val to > LONGEST. (value_embedded_offset): Return LONGEST. > (set_value_embedded_offset): Expand parameter val to LONGEST. > (struct lval_funcs): Expand parameter offset to LONGEST, > length to ULONGEST for check_validity. Likewise for > check_synthetic_pointer. > (valprint_check_validity): Expand parameter embedded_offset to > LONGEST. > (value_bits_valid): Expand parameter offset to LONGEST, length > to ULONGEST. > (value_bits_synthetic_pointer): Likewise. > (mark_value_bytes_unavailable): Expand parameter offset to > LONGEST, parameter length to ULONGEST. > (value_available_contents_eq): Expand parameters offset1, > offset2 to LONGEST. Expand parameter length to ULONGEST. > (read_value_memory): Expand parameter length to ULONGEST. > (unpack_value_bits_as_long): Expand parameter embeded_offset > to LONGEST. > (unpack_value_field_as_long): Likewise. > (value_field_bitfield): Likewise. > (value_contents_copy_raw): Expand parameters src_offset, > dst_offset to LONGEST. Expand parameters length to ULONGEST. > (value_contents_copy): Likewise. > (value_find_oload_method_list): Expand parameter boffset to > LONGEST *. > (value_primitive_field): Expand parameter offset to LONGEST. > (value_rtti_indirect_type): Expand parameter top to LONGEST *. > (value_full_object): Expand parameter xtop to LONGEST. > (set_internalvar_component): Expand parameter offset to > LONGEST. (value_fn_field): Expand parameter offset to LONGEST. > (modify_field): Expand parameter bitpos to LONGEST. > (val_print): Expand parameter embedded_offset to LONGEST. > (value_allocate_space_in_inferior): Expand parameter len to > ULONGEST. > * vax-tdep.c (vax_store_arguments): Expand count, len to > ULONGEST. > (vax_return_value): Expand len to ULONGEST. > * xstormy16-tdep.c (xstormy16_extract_return_value): Expand > len, i to ULONGEST. > (xstormy16_store_return_value): Likewise. > (xstormy16_push_dummy_call): Expand j to LONGEST, typelen to > ULONGEST. > (xstormy16_push_dummy_call): > * xtensa-tdep.c (xtensa_extract_return_value): Expand len to > ULONGEST. Use pulongest to format print len. > (xtensa_store_return_value): Likewise. > (xtensa_push_dummy_call): Expand size, onstack_size, length to > ULONGEST. Expand offset to LONGEST. Use pulongest to format > print TYPE_LENGTH. > > testsuite/ChangeLog: > > 2012-05-04 Siddhesh Poyarekar <siddhesh@redhat.com> > > * gdb.base/structs-longest-bitpos.c: New test case. > * gdb.base/structs-longest-bitpos.exp: New test case. ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: ping: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-15 9:46 ` ping: " Siddhesh Poyarekar @ 2012-05-15 9:49 ` Jan Kratochvil 2012-05-15 10:02 ` Siddhesh Poyarekar 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-05-15 9:49 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey On Tue, 15 May 2012 11:46:12 +0200, Siddhesh Poyarekar wrote: > Ping? I am already working on it, it is very long. BTW it needs one chunk rebase to HEAD and there is also one small pulongest issue - build failure - on 32-bit hosts. But otherwise I do not have other results yet. I expect you were checking it by splint again, I have not run it yet for this patch. Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: ping: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-15 9:49 ` Jan Kratochvil @ 2012-05-15 10:02 ` Siddhesh Poyarekar 0 siblings, 0 replies; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-05-15 10:02 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey On Tue, 15 May 2012 11:48:54 +0200, Jan wrote: > On Tue, 15 May 2012 11:46:12 +0200, Siddhesh Poyarekar wrote: > > Ping? > > I am already working on it, it is very long. BTW it needs one chunk > rebase to HEAD and there is also one small pulongest issue - build > failure - on 32-bit hosts. But otherwise I do not have other results > yet. > > I expect you were checking it by splint again, I have not run it yet > for this patch. > Thanks, yes I did check this using splint, specifically the diff with and without this patch. -- Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-04 13:10 ` [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST Siddhesh Poyarekar 2012-05-15 9:46 ` ping: " Siddhesh Poyarekar @ 2012-05-15 20:07 ` Jan Kratochvil 2012-05-16 3:50 ` Siddhesh Poyarekar 2012-05-23 13:52 ` Siddhesh Poyarekar 1 sibling, 2 replies; 70+ messages in thread From: Jan Kratochvil @ 2012-05-15 20:07 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey Hi Siddhesh, while I have a local patch for it it is easier to state that: * the patch needs a small rebase to HEAD for very recent changes. * it does not compile on 32-bit i386 host OS due to %ld used for LONGEST. On Fri, 04 May 2012 15:08:58 +0200, Siddhesh Poyarekar wrote: > I have finally finished this off with a combined patch to expand bitpos > to LONGEST and type.length to ULONGEST. Therefore: > - int bitpos; > + LONGEST bitpos; + > - unsigned length; > + ULONGEST length; > This however is not possible anyway, since bitpos may be negative for > vtable offsets and as a result, I have extended bitpos to LONGEST in > this patch. In such case I think we can keep signedness for all the changes. While one may consider more clean to use unsigned types in some cases it can bring unexpected regressions, for example in amd64_push_arguments you correctly changed the first occurence: > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); But in other cases you use ULONGEST. In this case ULONGEST would be a regression as there is below: for (j = 0; len > 0; j++, len -= 8) If you have carefully checked all the signedness changes for possible regressions I will re-review it. Still it seems to me unrelated to this patch (and possibly not worth the effort, YMMV). Or did you see some specific splint warnings for it? I have marked in this patch such lines by ^X$. I understand changing to patch to keep the signedness looks like worsening the patch. I am sorry this misunderstanding happened, if it was cleared up in advanced it would save a lot of work. If you would like to do some signedness cleanups it should be posted as a separate patch for review. There are some target_ memory reads where size_t makes sense. Also bfd/ should use size_t and not int for the memory read sizes. Thanks, Jan > gdb/ChangeLog > > 2012-05-04 Siddhesh Poyarekar <siddhesh@redhat.com> Formatting has double spaces: 2012-05-04 Siddhesh Poyarekar <siddhesh@redhat.com> > > * ada-lang.c (fat_pntr_bounds_bitpos): Return LONGEST. > (fat_pntr_data_bitpos): Likewise. > (desc_bound_bitpos): Likewise. > (constrained_packed_array_type): Expand elt_bits parameter to > LONGEST. > (move_bits): Expand parameters src_offset and n to ULONGEST. > (ada_index_struct_field): Expand parameters index and offset to > LONGEST. > (cond_offset_host): Expand parameter offset to LONGEST. > (cond_offset_target): Likewise. > (ada_type_of_array): Expand array_bitsize to LONGEST. > (decode_constrained_packed_array_type): Expand bits to ULONGEST. > (decode_constrained_packed_array): Expand bit_pos to LONGEST. > (ada_value_primitive_packed_val): Expand parameter offset to > LONGEST. Expand targ to LONGEST and ntarg to ULONGEST. I think it should be 'LONGEST. Expand' (double space). Many times here. > (ada_value_assign): Expand from_size to ULONGEST. > (value_assign_to_component): Expand bits to ULONGEST. > (ensure_lval): Expand len to ULONGEST. > (value_pointer): Likewise. > (value_tag_from_contents_and_address): Expand tag_byte_offset to > LONGEST. > (ada_value_primitive_field): Expand parameter offset to LONGEST. > Expand bit_pos to LONGEST. > (find_struct_field): Expand parameters offset and byte_offset_p > to LONGEST. Expand bit_pos and fld_offset to LONGEST. > (ada_search_struct_field): Expand parameter offset to LONGEST. > Expand var_offset to LONGEST. > (ada_index_struct_field): Expand parameters index and offset to > LONGEST. > (ada_index_struct_field_1): Expand parameters index_p and offset > to LONGEST. > (ada_value_struct_elt): Expand byte_offset to LONGEST. > (align_value): Return ULONGEST. Expand parameter off to LONGEST > and alignment to ULONGEST. > (ada_template_to_fixed_record_type_1): Expand off, bit_len and > fld_bit_len to ULONGEST. Expand field_offset to LONGEST. Use > pulongest function to print TYPE_LENGTH. > (to_fixed_array_type): Expand len to ULONGEST. > * ada-lang.h (ada_val_print): Expand parameter embedded_offset > to LONGEST. > (ada_printstr): Expand parameter length to ULONGEST. > (ada_value_primitive_packed_val): Expand parameter offset to > LONGEST. > * ada-typeprint.c (ada_print_type): Use pulongest to print > TYPE_LENGTH. > * ada-valprint.c (val_print_packed_array_elements): Expand > eltlen to ULONGEST. > (char_at): Expand parameter i to ULONGEST. > (printstr): Expand parameter length to ULONGEST. > (ada_printstr): Likewise. > (ada_val_print): Expand embedded_offset to LONGEST. > (ada_val_print_array): Expand eltlen, len and temp_len to > ULONGEST. > (ada_val_print_1): Expand parameter offset to ULONGEST. Expand > len to ULONGEST. > (print_variant_part): Expand parameters offset and outer_offset > to LONGEST. > (print_field_values): Likewise. Expand bit_pos to LONGEST. > * alpha-tdep.c (struct alpha_arg): Expand member len to > ULONGEST. > (alpha_push_dummy_call): Expand len to ULONGEST. > (alpha_extract_return_value): Expand length to ULONGEST. > (alpha_store_return_value): Likewise. > * amd64-tdep.c (amd64_classify_aggregate): Expand len, > bitsize, endpos to ULONGEST and pos to LONGEST. > (amd64_classify): Expand len to ULONGEST. > (amd64_return_value): Expand len to LONGEST. > (amd64_push_arguments): Expand num_elements, element to ULONGEST > and len to LONGEST. > (amd64_get_longjmp_target): Expand len to ULONGEST. > * amd64-windows-tdep.c (amd64_windows_return_value): Expand > len to LONGEST. > * arm-tdep.c (arm_push_dummy_call): Expand len to LONGEST. > (arm_extract_return_value): Expand len to ULONGEST. > (arm_store_return_value): Likewise. > * avr-tdep.c (avr_return_value): Expand i to ULONGEST. > (push_stack_item): Expand parameter len to ULONGEST. > (avr_push_dummy_call): Expand last_regnum, len to ULONGEST. > * ax-gdb.c (gen_trace_static_fields): Expand length to > ULONGEST. > (gen_traced_pop): Likewise. > (gen_left_shift): Expand parameter distance to LONGEST. > (gen_offset): Expand parameter offset to LONGEST. > (gen_bitfield_ref): Expand parameters start, end to LONGEST. > Expand bound_start, bound_endi, offset to LONGEST. > (gen_primitive_field): Expand parameter offset to LONGEST. > (gen_struct_ref_recursive): Likewise. > * bfin-tdep.c (bfin_push_dummy_call): Expand total_len, len, > container_len to ULONGEST. > (bfin_extract_return_value): Expand len to LONGEST. > (bfin_store_return_value): Likewise. > * breakpoint.c (update_watchpoint): Expand len to ULONGEST. > (can_use_hardware_watchpoint): Likewise. > (invalidate_bp_value_on_memory_change): Expand parameter len to > LONGEST. > * breakpoint.h (struct bp_location): Expand member length to > ULONGEST. > * c-lang.c (c_printstr): Expand parameter length to ULONGEST. > Remove unused variable width. This should be a separate patch, unrelated to this one. Obvious for commit. > (evaluate_subexp_c): Expand element_size, i to ULONGEST. > * c-lang.h (c_val_print): Expand parameter embedded_offset to > LONGEST. > (c_printstr): Expand parameter length to ULONGEST. > (cp_print_value_fields): Expand parameter offset to LONGEST. > (cp_print_value_fields_rtti): Likewise. > * c-typeprint.c (c_type_print_varspec_suffix): Remove cast > down to int and use pulongest to print ULONGEST. > * c-valprint.c (c_val_print): Expand parameter embedded_offset > to LONGEST. Expand offset to LONGEST, eltlen to ULONGEST. > (c_value_print): Expand top to LONGEST. > * corefile.c (read_memory): Expand len to ULONGEST. > (read_stack): Likewise. > (write_memory): Likewise. > * cp-abi.c (baseclass_offset): Return LONGEST. Expand > parameter embedded_offset to LONGEST. Expand res to LONGEST. > (value_virtual_fn_field): Expand parameter offset to LONGEST. > (value_rtti_type): Expand parameter top to LONGEST *. > * cp-abi.h (value_virtual_fn_field): Expand offset to LONGEST. > (value_rtti_type): Expand top to LONGEST *. > (baseclass_offset): Return LONGEST. Expand parameter > embedded_offset to LONGEST. > (struct cp_abi_ops): Expand parameter offset for > virtual_fn_field to LONGEST. Expand parameter top to LONGEST > * in value_rtti_type. Return LONGEST from baseclass_offset Bogus '*' character. > and expand parameter for embedded_offset to LONGEST. > * cp-valprint.c (cp_print_value_fields): Expand parameter > offset to LONGEST. > (cp_print_value_fields_rtti): Likewise. Expand top to LONGEST. > (cp_print_value): Expand parameter offset to LONGEST. Expand > thisoffset, boffset to LONGEST. > (cp_find_class_member): Expand bitsize to ULONGEST. > * cris-tdep.c (push_stack_item): Expand parameter len to > ULONGEST. > (cris_push_dummy_call): Expand len, reg_demand, i to ULONGEST. > (cris_store_return_value): Expand len to ULONGEST. > (cris_extract_return_value): Likewise. > * d-lang.h (d_val_print): Expand parameter embedded_offset to > LONGEST. > * d-valprint.c (dynamic_array_type): Likewise. > (d_val_print): Likewise. > * doc/observer.texi (memory_changed): Expand parameter len to > LONGEST. doc/ has its own separate ChangeLog file. > * doublest.c (floatformat_from_length): Likewise. Use > pulongest to format string for ULONGEST. > * dwarf2loc.c (copy_bitwise): Expand parameters > dest_offset_bits, bit_count to ULONGEST. Rename parameter > source_offset_bits to source_offset and expand to ULONGEST. New > variable source_offset_bits. > (read_pieced_value): Expand offset, dest_offset_bits, > source_offset_bits, source_offset to LONGEST. Expand type_len, > this_size, this_size_bits to ULONGEST. > (write_pieced_value): Expand type_len, this_size, this_size_bits > to ULONGEST. Expand dest_offset_bits, source_offset_bits, > dest_offset, source_offset to LONGEST. > (check_pieced_value_bits): Expand parameter bit_length to > ULONGEST. > (check_pieced_value_validity): Likewise. > (check_pieced_synthetic_pointer): Likewise. > (indirect_pieced_value): Expand bit_length to ULONGEST. Expand > bit_offset to LONGEST. > (dwarf2_evaluate_loc_desc_full): Expand n to ULONGEST. > * dwarf2read.c (struct dwarf_block): ULONGEST size. This description is not a sentence. > (dwarf2_const_value_length_mismatch_complaint): Expand > parameters arg2 and arg3 to ULONGEST. Use pulongest to print > arg2 and arg3. (dwarf2_add_field): Expand anonymous size to Opening parenthesis should be at the beginning of a line. > ULONGEST. (dump_die_shallow): Use pulongest to print And here again and I see more occurences below. > dwarf_block.size. > * eval.c (evaluate_struct_tuple): Expand bitpos to LONGEST. > (init_array_element): Expand element_size to ULONGEST. > (binop_promote): Expand promoted_len1, promoted_len2, result_len > to ULONGEST. > (evaluate_subexp_standard): Expand mem_offset, top to LONGEST. > Expand element_size to ULONGEST. > * f-lang.c (f_printstr): Expand parameter length to ULONGEST. > * f-lang.h (f_val_print): Expand parameter embedded_offset to > LONGEST. > * f-valprint.c (f77_array_offset_tbl): Make LONGEST. > (f77_create_arrayprint_offset_tbl): Expand eltlen to ULONGEST. > (f77_print_array_1): Expand parameter embedded_offset to > LONGEST. (f77_print_array): Likewise. > (f_val_print): Likewise. Expand offset to LONGEST. > * findcmd.c (parse_find_args): Expand val_bytes to ULONGEST. > * findvar.c (extract_unsigned_integer): Remove unnecessary > cast. > (default_read_var_value): Expand len to ULONGEST. > (default_value_from_register): Likewise. > (read_frame_register_value): Expand offset, reg_offset to > LONGEST. Expand len, reg_len to ULONGEST. > * frv-tdep.c (frv_extract_return_value): Expand len to > ULONGEST. Use pulongest to format print len. > (frv_push_dummy_call): Expand len to ULONGEST. > (frv_store_return_value): Likewise. Use pulongest to format > print len. > * gdbcore.h (read_memory): Expand parameter len to ULONGEST. > (read_stack): Likewise. > (write_memory): Likewise. > * gdbtypes.c (init_type): Expand parameter length to ULONGEST. > (is_unique_ancestor_worker): Expand parameters offset, > embedded_offset to LONGEST. Expand this_offset to LONGEST. > (recursive_dump_type): Use pulongest to format print > TYPE_LENGTH. Use plongest to format print TYPE_FIELD_BITPOS. > (arch_type): Expand parameter length to ULONGEST. > * gdbtypes.h (type.main_type.fld_bnds.fields): Expand bitpos > to LONGEST. > (type): Expand length to ULONGEST. > (init_type): Expand parameter length to ULONGEST. > (arch_type): Likewise. > * gnu-v2-abi.c (gnuv2_virtual_fn_field): Expand parameter > offset to LONGEST. > (gnuv2_value_rtti_type): Expand parameter top to LONGEST *. > (gnuv2_baseclass_offset): Return LONGEST. Expand parameter > embedded_offset to LONGEST. Expand field_offset, boffset to > LONGEST, field_length to ULONGEST. > * gnu-v3-abi.c (build_gdb_vtable_type): Expand offset to > LONGEST. > (vtable_address_point_offset): Return LONGEST. > (gnuv3_rtti_type): Expand parameter top_p to LONGEST *. > (gnuv3_virtual_fn_field): Expand parameter offset to LONGEST. > (gnuv3_baseclass_offset): Return LONGEST. Expand parameter > embedded_ofset to LONGEST. Expand cur_base_offset, base_offset > to LONGEST. > (gnuv3_find_method_in): Expand pos to LONGEST. > * go-lang.h (go_val_print): Expand parameter embedded_offset > to LONGEST. > * go-valprint.c (go_val_print): Likewise. > * h8300-tdep.c (h8300_push_dummy_call): Expand stack_alloc, > stack_offset, len, padded_len, offset to LONGEST. > * hppa-tdep.c (hppa64_push_dummy_call): Expand len to > ULONGEST. > (hppa64_return_value): Likewise. > * i386-darwin-tdep.c (i386_darwin_arg_type_alignment): Return > ULONGEST. Expand res to ULONGEST. > (i386_darwin_push_dummy_call): Expand arg_spaces, len, align to > ULONGEST. > * i386-nat.c (i386_handle_nonaligned_watchpoint): Expand > parameter len to ULONGEST. > (i386_region_ok_for_watchpoint): Expand parameter len to > LONGEST. > * i386-tdep.c (i386_push_dummy_call): Expand arg_space, > arg_space_used, len to ULONGEST. > (i386_extract_return_value): Expand len to ULONGEST. Use > pulongest to format print len. > (i386_store_return_value): Likewise. > * ia64-tdep.c (ia64_extract_return_value): Expand n to > ULONGEST. > (ia64_store_return_value): Likewise. > (ia64_push_dummy_call): Expand argoffset, len, nslots, memslots > to ULONGEST. > * infcall.c (call_function_by_hand): Expand len to ULONGEST. > * infrun.c (save_infcall_suspend_state): Expand len to > ULONGEST. > (restore_infcall_suspend_state): Eliminate single-use variable > len. > * iq2000-tdep.c (iq2000_store_return_value): Expand len to > ULONGEST. > (iq2000_extract_return_value): Likewise. Use len instead of > TYPE_LENGTH. > (iq2000_push_dummy_call): Expand typelen, stackspace to > ULONGEST. > * jv-lang.c (java_link_class_type): Expand boffset to LONGEST. > (java_printstr): Expand parameter length to ULONGEST. > * jv-lang.h (java_val_print): Expand parameter embedded_offset > to LONGEST. > * jv-valprint.c (java_print_value_fields): Expand parameter > offset to LONGEST. > (java_val_print): Expand parameter embedded_offset to LONGEST. > * language.c (unk_lang_printstr): Expand parameter length to > ULONGEST. > (unk_lang_val_print): Expand parameter embedded_offset to > LONGEST. > * language.h (language_defn): Expand parameter length of > la_printstr to ULONGEST. Expand parameter embedded_offset of > la_val_print to LONGEST. > * lm32-tdep.c (lm32_push_dummy_call): Expand len to ULONGEST. > (lm32_store_return_value): Likewise. > * m2-lang.c (m2_printstr): Expand parameter length to > ULONGEST. > * m2-lang.h (m2_val_print): Expand parameter embedded_offset > to ULONGEST. > * m2-typeprint.c (m2_array): Use pulongest to print > TYPE_LENGTH. > (m2_enum): expand lastval to LONGEST. > * m2-valprint.c (m2_print_long_set): Expand parameter > embedded_offset to LONGEST. > (m2_print_unbounded_array): Likewise. > (m2_print_array_contents): Likewise. Eliminate eltlen and use > TYPE_LENGTH directly. > (m2_val_print): Expand parameter embedded_offset to LONGEST. > Expand i, len, temp_len to ULONGEST. Remove eltlen, use > TYPE_LENGTH directly. > * m32r-tdep.c (m32r_push_dummy_call): Expand len to ULONGEST. > (m32r_extract_return_value): Likewise. > * m68hc11-tdep.c (m68hc11_push_dummy_call): Expand len to > ULONGEST. > (m68hc11_store_return_value): Likewise. > * m68k-tdep.c (m68k_extract_return_value): Expand len to > ULONGEST. Use pulongest to format print len. > (m68k_svr4_extract_return_value): Replace single-use variable > len with TYPE_LENGTH. > (m68k_store_return_value): Expand len to ULONGEST. Use pulongest > to format print len. > (m68k_svr4_store_return_value): Replace single-use variable len > with TYPE_LENGTH. > (m68k_push_dummy_call): Expand len, container_len, offset to > ULONGEST. > * m88k-tdep.c (m88k_store_arguments): Expand > num_register_words, num_stack_words, len to ULONGEST. > (m88k_return_value): Expand len to ULONGEST. > * memrange.c (mem_ranges_overlap): Expand parameters len1, > len2 to ULONGEST. > * memrange.h (struct mem_range): Expand member length to > ULONGEST. > (mem_ranges_overlap): Expand parameters len1, len2 to ULONGEST. > * mep-tdep.c (push_large_arguments): Expand arg_len to > ULONGEST. > (mep_push_dummy_call): Expand arg_size to ULONGEST. > * microblaze-tdep.c (microblaze_store_return_value): Expand > len to ULONGEST. > * mips-tdep.c (mips_xfer_register): Expand parameter > buf_offset to LONGEST. Use plongest to format print buf_offset. > (mips_eabi_push_dummy_call): Expand len to ULONGEST. Use > pulongest to format print len. > (mips_n32n64_fp_arg_chunk_p): Expand parameter offset to > LONGEST. Expand pos to LONGEST. > (mips_n32n64_return_value): Expand offset to LONGEST. Use > plongest to format print offset. > (mips_o32_push_dummy_call): Expand len to ULONGEST. Eliminate > single-use variable arglen. Use pulongest to format print len. > (mips_o64_push_dummy_call): Expand len, stack_offset to > ULONGEST. Eliminate single-use variable arglen. use pulongest Capitalize 'use'. > to format print len. > * mn10300-tdep.c (mn10300_type_align): Return ULONGEST. > Expand align, falign to ULONGEST. > (mn10300_push_dummy_call): Expand len, arg_len to ULONGEST. > * moxie-tdep.c (moxie_store_return_value): Expand len to > ULONGEST. > (moxie_extract_return_value): Likewise. > * mt-tdep.c (mt_push_dummy_call): Expand stack_dest, typelen > to ULONGEST. > * objc-lang.c (objc_printstr): Expand parameter length to > ULONGEST. > * opencl-lang.c (lookup_opencl_vector_type): Expand parameter > el_length to ULONGEST. Expand length to ULONGEST. > (lval_func_read): Expand offset, n, i, j to LONGEST. Expand > elsize to ULONGEST. > (lval_func_write): Likewise. > (lval_func_check_validity): Expand parameter length to ULONGEST. > Expand elsize to ULONGEST. Expand start, end, i to LONGEST. > (lval_func_check_any_valid): Expand elsize to ULONGEST. > (lval_func_check_synthetic_pointer): Expand parameter offset to > LONGEST. Expand parameter length to ULONGEST. Expand elsize to > ULONGEST. Expand start, end, i to LONGEST. > * p-lang.c (is_pascal_string_type): Expand parameter > length_pos, string_pos to LONGEST *. Expand parameter > length_size to ULONGEST *. > (pascal_printstr): Expand parameter length to ULONGEST. > * p-lang.h (pascal_val_print): Expand parameter > embedded_offset to LONGEST. > (is_pascal_string_type): Expand parameter length_pos, string_pos > to LONGEST *. Expand parameter length_size to ULONGEST *. > (pascal_printstr): Expand parameter length to ULONGEST. > (pascal_object_print_value_fields): Expand parameter offset to > LONGEST. > * p-typeprint.c (pascal_type_print_base): Expand lastval to > LONGEST. > * p-valprint.c (pascal_val_print): Expand parameter > embedded_offset to LONGEST. Expand eltlen, length_size to > ULONGEST. Expand length_pos, string_pos to LONGEST. > (pascal_object_print_value_fields): Expand parameter offset to > LONGEST. > (pascal_object_print_value): Likewise. Expand boffset, > thisoffset to LONGEST. > * ppc-linux-nat.c (check_condition): Expand parameter len to > ULONGEST *. > * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Expand > argoffset, structoffset, len, i, nelt to ULONGEST. > (do_ppc_sysv_return_value): Expand i, nelt, offset to ULONGEST. > (ppc64_sysv_abi_push_dummy_call): Expand len to ULONGEST. > (ppc64_sysv_abi_return_value): Expand n_regs, i, offset to > ULONGEST. > * printcmd.c (print_formatted): Expand len to ULONGEST. > (float_type_from_length): Likewise. > (print_scalar_formatted): Likewise. > * python/py-prettyprint.c (apply_val_pretty_printer): Expand > parameter embedded_offset to LONGEST. > * python/python.h (apply_val_pretty_printer): Likewise. > * regcache.c (regcache_xfer_part): Expand parameter offset to > LONGEST. > (regcache_cooked_read_part): Likewise. > (regcache_cooked_write_part): Likewise. > * regcache.h (regcache_cooked_read_part): Likewise. > (regcache_cooked_write_part): Likewise. > * remote.c (remote_write_bytes_aux): Expand parameter len to > LONGEST. > (remote_write_bytes): Likewise. > (remote_region_ok_for_hw_watchpoint): Likewise. > * rl78-tdep.c (rl78_push_dummy_call): Expand len, > container_len to ULONGEST. > * rs6000-aix-tdep.c (rs6000_push_dummy_call): Expand len to > ULONGEST. > (ran_out_of_registers_for_arguments): Expand space, jj to > ULONGEST. > * s390-tdep.c (s390_value_from_register): Eliminate single use > variable len. > (s390_function_arg_pass_by_reference): Likewise. > (s390_function_arg_float): Eliminate single-use variable length. > (s390_push_dummy_call): Likewise. Expand length to ULONGEST. > (s390_frame_align): Eliminate single-us variable length. > (s390_return_value): Expand length to ULONGEST. > * score-tdep.c (score_push_dummy_call): Expand arglen to > ULONGEST. > * sh-tdep.c (sh_extract_return_value_nofpu): Epand len to Typo, 'Expand'. > ULONGEST. > (sh_store_return_value_nofpu): Likewise. > * sh64-tdep.c (sh64_push_dummy_call): Expand stack_offset, > stack_alloc, len to ULONGEST. > (sh64_extract_return_value): Expand len to ULONGEST. > (sh64_store_return_value): Likewise. > * sparc-tdep.c (sparc32_store_arguments): Likewise. > * sparc64-tdep.c (sparc64_store_floating_fields): Expand > parameter bitpos to LONGEST. Expand subpos to LONGEST. > (sparc64_extract_floating_fields): Likewise. > (sparc64_store_arguments): Expand len to ULONGEST. > * spu-tdep.c (spu_value_from_register): Likewise. > * stack.c (read_frame_arg): Expand len, len_deref to ULONGEST. > (print_frame_args): Expand current_offset, arg_size to ULONGEST. > * symfile-mem.c (symfile_target_read_memory): New > function. Wrap around target_read_memory. > (symbol_file_add_from_memory): Use symfile_target_read_memory. > * symmisc.c (print_symbol): Expand i to ULONGEST. Use > pulongest to format print TYPE_LENGTH. > * target.c (target_read_memory): Expand parameter len to > LONGEST. > (target_read_stack): Likewise. > (target_write_memory): Likewise. > (target_write_raw_memory): Likewise. > (default_region_ok_for_hw_watchpoint): Likewise. > (debug_to_region_ok_for_hw_watchpoint): Likewise. > * target.h (struct target_ops): Expand parameter len to > LONGEST for to_region_ok_for_hw_watchpoint. > (target_read_memory): Expand parameter len to LONGEST. > (target_read_stack): Likewise. > (target_write_memory): Likewise. > (target_write_raw_memory): Likewise. > * tracepoint.c (collect_symbol): Expand len to ULONGEST. > (encode_actions_1): Make addr as CORE_ADDR. Expand len to > ULONGEST. > (scope_info): Expand j to ULONGEST. Use pulongest to format > print TYPE_LENGTH. Excessive indentation. Many times below. > * typeprint.c (whatis_exp): Expand top to LONGEST. > * v850-tdep.c (v850_push_dummy_call): Expand len to ULONGEST. > (v850_extract_return_value): Expand len to LONGEST. > (v850_store_return_value): Expand len to ULONGEST. > * valarith.c (value_subscripted_rvalue): Expand elt_size, > elt_offs to ULONGEST. > (value_binop): Expand len to LONGEST. > (value_logical_not): Expand len1, len2 to LONGEST. > * valops.c (value_allocate_space_in_inferior): Expand > parameter len to ULONGEST. Use value_from_ulongest to get the > value for len. > (value_cast_structs): Expand top to LONGEST. > (value_cast): Expand val_length, element_length to ULONGEST. > (dynamic_cast_check_1): Expand parameter embedded_offset to > LONGEST. Expand offset to LONGEST. > (dynamic_cast_check_2): Likewise. > (value_dynamic_cast): Expand top to LONGEST. > (value_fetch_lazy): Expand length to ULONGEST. > (read_value_memory): Expand parameter length to ULONGEST. > (value_assign): Expand changed_len to ULONGEST. Expand offset to > LONGEST. > (value_array): Expand typelength to ULONGEST. > (search_struct_field): Expand parameter offset to LONGEST. > Expand new_offset, boffset to LONGEST. > (search_struct_method): Expand parameter offset to LONGEST. > Expand base_offset, this_offset to LONGEST. > (find_method_list): Expand parameter offset to LONGEST, > parameter boffset to LONGEST *. Expand base_offset to LONGEST. > (value_find_oload_method_list): Expand parameter boffset to > LONGEST *. > (find_overload_match): Expand boffset to LONGEST. > (value_struct_elt_for_reference): Expand parameter offset to > LONGEST. Expand base_offset to LONGEST. > (value_rtti_indirect_type): Expand parameter top to LONGEST *. > (value_full_object): Expand parameter xtop to LONGEST. Expand > top to LONGEST. > * valprint.c (valprint_check_validity): Expand parameter > embedded_offset to LONGEST. > (generic_val_print): Likewise. > (val_print): Likewise. > (val_print_scalar_formatted): Likewise. > (print_hex_chars): Expand parameter len to ULONGEST. > (val_print_array_elements): Expand parameter embedded_offset to > LONGEST. Expand len, eltlen to ULONGEST. > (generic_printstr): Expand parameter length to ULONGEST. > * valprint.h (val_print_array_elements): Expand parameter > embedded_offset to LONGEST. > (val_print_scalar_formatted): Likewise. > (print_hex_chars): Expand parameter len to ULONGEST. > (generic_val_print): Expand parameter embedded_offset to > LONGEST. (generic_printstr): Expand parameter length to Again, indentation and '(' not at the first column. > ULONGEST. > * value.c (struct range): Expand member offset to LONGEST. > Expand member length to ULONGEST. > (ranges_overlap): Expand parameters offset1, offset2 to LONGEST. > Expand parameters len1, len2 to ULONGEST. > (range_contain): Expand parameter offset to LONGEST. Expand > parameter length to ULONGEST. > (struct value): Expand members offset, embedded_offset, > pointed_to_offset to LONGEST. > (value_bytes_available): Expand parameter offset to LONGEST, > parameter length to ULONGEST. > (mark_value_bytes_unavailable): Likewise. > (find_first_range_overlap): Likewise. > (value_available_contents_eq): Expand parameters offset1, > offset2 to LONGEST. Expand parameter length to ULONGEST. > (value_offset): Return LONGEST. > (set_value_offset): Expand parameter offset to LONGEST. > (value_contents_copy_raw): Expand parameters src_offset, > dst_offset to LONGEST. Expand parameters length to ULONGEST. > (value_contents_copy): Likewise. > (value_contents_equal): Expand len to ULONGEST. > (value_bits_valid): Expand parameter offset to LONGEST, length > to ULONGEST. > (value_bits_synthetic_pointer): Likewise. > (value_embedded_offset): Return LONGEST. > (set_value_embedded_offset): Expand parameter val to LONGEST. > (value_pointed_to_offset): Return LONGEST. > (set_value_pointed_to_offset): Expand parameter val to LONGEST. > (set_internalvar_component): Expand parameter offset to LONGEST. > (value_primitive_field): Likewise. Expand bitpos, boffset to > LONGEST, container_bitpos to ULONGEST. > (value_fn_field): Expand parameter offset to LONGEST. > (unpack_value_bits_as_long_1): Expand parameters > embedded_offset, bitpos to LONGEST. Expand read_offset to > LONGEST. (unpack_value_bits_as_long): Expand parameter > embeded_offset to LONGEST. > (unpack_value_field_as_long_1): Likewise. Expand bitpos to > LONGEST. > (unpack_value_field_as_long): Expand parameter embedded_offset > to LONGEST. > (value_field_bitfield): Likewise. > (modify_field): Expand parameter bitpos to LONGEST. Expand > bytesize to ULONGEST. > * value.h (value_offset): Return LONGEST. > (set_value_offset): Expand parameter offset to LONGEST. > (value_pointed_to_offset): Return LONGEST. > (set_value_pointed_to_offset): Expand parameter val to LONGEST. > (value_embedded_offset): Return LONGEST. > (set_value_embedded_offset): Expand parameter val to LONGEST. > (struct lval_funcs): Expand parameter offset to LONGEST, length > to ULONGEST for check_validity. Likewise for > check_synthetic_pointer. > (valprint_check_validity): Expand parameter embedded_offset to > LONGEST. > (value_bits_valid): Expand parameter offset to LONGEST, length > to ULONGEST. > (value_bits_synthetic_pointer): Likewise. > (mark_value_bytes_unavailable): Expand parameter offset to > LONGEST, parameter length to ULONGEST. > (value_available_contents_eq): Expand parameters offset1, > offset2 to LONGEST. Expand parameter length to ULONGEST. > (read_value_memory): Expand parameter length to ULONGEST. > (unpack_value_bits_as_long): Expand parameter embeded_offset to > LONGEST. > (unpack_value_field_as_long): Likewise. > (value_field_bitfield): Likewise. > (value_contents_copy_raw): Expand parameters src_offset, > dst_offset to LONGEST. Expand parameters length to ULONGEST. > (value_contents_copy): Likewise. > (value_find_oload_method_list): Expand parameter boffset to > LONGEST *. > (value_primitive_field): Expand parameter offset to LONGEST. > (value_rtti_indirect_type): Expand parameter top to LONGEST *. > (value_full_object): Expand parameter xtop to LONGEST. > (set_internalvar_component): Expand parameter offset to LONGEST. > (value_fn_field): Expand parameter offset to LONGEST. > (modify_field): Expand parameter bitpos to LONGEST. > (val_print): Expand parameter embedded_offset to LONGEST. > (value_allocate_space_in_inferior): Expand parameter len to > ULONGEST. > * vax-tdep.c (vax_store_arguments): Expand count, len to > ULONGEST. > (vax_return_value): Expand len to ULONGEST. > * xstormy16-tdep.c (xstormy16_extract_return_value): Expand > len, i to ULONGEST. > (xstormy16_store_return_value): Likewise. > (xstormy16_push_dummy_call): Expand j to LONGEST, typelen to > ULONGEST. > (xstormy16_push_dummy_call): > * xtensa-tdep.c (xtensa_extract_return_value): Expand len to > ULONGEST. Use pulongest to format print len. > (xtensa_store_return_value): Likewise. > (xtensa_push_dummy_call): Expand size, onstack_size, length to > ULONGEST. Expand offset to LONGEST. Use pulongest to format > print TYPE_LENGTH. > > testsuite/ChangeLog: > > 2012-05-04 Siddhesh Poyarekar <siddhesh@redhat.com> Formatting has double spaces: 2012-05-04 Siddhesh Poyarekar <siddhesh@redhat.com> > > * gdb.base/structs-longest-bitpos.c: New test case. > * gdb.base/structs-longest-bitpos.exp: New test case. > diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c > index 180fadb..4417cf1 100644 > --- a/gdb/ada-lang.c > +++ b/gdb/ada-lang.c > @@ -80,7 +80,7 @@ static struct type *desc_bounds_type (struct type *); > > static struct value *desc_bounds (struct value *); > > -static int fat_pntr_bounds_bitpos (struct type *); > +static LONGEST fat_pntr_bounds_bitpos (struct type *); > > static int fat_pntr_bounds_bitsize (struct type *); > > @@ -88,13 +88,13 @@ static struct type *desc_data_target_type (struct type *); > > static struct value *desc_data (struct value *); > > -static int fat_pntr_data_bitpos (struct type *); > +static LONGEST fat_pntr_data_bitpos (struct type *); > > static int fat_pntr_data_bitsize (struct type *); > > static struct value *desc_one_bound (struct value *, int, int); > > -static int desc_bound_bitpos (struct type *, int, int); > +static LONGEST desc_bound_bitpos (struct type *, int, int); > > static int desc_bound_bitsize (struct type *, int, int); > > @@ -174,7 +174,7 @@ static struct type *static_unwrap_type (struct type *type); > > static struct value *unwrap_value (struct value *); > > -static struct type *constrained_packed_array_type (struct type *, long *); > +static struct type *constrained_packed_array_type (struct type *, ULONGEST *); X > > static struct type *decode_constrained_packed_array_type (struct type *); > > @@ -189,7 +189,8 @@ static int ada_is_unconstrained_packed_array_type (struct type *); > static struct value *value_subscript_packed (struct value *, int, > struct value **); > > -static void move_bits (gdb_byte *, int, const gdb_byte *, int, int, int); > +static void move_bits (gdb_byte *, int, const gdb_byte *, ULONGEST, ULONGEST, X > + int); > > static struct value *coerce_unspec_val_to_type (struct value *, > struct type *); > @@ -217,14 +218,14 @@ static struct value *value_val_atr (struct type *, struct value *); > static struct symbol *standard_lookup (const char *, const struct block *, > domain_enum); > > -static struct value *ada_search_struct_field (char *, struct value *, int, > +static struct value *ada_search_struct_field (char *, struct value *, LONGEST, > struct type *); > > -static struct value *ada_value_primitive_field (struct value *, int, int, > +static struct value *ada_value_primitive_field (struct value *, LONGEST, int, > struct type *); > > -static int find_struct_field (const char *, struct type *, int, > - struct type **, int *, int *, int *, int *); > +static int find_struct_field (const char *, struct type *, LONGEST, > + struct type **, LONGEST *, int *, int *, int *); > > static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR, > struct value *); > @@ -240,7 +241,7 @@ static void ada_language_arch_info (struct gdbarch *, > > static void check_size (const struct type *); > > -static struct value *ada_index_struct_field (int, struct value *, int, > +static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST, > struct type *); > > static struct value *assign_aggregate (struct value *, struct value *, > @@ -586,7 +587,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) > } > > static const gdb_byte * > -cond_offset_host (const gdb_byte *valaddr, long offset) > +cond_offset_host (const gdb_byte *valaddr, LONGEST offset) > { > if (valaddr == NULL) > return NULL; > @@ -595,7 +596,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) > } > > static CORE_ADDR > -cond_offset_target (CORE_ADDR address, long offset) > +cond_offset_target (CORE_ADDR address, LONGEST offset) > { > if (address == 0) > return 0; > @@ -1601,7 +1602,7 @@ desc_bounds (struct value *arr) > /* If TYPE is the type of an array-descriptor (fat pointer), the bit > position of the field containing the address of the bounds data. */ > > -static int > +static LONGEST > fat_pntr_bounds_bitpos (struct type *type) > { > return TYPE_FIELD_BITPOS (desc_base_type (type), 1); > @@ -1667,7 +1668,7 @@ desc_data (struct value *arr) > /* If TYPE is the type of an array-descriptor (fat pointer), the bit > position of the field containing the address of the data. */ > > -static int > +static LONGEST > fat_pntr_data_bitpos (struct type *type) > { > return TYPE_FIELD_BITPOS (desc_base_type (type), 0); > @@ -1702,7 +1703,7 @@ desc_one_bound (struct value *bounds, int i, int which) > of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper > bound, if WHICH is 1. The first bound is I=1. */ > > -static int > +static LONGEST > desc_bound_bitpos (struct type *type, int i, int which) > { > return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); > @@ -1892,7 +1893,7 @@ ada_type_of_array (struct value *arr, int bounds) > zero, and does not need to be recomputed. */ > if (lo < hi) > { > - int array_bitsize = > + ULONGEST array_bitsize = X > (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); > > TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; > @@ -2044,7 +2045,7 @@ decode_packed_array_bitsize (struct type *type) > in bits. */ > > static struct type * > -constrained_packed_array_type (struct type *type, long *elt_bits) > +constrained_packed_array_type (struct type *type, ULONGEST *elt_bits) X > { > struct type *new_elt_type; > struct type *new_type; > @@ -2096,7 +2097,7 @@ decode_constrained_packed_array_type (struct type *type) > char *name; > const char *tail; > struct type *shadow_type; > - long bits; > + ULONGEST bits; X > > if (!raw_name) > raw_name = ada_type_name (desc_base_type (type)); > @@ -2167,7 +2168,8 @@ decode_constrained_packed_array (struct value *arr) > array with no wrapper. In order to interpret the value through > the (left-justified) packed array type we just built, we must > first left-justify it. */ > - int bit_size, bit_pos; > + int bit_size; > + LONGEST bit_pos; > ULONGEST mod; > > mod = ada_modulus (value_type (arr)) - 1; > @@ -2268,15 +2270,16 @@ has_negatives (struct type *type) > > struct value * > ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, > - long offset, int bit_offset, int bit_size, > + LONGEST offset, int bit_offset, int bit_size, > struct type *type) > { > struct value *v; > - int src, /* Index into the source area */ > - targ, /* Index into the target area */ > - srcBitsLeft, /* Number of source bits left to move */ > - nsrc, ntarg, /* Number of source and target bytes */ > - unusedLS, /* Number of bits in next significant > + int src; /* Index into the source area */ > + LONGEST targ; /* Index into the target area */ > + int srcBitsLeft, /* Number of source bits left to move */ > + nsrc; /* Number of source bytes */ > + ULONGEST ntarg; /* Number of target bytes */ X > + int unusedLS, /* Number of bits in next significant > byte of source that are unused */ > accumSize; /* Number of meaningful bits in accum */ > unsigned char *bytes; /* First byte containing data to unpack */ > @@ -2426,7 +2429,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, > not overlap. */ > static void > move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source, > - int src_offset, int n, int bits_big_endian_p) > + ULONGEST src_offset, ULONGEST n, int bits_big_endian_p) X > { > unsigned int accum, mask; > int accum_bits, chunk_size; > @@ -2516,7 +2519,7 @@ ada_value_assign (struct value *toval, struct value *fromval) > { > int len = (value_bitpos (toval) > + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; > - int from_size; > + ULONGEST from_size; X > char *buffer = (char *) alloca (len); > struct value *val; > CORE_ADDR to_addr = value_address (toval); > @@ -2562,7 +2565,7 @@ value_assign_to_component (struct value *container, struct value *component, > (LONGEST) (value_address (component) - value_address (container)); > int bit_offset_in_container = > value_bitpos (component) - value_bitpos (container); > - int bits; > + ULONGEST bits; X > > val = value_cast (value_type (component), val); > > @@ -4082,7 +4085,7 @@ ensure_lval (struct value *val) > if (VALUE_LVAL (val) == not_lval > || VALUE_LVAL (val) == lval_internalvar) > { > - int len = TYPE_LENGTH (ada_check_typedef (value_type (val))); > + ULONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val))); X > const CORE_ADDR addr = > value_as_long (value_allocate_space_in_inferior (len)); > > @@ -4156,7 +4159,7 @@ static CORE_ADDR > value_pointer (struct value *value, struct type *type) > { > struct gdbarch *gdbarch = get_type_arch (type); > - unsigned len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); > gdb_byte *buf = alloca (len); > CORE_ADDR addr; > > @@ -6044,7 +6047,7 @@ value_tag_from_contents_and_address (struct type *type, > const gdb_byte *valaddr, > CORE_ADDR address) > { > - int tag_byte_offset; > + LONGEST tag_byte_offset; > struct type *tag_type; > > if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, > @@ -6427,7 +6430,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) > only in that it can handle packed values of arbitrary type. */ > > static struct value * > -ada_value_primitive_field (struct value *arg1, int offset, int fieldno, > +ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, > struct type *arg_type) > { > struct type *type; > @@ -6439,12 +6442,13 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, > > if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) > { > - int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); > + LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); > int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); > > return ada_value_primitive_packed_val (arg1, value_contents (arg1), > - offset + bit_pos / 8, > - bit_pos % 8, bit_size, type); > + offset + bit_pos / 8, > + bit_pos % 8, bit_size, > + type); Only whitespace change (correct fix but not for this patch). > } > else > return value_primitive_field (arg1, offset, fieldno, arg_type); > @@ -6466,9 +6470,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, > Returns 1 if found, 0 otherwise. */ > > static int > -find_struct_field (const char *name, struct type *type, int offset, > +find_struct_field (const char *name, struct type *type, LONGEST offset, > struct type **field_type_p, > - int *byte_offset_p, int *bit_offset_p, int *bit_size_p, > + LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p, > int *index_p) > { > int i; > @@ -6486,8 +6490,8 @@ find_struct_field (const char *name, struct type *type, int offset, > > for (i = 0; i < TYPE_NFIELDS (type); i += 1) > { > - int bit_pos = TYPE_FIELD_BITPOS (type, i); > - int fld_offset = offset + bit_pos / 8; > + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); > + LONGEST fld_offset = offset + bit_pos / 8; > const char *t_field_name = TYPE_FIELD_NAME (type, i); > > if (t_field_name == NULL) > @@ -6557,7 +6561,7 @@ num_visible_fields (struct type *type) > Searches recursively through wrapper fields (e.g., '_parent'). */ > > static struct value * > -ada_search_struct_field (char *name, struct value *arg, int offset, > +ada_search_struct_field (char *name, struct value *arg, LONGEST offset, > struct type *type) > { > int i; > @@ -6590,7 +6594,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset, > int j; > struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, > i)); > - int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; > + LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; > > for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) > { > @@ -6608,8 +6612,8 @@ ada_search_struct_field (char *name, struct value *arg, int offset, > return NULL; > } > > -static struct value *ada_index_struct_field_1 (int *, struct value *, > - int, struct type *); > +static struct value *ada_index_struct_field_1 (LONGEST *, struct value *, > + LONGEST, struct type *); > > > /* Return field #INDEX in ARG, where the index is that returned by > @@ -6618,7 +6622,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, > * If found, return value, else return NULL. */ > > static struct value * > -ada_index_struct_field (int index, struct value *arg, int offset, > +ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset, > struct type *type) > { > return ada_index_struct_field_1 (&index, arg, offset, type); > @@ -6630,7 +6634,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, > * *INDEX_P. */ > > static struct value * > -ada_index_struct_field_1 (int *index_p, struct value *arg, int offset, > +ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset, > struct type *type) > { > int i; > @@ -6720,7 +6724,8 @@ ada_value_struct_elt (struct value *arg, char *name, int no_err) > v = ada_search_struct_field (name, arg, 0, t); > else > { > - int bit_offset, bit_size, byte_offset; > + int bit_offset, bit_size; > + LONGEST byte_offset; > struct type *field_type; > CORE_ADDR address; > > @@ -7026,8 +7031,8 @@ ada_coerce_ref (struct value *val0) > /* Return OFF rounded upward if necessary to a multiple of > ALIGNMENT (a power of 2). */ > > -static unsigned int > -align_value (unsigned int off, unsigned int alignment) > +static ULONGEST > +align_value (LONGEST off, ULONGEST alignment) X > { > return (off + alignment - 1) & ~(alignment - 1); > } > @@ -7406,10 +7411,10 @@ ada_template_to_fixed_record_type_1 (struct type *type, > struct value *mark = value_mark (); > struct value *dval; > struct type *rtype; > - int nfields, bit_len; > + int nfields; > int variant_field; > - long off; > - int fld_bit_len; > + ULONGEST off, bit_len; X > + ULONGEST fld_bit_len; X > int f; > > /* Compute the number of fields in this record type that are going > @@ -7480,7 +7485,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, > that follow this one. */ > if (ada_is_aligner_type (field_type)) > { > - long field_offset = TYPE_FIELD_BITPOS (field_type, f); > + LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f); > > field_valaddr = cond_offset_host (field_valaddr, field_offset); > field_address = cond_offset_target (field_address, field_offset); > @@ -7599,11 +7604,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, > if (TYPE_LENGTH (type) <= 0) > { > if (TYPE_NAME (rtype)) > - warning (_("Invalid type size for `%s' detected: %d."), > - TYPE_NAME (rtype), TYPE_LENGTH (type)); > + warning (_("Invalid type size for `%s' detected: %s."), > + TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type))); > else > - warning (_("Invalid type size for <unnamed> detected: %d."), > - TYPE_LENGTH (type)); > + warning (_("Invalid type size for <unnamed> detected: %s."), > + pulongest (TYPE_LENGTH (type))); > } > else > { > @@ -7940,7 +7945,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, > type was a regular (non-packed) array type. As a result, the > bitsize of the array elements needs to be set again, and the array > length needs to be recomputed based on that bitsize. */ > - int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result)); > + ULONGEST len = TYPE_LENGTH (result) / > + TYPE_LENGTH (TYPE_TARGET_TYPE (result)); X Plus GNU Coding Standards Formatting should be: ULONGEST len = (TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result))); > int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0); > > TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0); > diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h > index 9a93c50..3de0723 100644 > --- a/gdb/ada-lang.h > +++ b/gdb/ada-lang.h > @@ -168,7 +168,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int, > extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, > struct ui_file *stream); > > -extern void ada_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, > +extern void ada_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *); > @@ -183,7 +183,7 @@ extern void ada_emit_char (int, struct type *, struct ui_file *, int, int); > extern void ada_printchar (int, struct type *, struct ui_file *); > > extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *, > - unsigned int, const char *, int, > + ULONGEST, const char *, int, > const struct value_print_options *); > > struct value *ada_convert_actual (struct value *actual, > @@ -257,7 +257,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); > > extern struct value *ada_value_primitive_packed_val (struct value *, > const gdb_byte *, > - long, int, int, > + LONGEST, int, int, > struct type *); > > extern struct type *ada_coerce_to_simple_array_type (struct type *); > diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c > index 40f3058..2a1852c 100644 > --- a/gdb/ada-typeprint.c > +++ b/gdb/ada-typeprint.c > @@ -815,8 +815,8 @@ ada_print_type (struct type *type0, const char *varstring, > const char *name = ada_type_name (type); > > if (!ada_is_range_type_name (name)) > - fprintf_filtered (stream, _("<%d-byte integer>"), > - TYPE_LENGTH (type)); > + fprintf_filtered (stream, _("<%s-byte integer>"), > + pulongest (TYPE_LENGTH (type))); > else > { > fprintf_filtered (stream, "range "); > @@ -837,7 +837,8 @@ ada_print_type (struct type *type0, const char *varstring, > } > break; > case TYPE_CODE_FLT: > - fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type)); > + fprintf_filtered (stream, _("<%s-byte float>"), > + pulongest (TYPE_LENGTH (type))); > break; > case TYPE_CODE_ENUM: > if (show < 0) > diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c > index 95ec7ec..245fd41 100644 > --- a/gdb/ada-valprint.c > +++ b/gdb/ada-valprint.c > @@ -42,19 +42,18 @@ static void print_record (struct type *, const gdb_byte *, int, > const struct value_print_options *); > > static int print_field_values (struct type *, const gdb_byte *, > - int, > + LONGEST, > struct ui_file *, int, > const struct value *, > const struct value_print_options *, > - int, struct type *, int); > + int, struct type *, LONGEST); > > static void adjust_type_signedness (struct type *); > > -static void ada_val_print_1 (struct type *, const gdb_byte *, int, CORE_ADDR, > +static void ada_val_print_1 (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *); > -\f Unrelated formatting change. > > /* Make TYPE unsigned if its range of values includes no negatives. */ > static void > @@ -144,7 +143,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, > unsigned int things_printed = 0; > unsigned len; > struct type *elttype, *index_type; > - unsigned eltlen; > + ULONGEST eltlen; > unsigned long bitsize = TYPE_FIELD_BITSIZE (type, 0); > struct value *mark = value_mark (); > LONGEST low = 0; > @@ -293,7 +292,7 @@ ada_emit_char (int c, struct type *type, struct ui_file *stream, > of a character. */ > > static int > -char_at (const gdb_byte *string, int i, int type_len, > +char_at (const gdb_byte *string, ULONGEST i, int type_len, X > enum bfd_endian byte_order) > { > if (type_len == 1) > @@ -465,7 +464,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) > > static void > printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, > - unsigned int length, int force_ellipses, int type_len, > + ULONGEST length, int force_ellipses, int type_len, > const struct value_print_options *options) > { > enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype)); > @@ -556,7 +555,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, > > void > ada_printstr (struct ui_file *stream, struct type *type, > - const gdb_byte *string, unsigned int length, > + const gdb_byte *string, ULONGEST length, > const char *encoding, int force_ellipses, > const struct value_print_options *options) > { > @@ -570,7 +569,7 @@ ada_printstr (struct ui_file *stream, struct type *type, > > void > ada_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options) > @@ -602,8 +601,8 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, > { > enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); > struct type *elttype = TYPE_TARGET_TYPE (type); > - unsigned int eltlen; > - unsigned int len; > + ULONGEST eltlen; > + ULONGEST len; > > /* We know that ELTTYPE cannot possibly be null, because we found > that TYPE is a string-like type. Similarly, the size of ELTTYPE > @@ -621,7 +620,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, > elements up to it. */ > if (options->stop_print_at_null) > { > - int temp_len; > + ULONGEST temp_len; X > > /* Look for a NULL char. */ > for (temp_len = 0; > @@ -654,7 +653,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, > > static void > ada_val_print_1 (struct type *type, const gdb_byte *valaddr, > - int offset, CORE_ADDR address, > + LONGEST offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options) > @@ -730,7 +729,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, > if (ada_is_fixed_point_type (type)) > { > LONGEST v = unpack_long (type, valaddr + offset_aligned); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > fprintf_filtered (stream, len < 4 ? "%.11g" : "%.17g", > (double) ada_fixed_to_float (type, v)); > @@ -924,12 +923,12 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, > > static int > print_variant_part (struct type *type, int field_num, > - const gdb_byte *valaddr, int offset, > + const gdb_byte *valaddr, LONGEST offset, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > int comma_needed, > - struct type *outer_type, int outer_offset) > + struct type *outer_type, LONGEST outer_offset) > { > struct type *var_type = TYPE_FIELD_TYPE (type, field_num); > int which = ada_which_variant_applies (var_type, outer_type, > @@ -1036,11 +1035,11 @@ print_record (struct type *type, const gdb_byte *valaddr, > > static int > print_field_values (struct type *type, const gdb_byte *valaddr, > - int offset, struct ui_file *stream, int recurse, > + LONGEST offset, struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > int comma_needed, > - struct type *outer_type, int outer_offset) > + struct type *outer_type, LONGEST outer_offset) > { > int i, len; > > @@ -1121,7 +1120,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, > } > else > { > - int bit_pos = TYPE_FIELD_BITPOS (type, i); > + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); > int bit_size = TYPE_FIELD_BITSIZE (type, i); > struct value_print_options opts; > > diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c > index 856aa0d..8b6a970 100644 > --- a/gdb/alpha-tdep.c > +++ b/gdb/alpha-tdep.c > @@ -303,7 +303,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > struct alpha_arg > { > const gdb_byte *contents; > - int len; > + ULONGEST len; X > int offset; > }; > struct alpha_arg *alpha_args > @@ -424,7 +424,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > { > const gdb_byte *contents = m_arg->contents; > int offset = m_arg->offset; > - int len = m_arg->len; > + ULONGEST len = m_arg->len; X > > /* Copy the bytes destined for registers into arg_reg_buffer. */ > if (offset < sizeof(arg_reg_buffer)) > @@ -475,7 +475,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache, > { > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > - int length = TYPE_LENGTH (valtype); > + ULONGEST length = TYPE_LENGTH (valtype); X > gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; > ULONGEST l; > > @@ -544,7 +544,7 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache, > const gdb_byte *valbuf) > { > struct gdbarch *gdbarch = get_regcache_arch (regcache); > - int length = TYPE_LENGTH (valtype); > + ULONGEST length = TYPE_LENGTH (valtype); X > gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; > ULONGEST l; > > diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c > index 685fa48..0ec7f99 100644 > --- a/gdb/amd64-tdep.c > +++ b/gdb/amd64-tdep.c > @@ -443,7 +443,7 @@ amd64_non_pod_p (struct type *type) > static void > amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) > { > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > /* 1. If the size of an object is larger than two eightbytes, or in > C++, is a non-POD structure or union type, or contains > @@ -482,10 +482,10 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) > for (i = 0; i < TYPE_NFIELDS (type); i++) > { > struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); > - int pos = TYPE_FIELD_BITPOS (type, i) / 64; > + LONGEST pos = TYPE_FIELD_BITPOS (type, i) / 64; > enum amd64_reg_class subclass[2]; > - int bitsize = TYPE_FIELD_BITSIZE (type, i); > - int endpos; > + ULONGEST bitsize = TYPE_FIELD_BITSIZE (type, i); X > + LONGEST endpos; > > if (bitsize == 0) > bitsize = TYPE_LENGTH (subtype) * 8; > @@ -549,7 +549,7 @@ void > amd64_classify (struct type *type, enum amd64_reg_class class[2]) > { > enum type_code code = TYPE_CODE (type); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > class[0] = class[1] = AMD64_NO_CLASS; > > @@ -598,7 +598,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct type *func_type, > { > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > enum amd64_reg_class class[2]; > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM }; > static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM }; > int integer_reg = 0; > @@ -727,8 +727,8 @@ amd64_push_arguments (struct regcache *regcache, int nargs, > that register number (or a negative value otherwise). */ > int *arg_addr_regno = alloca (nargs * sizeof (int)); > int num_stack_args = 0; > - int num_elements = 0; > - int element = 0; > + ULONGEST num_elements = 0; X > + ULONGEST element = 0; X > int integer_reg = 0; > int sse_reg = 0; > int i; > @@ -742,7 +742,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, > for (i = 0; i < nargs; i++) > { > struct type *type = value_type (args[i]); > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > enum amd64_reg_class class[2]; > int needed_integer_regs = 0; > int needed_sse_regs = 0; > @@ -836,7 +836,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, > { > struct type *type = value_type (stack_args[i]); > const gdb_byte *valbuf = value_contents (stack_args[i]); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > CORE_ADDR arg_addr = sp + element * 8; > > write_memory (arg_addr, valbuf, len); > @@ -2551,7 +2551,7 @@ amd64_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc) > CORE_ADDR jb_addr; > struct gdbarch *gdbarch = get_frame_arch (frame); > int jb_pc_offset = gdbarch_tdep (gdbarch)->jb_pc_offset; > - int len = TYPE_LENGTH (builtin_type (gdbarch)->builtin_func_ptr); > + ULONGEST len = TYPE_LENGTH (builtin_type (gdbarch)->builtin_func_ptr); X > > /* If JB_PC_OFFSET is -1, we have no way to find out where the > longjmp will land. */ > diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c > index 2b94eca..2ec936c 100644 > --- a/gdb/amd64-windows-tdep.c > +++ b/gdb/amd64-windows-tdep.c > @@ -77,7 +77,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct type *func_type, > struct type *type, struct regcache *regcache, > gdb_byte *readbuf, const gdb_byte *writebuf) > { > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > int regnum = -1; > > /* See if our value is returned through a register. If it is, then > diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c > index f83dc0e..51eed0c 100644 > --- a/gdb/arm-tdep.c > +++ b/gdb/arm-tdep.c > @@ -3577,7 +3577,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > > for (argnum = 0; argnum < nargs; argnum++) > { > - int len; > + ULONGEST len; X > struct type *arg_type; > struct type *target_type; > enum type_code typecode; > @@ -8773,7 +8773,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs, > /* If the type is a plain integer, then the access is > straight-forward. Otherwise we have to play around a bit > more. */ > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > int regno = ARM_A1_REGNUM; > ULONGEST tmp; > > @@ -8795,7 +8795,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs, > /* For a structure or union the behaviour is as if the value had > been stored to word-aligned memory and then loaded into > registers with 32-bit load instruction(s). */ > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > int regno = ARM_A1_REGNUM; > bfd_byte tmpbuf[INT_REGISTER_SIZE]; > > @@ -8976,7 +8976,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, > /* Integral values greater than one word are stored in consecutive > registers starting with r0. This will always be a multiple of > the regiser size. */ > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > int regno = ARM_A1_REGNUM; > > while (len > 0) > @@ -8992,7 +8992,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, > /* For a structure or union the behaviour is as if the value had > been stored to word-aligned memory and then loaded into > registers with 32-bit load instruction(s). */ > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > int regno = ARM_A1_REGNUM; > bfd_byte tmpbuf[INT_REGISTER_SIZE]; > > diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c > index 34b0baf..c7ba3d8 100644 > --- a/gdb/avr-tdep.c > +++ b/gdb/avr-tdep.c > @@ -906,7 +906,7 @@ avr_return_value (struct gdbarch *gdbarch, struct type *func_type, > struct type *valtype, struct regcache *regcache, > gdb_byte *readbuf, const gdb_byte *writebuf) > { > - int i; > + ULONGEST i; X > /* Single byte are returned in r24. > Otherwise, the MSB of the return value is always in r25, calculate which > register holds the LSB. */ > @@ -1177,7 +1177,8 @@ struct stack_item > }; > > static struct stack_item * > -push_stack_item (struct stack_item *prev, const bfd_byte *contents, int len) > +push_stack_item (struct stack_item *prev, const bfd_byte *contents, > + ULONGEST len) X > { > struct stack_item *si; > si = xmalloc (sizeof (struct stack_item)); > @@ -1266,12 +1267,12 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > > for (i = 0; i < nargs; i++) > { > - int last_regnum; > + ULONGEST last_regnum; X > int j; > struct value *arg = args[i]; > struct type *type = check_typedef (value_type (arg)); > const bfd_byte *contents = value_contents (arg); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > /* Calculate the potential last register needed. */ > last_regnum = regnum - (len + (len & 1)); > diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c > index 909f282..b1b8071 100644 > --- a/gdb/ax-gdb.c > +++ b/gdb/ax-gdb.c > @@ -80,12 +80,12 @@ static void gen_traced_pop (struct gdbarch *, struct agent_expr *, > static void gen_sign_extend (struct agent_expr *, struct type *); > static void gen_extend (struct agent_expr *, struct type *); > static void gen_fetch (struct agent_expr *, struct type *); > -static void gen_left_shift (struct agent_expr *, int); > +static void gen_left_shift (struct agent_expr *, LONGEST); > > > static void gen_frame_args_address (struct gdbarch *, struct agent_expr *); > static void gen_frame_locals_address (struct gdbarch *, struct agent_expr *); > -static void gen_offset (struct agent_expr *ax, int offset); > +static void gen_offset (struct agent_expr *ax, LONGEST offset); > static void gen_sym_offset (struct agent_expr *, struct symbol *); > static void gen_var_ref (struct gdbarch *, struct agent_expr *ax, > struct axs_value *value, struct symbol *var); > @@ -133,15 +133,16 @@ static void gen_deref (struct agent_expr *, struct axs_value *); > static void gen_address_of (struct agent_expr *, struct axs_value *); > static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, > struct axs_value *value, > - struct type *type, int start, int end); > + struct type *type, LONGEST start, LONGEST end); > static void gen_primitive_field (struct expression *exp, > struct agent_expr *ax, > struct axs_value *value, > - int offset, int fieldno, struct type *type); > + LONGEST offset, int fieldno, > + struct type *type); > static int gen_struct_ref_recursive (struct expression *exp, > struct agent_expr *ax, > struct axs_value *value, > - char *field, int offset, > + char *field, LONGEST offset, > struct type *type); > static void gen_struct_ref (struct expression *exp, struct agent_expr *ax, > struct axs_value *value, > @@ -363,7 +364,7 @@ gen_trace_static_fields (struct gdbarch *gdbarch, > { > case axs_lvalue_memory: > { > - int length = TYPE_LENGTH (check_typedef (value.type)); > + ULONGEST length = TYPE_LENGTH (check_typedef (value.type)); X > > ax_const_l (ax, length); > ax_simple (ax, aop_trace); > @@ -421,7 +422,7 @@ gen_traced_pop (struct gdbarch *gdbarch, > > case axs_lvalue_memory: > { > - int length = TYPE_LENGTH (check_typedef (value->type)); > + ULONGEST length = TYPE_LENGTH (check_typedef (value->type)); X > > if (string_trace) > ax_simple (ax, aop_dup); > @@ -565,7 +566,7 @@ gen_fetch (struct agent_expr *ax, struct type *type) > right shift it by -DISTANCE bits if DISTANCE < 0. This generates > unsigned (logical) right shifts. */ > static void > -gen_left_shift (struct agent_expr *ax, int distance) > +gen_left_shift (struct agent_expr *ax, LONGEST distance) > { > if (distance > 0) > { > @@ -619,7 +620,7 @@ gen_frame_locals_address (struct gdbarch *gdbarch, struct agent_expr *ax) > programming in ML, it would be clearer why these are the same > thing. */ > static void > -gen_offset (struct agent_expr *ax, int offset) > +gen_offset (struct agent_expr *ax, LONGEST offset) > { > /* It would suffice to simply push the offset and add it, but this > makes it easier to read positive and negative offsets in the > @@ -1275,7 +1276,7 @@ gen_address_of (struct agent_expr *ax, struct axs_value *value) > static void > gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, > struct axs_value *value, struct type *type, > - int start, int end) > + LONGEST start, LONGEST end) > { > /* Note that ops[i] fetches 8 << i bits. */ > static enum agent_op ops[] > @@ -1310,13 +1311,13 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, > > /* The first and one-after-last bits in the field, but rounded down > and up to byte boundaries. */ > - int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; > - int bound_end = (((end + TARGET_CHAR_BIT - 1) > - / TARGET_CHAR_BIT) > - * TARGET_CHAR_BIT); > + LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; > + LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1) > + / TARGET_CHAR_BIT) > + * TARGET_CHAR_BIT); > > /* current bit offset within the structure */ > - int offset; > + LONGEST offset; > > /* The index in ops of the opcode we're considering. */ > int op; > @@ -1435,7 +1436,7 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, > static void > gen_primitive_field (struct expression *exp, > struct agent_expr *ax, struct axs_value *value, > - int offset, int fieldno, struct type *type) > + LONGEST offset, int fieldno, struct type *type) > { > /* Is this a bitfield? */ > if (TYPE_FIELD_PACKED (type, fieldno)) > @@ -1460,7 +1461,7 @@ gen_primitive_field (struct expression *exp, > static int > gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, > struct axs_value *value, > - char *field, int offset, struct type *type) > + char *field, LONGEST offset, struct type *type) > { > int i, rslt; > int nbases = TYPE_N_BASECLASSES (type); > diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c > index a48758d..e5eef86 100644 > --- a/gdb/bfin-tdep.c > +++ b/gdb/bfin-tdep.c > @@ -506,14 +506,14 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, > char buf[4]; > int i; > long reg_r0, reg_r1, reg_r2; > - int total_len = 0; > + ULONGEST total_len = 0; X > enum bfin_abi abi = bfin_abi (gdbarch); > CORE_ADDR func_addr = find_function_addr (function, NULL); > > for (i = nargs - 1; i >= 0; i--) > { > struct type *value_type = value_enclosing_type (args[i]); > - int len = TYPE_LENGTH (value_type); > + ULONGEST len = TYPE_LENGTH (value_type); X > > total_len += (len + 3) & ~3; > } > @@ -531,8 +531,8 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, > { > struct type *value_type = value_enclosing_type (args[i]); > struct type *arg_type = check_typedef (value_type); > - int len = TYPE_LENGTH (value_type); > - int container_len = (len + 3) & ~3; > + ULONGEST len = TYPE_LENGTH (value_type); X > + ULONGEST container_len = (len + 3) & ~3; X > > sp -= container_len; > write_memory (sp, value_contents_writeable (args[i]), container_len); > @@ -613,7 +613,7 @@ bfin_extract_return_value (struct type *type, > struct gdbarch *gdbarch = get_regcache_arch (regs); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > bfd_byte *valbuf = dst; > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > ULONGEST tmp; > int regno = BFIN_R0_REGNUM; > > @@ -642,7 +642,7 @@ bfin_store_return_value (struct type *type, > registers starting with R0. This will always be a multiple of > the register size. */ > > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > int regno = BFIN_R0_REGNUM; > > gdb_assert (len <= 8); > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index ab5f324..0e61513 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -1747,7 +1747,8 @@ update_watchpoint (struct watchpoint *b, int reparse) > && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) > { > CORE_ADDR addr; > - int len, type; > + ULONGEST len; X > + int type; > struct bp_location *loc, **tmp; > > addr = value_address (v); > @@ -10495,7 +10496,7 @@ can_use_hardware_watchpoint (struct value *v) > && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) > { > CORE_ADDR vaddr = value_address (v); > - int len; > + ULONGEST len; X > int num_regs; > > len = (target_exact_watchpoints > @@ -14091,7 +14092,7 @@ show_breakpoint_cmd (char *args, int from_tty) > GDB itself. */ > > static void > -invalidate_bp_value_on_memory_change (CORE_ADDR addr, int len, > +invalidate_bp_value_on_memory_change (CORE_ADDR addr, LONGEST len, > const bfd_byte *data) > { > struct breakpoint *bp; > diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h > index d23561a..152aaad 100644 > --- a/gdb/breakpoint.h > +++ b/gdb/breakpoint.h > @@ -400,7 +400,7 @@ struct bp_location > /* For hardware watchpoints, the size of the memory region being > watched. For hardware ranged breakpoints, the size of the > breakpoint range. */ > - int length; > + ULONGEST length; X > > /* Type of hardware watchpoint. */ > enum target_hw_bp_type watchpoint_type; > diff --git a/gdb/c-lang.c b/gdb/c-lang.c > index 28dce8d..2064011 100644 > --- a/gdb/c-lang.c > +++ b/gdb/c-lang.c > @@ -189,7 +189,7 @@ c_printchar (int c, struct type *type, struct ui_file *stream) > > void > c_printstr (struct ui_file *stream, struct type *type, > - const gdb_byte *string, unsigned int length, > + const gdb_byte *string, ULONGEST length, > const char *user_encoding, int force_ellipses, > const struct value_print_options *options) > { > @@ -202,7 +202,6 @@ c_printstr (struct ui_file *stream, struct type *type, > unsigned int things_printed = 0; > int in_quotes = 0; > int need_comma = 0; > - int width = TYPE_LENGTH (type); This should be a separate patch, unrelated to this one. Obvious for commit. > struct obstack wchar_buf, output; > struct cleanup *cleanup; > struct wchar_iterator *iter; > @@ -679,7 +678,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, > } > else > { > - int i; > + ULONGEST i; X > > /* Write the terminating character. */ > for (i = 0; i < TYPE_LENGTH (type); ++i) > @@ -688,7 +687,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, > if (satisfy_expected) > { > LONGEST low_bound, high_bound; > - int element_size = TYPE_LENGTH (type); > + ULONGEST element_size = TYPE_LENGTH (type); X > > if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type), > &low_bound, &high_bound) < 0) > diff --git a/gdb/c-lang.h b/gdb/c-lang.h > index 5cbe34d..c02b8f4 100644 > --- a/gdb/c-lang.h > +++ b/gdb/c-lang.h > @@ -72,7 +72,7 @@ extern void c_print_typedef (struct type *, > struct ui_file *); > > extern void c_val_print (struct type *, const gdb_byte *, > - int, CORE_ADDR, > + LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *); > @@ -92,7 +92,7 @@ extern void c_printchar (int, struct type *, struct ui_file *); > extern void c_printstr (struct ui_file * stream, > struct type *elttype, > const gdb_byte *string, > - unsigned int length, > + ULONGEST length, > const char *user_encoding, > int force_ellipses, > const struct value_print_options *options); > @@ -118,14 +118,14 @@ extern void cp_print_class_member (const gdb_byte *, struct type *, > struct ui_file *, char *); > > extern void cp_print_value_fields (struct type *, struct type *, > - const gdb_byte *, int, CORE_ADDR, > + const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *, > struct type **, int); > > extern void cp_print_value_fields_rtti (struct type *, > - const gdb_byte *, int, CORE_ADDR, > + const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *, > diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c > index a5892b5..1fd6b48 100644 > --- a/gdb/c-typeprint.c > +++ b/gdb/c-typeprint.c > @@ -625,8 +625,8 @@ c_type_print_varspec_suffix (struct type *type, > > fprintf_filtered (stream, "["); > if (get_array_bounds (type, &low_bound, &high_bound)) > - fprintf_filtered (stream, "%d", > - (int) (high_bound - low_bound + 1)); > + fprintf_filtered (stream, "%s", > + pulongest (high_bound - low_bound + 1)); To keep with the signedness use plongest. > fprintf_filtered (stream, "]"); > > c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, > diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c > index d1fd56d..620bde4 100644 > --- a/gdb/c-valprint.c > +++ b/gdb/c-valprint.c > @@ -133,7 +133,7 @@ static const struct generic_val_print_decorations c_decorations = > > void > c_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options) > @@ -144,7 +144,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, > unsigned len; > struct type *elttype, *unresolved_elttype; > struct type *unresolved_type = type; > - unsigned eltlen; > + ULONGEST eltlen; > LONGEST val; > CORE_ADDR addr; > > @@ -346,9 +346,9 @@ c_val_print (struct type *type, const gdb_byte *valaddr, > /* Print vtable entry - we only get here if NOT using > -fvtable_thunks. (Otherwise, look under > TYPE_CODE_PTR.) */ > - int offset = (embedded_offset > - + TYPE_FIELD_BITPOS (type, > - VTBL_FNADDR_OFFSET) / 8); > + LONGEST offset = (embedded_offset > + + TYPE_FIELD_BITPOS (type, > + VTBL_FNADDR_OFFSET) / 8); > struct type *field_type = TYPE_FIELD_TYPE (type, > VTBL_FNADDR_OFFSET); > CORE_ADDR addr > @@ -428,7 +428,8 @@ c_value_print (struct value *val, struct ui_file *stream, > const struct value_print_options *options) > { > struct type *type, *real_type, *val_type; > - int full, top, using_enc; > + int full, using_enc; > + LONGEST top; > struct value_print_options opts = *options; > > opts.deref_ref = 1; > diff --git a/gdb/corefile.c b/gdb/corefile.c > index 986e4f5..ff15eac 100644 > --- a/gdb/corefile.c > +++ b/gdb/corefile.c > @@ -213,7 +213,7 @@ memory_error (int status, CORE_ADDR memaddr) > /* Same as target_read_memory, but report an error if can't read. */ > > void > -read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len) > +read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len) X > { > int status; > > @@ -225,7 +225,7 @@ read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len) > /* Same as target_read_stack, but report an error if can't read. */ > > void > -read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len) > +read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len) X > { > int status; > > @@ -352,7 +352,7 @@ read_memory_typed_address (CORE_ADDR addr, struct type *type) > write. */ > void > write_memory (CORE_ADDR memaddr, > - const bfd_byte *myaddr, int len) > + const bfd_byte *myaddr, ULONGEST len) X > { > int status; > > diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c > index 16b5356..03f4baf 100644 > --- a/gdb/cp-abi.c > +++ b/gdb/cp-abi.c > @@ -68,13 +68,13 @@ is_operator_name (const char *name) > return (*current_cp_abi.is_operator_name) (name); > } > > -int > +LONGEST > baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > const struct value *val) > { > volatile struct gdb_exception ex; > - int res = 0; > + LONGEST res = 0; > > gdb_assert (current_cp_abi.baseclass_offset != NULL); > > @@ -98,7 +98,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, > struct value * > value_virtual_fn_field (struct value **arg1p, > struct fn_field *f, int j, > - struct type *type, int offset) > + struct type *type, LONGEST offset) > { > if ((current_cp_abi.virtual_fn_field) == NULL) > return NULL; > @@ -108,7 +108,7 @@ value_virtual_fn_field (struct value **arg1p, > > struct type * > value_rtti_type (struct value *v, int *full, > - int *top, int *using_enc) > + LONGEST *top, int *using_enc) > { > struct type *ret = NULL; > volatile struct gdb_exception e; > diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h > index 8451450..a34e9fe 100644 > --- a/gdb/cp-abi.h > +++ b/gdb/cp-abi.h > @@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, > struct fn_field *f, > int j, > struct type *type, > - int offset); > + LONGEST offset); > > > /* Try to find the run-time type of VALUE, using C++ run-time type > @@ -135,7 +135,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, > FULL, TOP, and USING_ENC can each be zero, in which case we don't > provide the corresponding piece of information. */ > extern struct type *value_rtti_type (struct value *value, > - int *full, int *top, > + int *full, LONGEST *top, > int *using_enc); > > /* Compute the offset of the baseclass which is the INDEXth baseclass > @@ -144,11 +144,11 @@ extern struct type *value_rtti_type (struct value *value, > contents of VAL. The result is the offset of the baseclass value > relative to (the address of)(ARG) + OFFSET. */ > > -extern int baseclass_offset (struct type *type, > - int index, const gdb_byte *valaddr, > - int embedded_offset, > - CORE_ADDR address, > - const struct value *val); > +extern LONGEST baseclass_offset (struct type *type, > + int index, const gdb_byte *valaddr, > + LONGEST embedded_offset, > + CORE_ADDR address, > + const struct value *val); > > /* Describe the target of a pointer to method. CONTENTS is the byte > pattern representing the pointer to method. TYPE is the pointer to > @@ -204,12 +204,13 @@ struct cp_abi_ops > struct value *(*virtual_fn_field) (struct value **arg1p, > struct fn_field * f, > int j, struct type * type, > - int offset); > + LONGEST offset); > struct type *(*rtti_type) (struct value *v, int *full, > - int *top, int *using_enc); > - int (*baseclass_offset) (struct type *type, int index, > - const bfd_byte *valaddr, int embedded_offset, > - CORE_ADDR address, const struct value *val); > + LONGEST *top, int *using_enc); > + LONGEST (*baseclass_offset) (struct type *type, int index, > + const bfd_byte *valaddr, > + LONGEST embedded_offset, CORE_ADDR address, > + const struct value *val); > void (*print_method_ptr) (const gdb_byte *contents, > struct type *type, > struct ui_file *stream); > diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c > index 7dd13bb..a7b9381 100644 > --- a/gdb/cp-valprint.c > +++ b/gdb/cp-valprint.c > @@ -82,7 +82,7 @@ static void cp_print_static_field (struct type *, struct value *, > const struct value_print_options *); > > static void cp_print_value (struct type *, struct type *, > - const gdb_byte *, int, > + const gdb_byte *, LONGEST, > CORE_ADDR, struct ui_file *, > int, const struct value *, > const struct value_print_options *, > @@ -156,7 +156,7 @@ cp_is_vtbl_member (struct type *type) > > void > cp_print_value_fields (struct type *type, struct type *real_type, > - const gdb_byte *valaddr, int offset, > + const gdb_byte *valaddr, LONGEST offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, const struct value *val, > const struct value_print_options *options, > @@ -443,7 +443,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, > > void > cp_print_value_fields_rtti (struct type *type, > - const gdb_byte *valaddr, int offset, > + const gdb_byte *valaddr, LONGEST offset, > CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > @@ -459,7 +459,8 @@ cp_print_value_fields_rtti (struct type *type, > TARGET_CHAR_BIT * TYPE_LENGTH (type))) > { > struct value *value; > - int full, top, using_enc; > + int full, using_enc; > + LONGEST top; > > /* Ugh, we have to convert back to a value here. */ > value = value_from_contents_and_address (type, valaddr + offset, > @@ -483,7 +484,7 @@ cp_print_value_fields_rtti (struct type *type, > > static void > cp_print_value (struct type *type, struct type *real_type, > - const gdb_byte *valaddr, int offset, > + const gdb_byte *valaddr, LONGEST offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, const struct value *val, > const struct value_print_options *options, > @@ -493,7 +494,7 @@ cp_print_value (struct type *type, struct type *real_type, > = (struct type **) obstack_next_free (&dont_print_vb_obstack); > struct obstack tmp_obstack = dont_print_vb_obstack; > int i, n_baseclasses = TYPE_N_BASECLASSES (type); > - int thisoffset; > + LONGEST thisoffset; > struct type *thistype; > > if (dont_print_vb == 0) > @@ -507,7 +508,7 @@ cp_print_value (struct type *type, struct type *real_type, > > for (i = 0; i < n_baseclasses; i++) > { > - int boffset = 0; > + LONGEST boffset = 0; > int skip; > struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); > const char *basename = TYPE_NAME (baseclass); > @@ -759,7 +760,7 @@ cp_find_class_member (struct type **domain_p, int *fieldno, > for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) > { > LONGEST bitpos = TYPE_FIELD_BITPOS (domain, i); > - LONGEST bitsize = 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (domain, i)); > + ULONGEST bitsize = 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (domain, i)); X In fact redundant for this patch. > > if (offset >= bitpos && offset < bitpos + bitsize) > { > diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c > index 34a2594..a0a6734 100644 > --- a/gdb/cris-tdep.c > +++ b/gdb/cris-tdep.c > @@ -678,7 +678,7 @@ struct stack_item > }; > > static struct stack_item * > -push_stack_item (struct stack_item *prev, void *contents, int len) > +push_stack_item (struct stack_item *prev, void *contents, ULONGEST len) X > { > struct stack_item *si; > si = xmalloc (sizeof (struct stack_item)); > @@ -856,10 +856,10 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > > for (argnum = 0; argnum < nargs; argnum++) > { > - int len; > + ULONGEST len; X > char *val; > - int reg_demand; > - int i; > + ULONGEST reg_demand; X > + ULONGEST i; X > > len = TYPE_LENGTH (value_type (args[argnum])); > val = (char *) value_contents (args[argnum]); > @@ -1669,7 +1669,7 @@ cris_store_return_value (struct type *type, struct regcache *regcache, > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > ULONGEST val; > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (len <= 4) > { > @@ -1840,7 +1840,7 @@ cris_extract_return_value (struct type *type, struct regcache *regcache, > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > ULONGEST val; > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (len <= 4) > { > diff --git a/gdb/d-lang.h b/gdb/d-lang.h > index f93405a..84b149f 100644 > --- a/gdb/d-lang.h > +++ b/gdb/d-lang.h > @@ -25,7 +25,7 @@ > extern char *d_demangle (const char *mangled, int options); > > extern void d_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options); > diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c > index 3a8d11d..5d066e7 100644 > --- a/gdb/d-valprint.c > +++ b/gdb/d-valprint.c > @@ -29,7 +29,7 @@ > > static int > dynamic_array_type (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options) > @@ -71,9 +71,9 @@ dynamic_array_type (struct type *type, const gdb_byte *valaddr, > > /* Implements the la_val_print routine for language D. */ > void > -d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > - CORE_ADDR address, struct ui_file *stream, int recurse, > - const struct value *val, > +d_val_print (struct type *type, const gdb_byte *valaddr, > + LONGEST embedded_offset, CORE_ADDR address, > + struct ui_file *stream, int recurse, const struct value *val, > const struct value_print_options *options) > { > int ret; > diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi > index 24233cb..d05ebbe 100644 > --- a/gdb/doc/observer.texi > +++ b/gdb/doc/observer.texi > @@ -216,7 +216,7 @@ The inferior @var{inf} has been removed from the list of inferiors. > This method is called immediately before freeing @var{inf}. > @end deftypefun > > -@deftypefun void memory_changed (CORE_ADDR @var{addr}, int @var{len}, const bfd_byte *@var{data}) > +@deftypefun void memory_changed (CORE_ADDR @var{addr}, LONGEST @var{len}, const bfd_byte *@var{data}) > Bytes from @var{data} to @var{data} + @var{len} have been written > to the current inferior at @var{addr}. > @end deftypefun > diff --git a/gdb/doublest.c b/gdb/doublest.c > index c8c9e05..71c27c5 100644 > --- a/gdb/doublest.c > +++ b/gdb/doublest.c > @@ -770,7 +770,7 @@ floatformat_from_doublest (const struct floatformat *fmt, > but not passed on by GDB. This should be fixed. */ > > static const struct floatformat * > -floatformat_from_length (struct gdbarch *gdbarch, int len) > +floatformat_from_length (struct gdbarch *gdbarch, ULONGEST len) X > { > const struct floatformat *format; > > @@ -798,8 +798,8 @@ floatformat_from_length (struct gdbarch *gdbarch, int len) > else > format = NULL; > if (format == NULL) > - error (_("Unrecognized %d-bit floating-point type."), > - len * TARGET_CHAR_BIT); > + error (_("Unrecognized %s-bit floating-point type."), > + pulongest (len * TARGET_CHAR_BIT)); And plongest then. > return format; > } > > diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c > index caef546..e83e4d5 100644 > --- a/gdb/dwarf2loc.c > +++ b/gdb/dwarf2loc.c > @@ -1334,19 +1334,19 @@ insert_bits (unsigned int datum, > BITS_BIG_ENDIAN is taken directly from gdbarch. */ > > static void > -copy_bitwise (gdb_byte *dest, unsigned int dest_offset_bits, > - const gdb_byte *source, unsigned int source_offset_bits, > - unsigned int bit_count, > +copy_bitwise (gdb_byte *dest, ULONGEST dest_offset_bits, > + const gdb_byte *source, ULONGEST source_offset, > + ULONGEST bit_count, > int bits_big_endian) > { > - unsigned int dest_avail; > + unsigned int dest_avail, source_offset_bits; > int datum; > > /* Reduce everything to byte-size pieces. */ > dest += dest_offset_bits / 8; > dest_offset_bits %= 8; > - source += source_offset_bits / 8; > - source_offset_bits %= 8; > + source += source_offset / 8; > + source_offset_bits = source_offset % 8; I do not fully understand this whole change but it looks unrelated to this patch to me. > > dest_avail = 8 - dest_offset_bits % 8; > > @@ -1384,13 +1384,13 @@ static void > read_pieced_value (struct value *v) > { > int i; > - long offset = 0; > + LONGEST offset = 0; > ULONGEST bits_to_skip; > gdb_byte *contents; > struct piece_closure *c > = (struct piece_closure *) value_computed_closure (v); > struct frame_info *frame = frame_find_by_id (VALUE_FRAME_ID (v)); > - size_t type_len; > + ULONGEST type_len; > size_t buffer_size = 0; > char *buffer = NULL; > struct cleanup *cleanup; > @@ -1417,8 +1417,8 @@ read_pieced_value (struct value *v) > for (i = 0; i < c->n_pieces && offset < type_len; i++) > { > struct dwarf_expr_piece *p = &c->pieces[i]; > - size_t this_size, this_size_bits; > - long dest_offset_bits, source_offset_bits, source_offset; > + ULONGEST this_size, this_size_bits; > + LONGEST dest_offset_bits, source_offset_bits, source_offset; > const gdb_byte *intermediate_buffer; > > /* Compute size, source, and destination offsets for copying, in > @@ -1573,7 +1573,7 @@ write_pieced_value (struct value *to, struct value *from) > struct piece_closure *c > = (struct piece_closure *) value_computed_closure (to); > struct frame_info *frame = frame_find_by_id (VALUE_FRAME_ID (to)); > - size_t type_len; > + ULONGEST type_len; > size_t buffer_size = 0; > char *buffer = NULL; > struct cleanup *cleanup; > @@ -1589,7 +1589,7 @@ write_pieced_value (struct value *to, struct value *from) > cleanup = make_cleanup (free_current_contents, &buffer); > > contents = value_contents (from); > - bits_to_skip = 8 * value_offset (to); > + bits_to_skip = (ULONGEST)(8 * value_offset (to)); Excessive/needless cast. > if (value_bitsize (to)) > { > bits_to_skip += value_bitpos (to); > @@ -1601,8 +1601,8 @@ write_pieced_value (struct value *to, struct value *from) > for (i = 0; i < c->n_pieces && offset < type_len; i++) > { > struct dwarf_expr_piece *p = &c->pieces[i]; > - size_t this_size_bits, this_size; > - long dest_offset_bits, source_offset_bits, dest_offset, source_offset; > + ULONGEST this_size_bits, this_size; > + LONGEST dest_offset_bits, source_offset_bits, dest_offset, source_offset; > int need_bitwise; > const gdb_byte *source_buffer; > > @@ -1731,8 +1731,8 @@ write_pieced_value (struct value *to, struct value *from) > implicit pointer. */ > > static int > -check_pieced_value_bits (const struct value *value, int bit_offset, > - int bit_length, > +check_pieced_value_bits (const struct value *value, LONGEST bit_offset, > + ULONGEST bit_length, X > enum dwarf_value_location check_for) > { > struct piece_closure *c > @@ -1786,8 +1786,8 @@ check_pieced_value_bits (const struct value *value, int bit_offset, > } > > static int > -check_pieced_value_validity (const struct value *value, int bit_offset, > - int bit_length) > +check_pieced_value_validity (const struct value *value, LONGEST bit_offset, > + ULONGEST bit_length) X > { > return check_pieced_value_bits (value, bit_offset, bit_length, > DWARF_VALUE_MEMORY); > @@ -1805,8 +1805,8 @@ check_pieced_value_invalid (const struct value *value) > a synthetic pointer. */ > > static int > -check_pieced_synthetic_pointer (const struct value *value, int bit_offset, > - int bit_length) > +check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, > + ULONGEST bit_length) X > { > return check_pieced_value_bits (value, bit_offset, bit_length, > DWARF_VALUE_IMPLICIT_POINTER); > @@ -1831,9 +1831,10 @@ indirect_pieced_value (struct value *value) > struct type *type; > struct frame_info *frame; > struct dwarf2_locexpr_baton baton; > - int i, bit_offset, bit_length; > + int i; > + ULONGEST bit_length; X > struct dwarf_expr_piece *piece = NULL; > - LONGEST byte_offset; > + LONGEST byte_offset, bit_offset; > > type = check_typedef (value_type (value)); > if (TYPE_CODE (type) != TYPE_CODE_PTR) > @@ -2080,7 +2081,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, > struct value *value = dwarf_expr_fetch (ctx, 0); > gdb_byte *contents; > const gdb_byte *val_bytes; > - size_t n = TYPE_LENGTH (value_type (value)); > + ULONGEST n = TYPE_LENGTH (value_type (value)); > > if (byte_offset + TYPE_LENGTH (type) > n) > invalid_synthetic_pointer (); > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index 412fe5b..c71e366 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -804,7 +804,7 @@ struct die_info > /* Blocks are a bunch of untyped bytes. */ > struct dwarf_block > { > - unsigned int size; > + ULONGEST size; This is size of dwarf_block->data so it should be size_t. Anything larger does not make sense. One may need to do some explicit code for size checks if split warns on it. > > /* Valid only if SIZE is not zero. */ > gdb_byte *data; > @@ -940,12 +940,12 @@ dwarf2_complex_location_expr_complaint (void) > } > > static void > -dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2, > - int arg3) > +dwarf2_const_value_length_mismatch_complaint (const char *arg1, ULONGEST arg2, X > + ULONGEST arg3) X > { > complaint (&symfile_complaints, > - _("const value length mismatch for '%s', got %d, expected %d"), > - arg1, arg2, arg3); > + _("const value length mismatch for '%s', got %s, expected %s"), > + arg1, pulongest (arg2), pulongest (arg3)); There will be plongest 2x then. > } > > static void > @@ -8202,7 +8202,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, > object, and then subtract off the number of bits of > the field itself. The result is the bit offset of > the LSB of the field. */ > - int anonymous_size; > + ULONGEST anonymous_size; X > int bit_offset = DW_UNSND (attr); > > attr = dwarf2_attr (die, DW_AT_byte_size, cu); > @@ -15314,12 +15314,12 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) > case DW_FORM_block4: > case DW_FORM_block: > case DW_FORM_block1: > - fprintf_unfiltered (f, "block: size %d", > - DW_BLOCK (&die->attrs[i])->size); > + fprintf_unfiltered (f, "block: size %s", > + pulongest (DW_BLOCK (&die->attrs[i])->size)); This would be %z for size_t afterwards. > break; > case DW_FORM_exprloc: > - fprintf_unfiltered (f, "expression: size %u", > - DW_BLOCK (&die->attrs[i])->size); > + fprintf_unfiltered (f, "expression: size %s", > + pulongest (DW_BLOCK (&die->attrs[i])->size)); This would be %z for size_t afterwards. > break; > case DW_FORM_ref_addr: > fprintf_unfiltered (f, "ref address: "); > diff --git a/gdb/eval.c b/gdb/eval.c > index de1c4bd..91028cd 100644 > --- a/gdb/eval.c > +++ b/gdb/eval.c > @@ -319,7 +319,8 @@ evaluate_struct_tuple (struct value *struct_val, > int pc = *pos; > struct value *val = NULL; > int nlabels = 0; > - int bitpos, bitsize; > + int bitsize; > + LONGEST bitpos; > bfd_byte *addr; > > /* Skip past the labels, and count them. */ > @@ -462,7 +463,7 @@ init_array_element (struct value *array, struct value *element, > enum noside noside, LONGEST low_bound, LONGEST high_bound) > { > LONGEST index; > - int element_size = TYPE_LENGTH (value_type (element)); > + ULONGEST element_size = TYPE_LENGTH (value_type (element)); X > > if (exp->elts[*pos].opcode == BINOP_COMMA) > { > @@ -625,11 +626,11 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch, > /* FIXME: Also mixed integral/booleans, with result an integer. */ > { > const struct builtin_type *builtin = builtin_type (gdbarch); > - unsigned int promoted_len1 = TYPE_LENGTH (type1); > - unsigned int promoted_len2 = TYPE_LENGTH (type2); > + ULONGEST promoted_len1 = TYPE_LENGTH (type1); > + ULONGEST promoted_len2 = TYPE_LENGTH (type2); > int is_unsigned1 = TYPE_UNSIGNED (type1); > int is_unsigned2 = TYPE_UNSIGNED (type2); > - unsigned int result_len; > + ULONGEST result_len; > int unsigned_operation; > > /* Determine type length and signedness after promotion for > @@ -796,7 +797,7 @@ evaluate_subexp_standard (struct type *expect_type, > int upper, lower; > int code; > int ix; > - long mem_offset; > + LONGEST mem_offset; > struct type **arg_types; > int save_pos1; > struct symbol *function = NULL; > @@ -985,7 +986,7 @@ evaluate_subexp_standard (struct type *expect_type, > struct type *range_type = TYPE_INDEX_TYPE (type); > struct type *element_type = TYPE_TARGET_TYPE (type); > struct value *array = allocate_value (expect_type); > - int element_size = TYPE_LENGTH (check_typedef (element_type)); > + ULONGEST element_size = TYPE_LENGTH (check_typedef (element_type)); X > LONGEST low_bound, high_bound, index; > > if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) > @@ -1994,7 +1995,8 @@ evaluate_subexp_standard (struct type *expect_type, > { > struct type *type = value_type (arg1); > struct type *real_type; > - int full, top, using_enc; > + int full, using_enc; > + LONGEST top; > struct value_print_options opts; > > get_user_print_options (&opts); > diff --git a/gdb/f-lang.c b/gdb/f-lang.c > index 3368d01..e3bd983 100644 > --- a/gdb/f-lang.c > +++ b/gdb/f-lang.c > @@ -138,7 +138,7 @@ f_printchar (int c, struct type *type, struct ui_file *stream) > > static void > f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, > - unsigned int length, const char *encoding, int force_ellipses, > + ULONGEST length, const char *encoding, int force_ellipses, > const struct value_print_options *options) > { > const char *type_encoding = f_get_encoding (type); > diff --git a/gdb/f-lang.h b/gdb/f-lang.h > index 4aae3c5..d20a46f 100644 > --- a/gdb/f-lang.h > +++ b/gdb/f-lang.h > @@ -28,7 +28,7 @@ extern void f_error (char *); /* Defined in f-exp.y */ > extern void f_print_type (struct type *, const char *, struct ui_file *, int, > int); > > -extern void f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, > +extern void f_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *); > diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c > index 62a7136..f95a771 100644 > --- a/gdb/f-valprint.c > +++ b/gdb/f-valprint.c > @@ -46,7 +46,7 @@ static void f77_create_arrayprint_offset_tbl (struct type *, > struct ui_file *); > static void f77_get_dynamic_length_of_aggregate (struct type *); > > -int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; > +LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; > > /* Array which holds offsets to be applied to get a row's elements > for a given array. Array also holds the size of each subarray. */ > @@ -124,7 +124,7 @@ static void > f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) > { > struct type *tmp_type; > - int eltlen; > + ULONGEST eltlen; X > int ndimen = 1; > int upper, lower; > > @@ -164,7 +164,7 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) > static void > f77_print_array_1 (int nss, int ndimensions, struct type *type, > const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > @@ -215,7 +215,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, > > static void > f77_print_array (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, > + LONGEST embedded_offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, > const struct value *val, > @@ -258,8 +258,9 @@ static const struct generic_val_print_decorations f_decorations = > function; they are identical. */ > > void > -f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > - CORE_ADDR address, struct ui_file *stream, int recurse, > +f_val_print (struct type *type, const gdb_byte *valaddr, > + LONGEST embedded_offset, CORE_ADDR address, > + struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options) > { > @@ -371,7 +372,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > fprintf_filtered (stream, "( "); > for (index = 0; index < TYPE_NFIELDS (type); index++) > { > - int offset = TYPE_FIELD_BITPOS (type, index) / 8; > + LONGEST offset = TYPE_FIELD_BITPOS (type, index) / 8; > > val_print (TYPE_FIELD_TYPE (type, index), valaddr, > embedded_offset + offset, > diff --git a/gdb/findcmd.c b/gdb/findcmd.c > index 3fce269..6343a34 100644 > --- a/gdb/findcmd.c > +++ b/gdb/findcmd.c > @@ -169,7 +169,7 @@ parse_find_args (char *args, ULONGEST *max_countp, > while (*s != '\0') > { > LONGEST x; > - int val_bytes; > + ULONGEST val_bytes; X > > while (isspace (*s)) > ++s; > diff --git a/gdb/findvar.c b/gdb/findvar.c > index 9009e6f..d1d8266 100644 > --- a/gdb/findvar.c > +++ b/gdb/findvar.c > @@ -92,7 +92,7 @@ extract_unsigned_integer (const gdb_byte *addr, int len, > const unsigned char *startaddr = addr; > const unsigned char *endaddr = startaddr + len; > > - if (len > (int) sizeof (ULONGEST)) > + if (len > sizeof (ULONGEST)) > error (_("\ > That operation is not available on integers of more than %d bytes."), > (int) sizeof (ULONGEST)); > @@ -415,7 +415,7 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) > struct value *v; > struct type *type = SYMBOL_TYPE (var); > CORE_ADDR addr; > - int len; > + ULONGEST len; X > > /* Call check_typedef on our type to make sure that, if TYPE is > a TYPE_CODE_TYPEDEF, its length is set to the length of the target type > @@ -613,7 +613,7 @@ default_value_from_register (struct type *type, int regnum, > struct frame_info *frame) > { > struct gdbarch *gdbarch = get_frame_arch (frame); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > struct value *value = allocate_value (type); > > VALUE_LVAL (value) = lval_register; > @@ -643,10 +643,10 @@ void > read_frame_register_value (struct value *value, struct frame_info *frame) > { > struct gdbarch *gdbarch = get_frame_arch (frame); > - int offset = 0; > - int reg_offset = value_offset (value); > + LONGEST offset = 0; > + LONGEST reg_offset = value_offset (value); > int regnum = VALUE_REGNUM (value); > - int len = TYPE_LENGTH (check_typedef (value_type (value))); > + ULONGEST len = TYPE_LENGTH (check_typedef (value_type (value))); X > > gdb_assert (VALUE_LVAL (value) == lval_register); > > @@ -661,7 +661,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) > while (len > 0) > { > struct value *regval = get_frame_register_value (frame, regnum); > - int reg_len = TYPE_LENGTH (value_type (regval)) - reg_offset; > + ULONGEST reg_len = TYPE_LENGTH (value_type (regval)) - reg_offset; X > > /* If the register length is larger than the number of bytes > remaining to copy, then only copy the appropriate bytes. */ > diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c > index 1f2400a..e5a589d 100644 > --- a/gdb/frv-tdep.c > +++ b/gdb/frv-tdep.c > @@ -1123,7 +1123,7 @@ frv_extract_return_value (struct type *type, struct regcache *regcache, > { > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (len <= 4) > { > @@ -1142,7 +1142,7 @@ frv_extract_return_value (struct type *type, struct regcache *regcache, > } > else > internal_error (__FILE__, __LINE__, > - _("Illegal return value length: %d"), len); > + _("Illegal return value length: %s"), pulongest (len)); It will be plongest then. > } > > static CORE_ADDR > @@ -1213,7 +1213,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > char valbuf[4]; > struct value *arg; > struct type *arg_type; > - int len; > + ULONGEST len; X > enum type_code typecode; > CORE_ADDR regval; > int stack_space; > @@ -1331,7 +1331,7 @@ static void > frv_store_return_value (struct type *type, struct regcache *regcache, > const gdb_byte *valbuf) > { > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (len <= 4) > { > @@ -1347,7 +1347,8 @@ frv_store_return_value (struct type *type, struct regcache *regcache, > } > else > internal_error (__FILE__, __LINE__, > - _("Don't know how to return a %d-byte value."), len); > + _("Don't know how to return a %s-byte value."), > + pulongest (len)); It will be plongest then. > } > > static enum return_value_convention > diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h > index 776ce9f..9408fc1 100644 > --- a/gdb/gdbcore.h > +++ b/gdb/gdbcore.h > @@ -45,11 +45,11 @@ extern void memory_error (int status, CORE_ADDR memaddr); > > /* Like target_read_memory, but report an error if can't read. */ > > -extern void read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len); > +extern void read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len); As it operates with in-memory MYADDR buffer it should be rather size_t. split will give some warnings but those should be just one-time verified the passing is correct - therefore the signedness would not need to be kept. We could also make it LONGEST first and make it size_t in a second patch. > > /* Like target_read_stack, but report an error if can't read. */ > > -extern void read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len); > +extern void read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len); Likewise. > > /* Read an integer from debugged memory, given address and number of > bytes. */ > @@ -83,7 +83,8 @@ CORE_ADDR read_memory_typed_address (CORE_ADDR addr, struct type *type); > byteswapping, alignment, different sizes for host vs. target types, > etc. */ > > -extern void write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len); > +extern void write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, > + ULONGEST len); Likewise. > > /* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */ > extern void write_memory_unsigned_integer (CORE_ADDR addr, int len, > diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c > index 60b0839..b56d7f1 100644 > --- a/gdb/gdbtypes.c > +++ b/gdb/gdbtypes.c > @@ -1905,7 +1905,7 @@ allocate_gnat_aux_type (struct type *type) > where init_type is called with a NULL value for NAME). */ > > struct type * > -init_type (enum type_code code, int length, int flags, > +init_type (enum type_code code, ULONGEST length, int flags, X > char *name, struct objfile *objfile) > { > struct type *type; > @@ -2137,8 +2137,8 @@ is_public_ancestor (struct type *base, struct type *dclass) > > static int > is_unique_ancestor_worker (struct type *base, struct type *dclass, > - int *offset, > - const gdb_byte *valaddr, int embedded_offset, > + LONGEST *offset, > + const gdb_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, struct value *val) > { > int i, count = 0; > @@ -2149,7 +2149,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, > for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) > { > struct type *iter; > - int this_offset; > + LONGEST this_offset; > > iter = check_typedef (TYPE_BASECLASS (dclass, i)); > > @@ -2190,7 +2190,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, > int > is_unique_ancestor (struct type *base, struct value *val) > { > - int offset = -1; > + LONGEST offset = -1; > > return is_unique_ancestor_worker (base, value_type (val), &offset, > value_contents_for_printing (val), > @@ -3083,7 +3083,7 @@ recursive_dump_type (struct type *type, int spaces) > break; > } > puts_filtered ("\n"); > - printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type)); > + printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type))); > if (TYPE_OBJFILE_OWNED (type)) > { > printfi_filtered (spaces, "objfile "); > @@ -3203,8 +3203,8 @@ recursive_dump_type (struct type *type, int spaces) > idx, plongest (TYPE_FIELD_ENUMVAL (type, idx))); > else > printfi_filtered (spaces + 2, > - "[%d] bitpos %d bitsize %d type ", > - idx, TYPE_FIELD_BITPOS (type, idx), > + "[%d] bitpos %s bitsize %d type ", > + idx, plongest (TYPE_FIELD_BITPOS (type, idx)), > TYPE_FIELD_BITSIZE (type, idx)); > gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); > printf_filtered (" name '%s' (", > @@ -3486,7 +3486,7 @@ copy_type (const struct type *type) > CODE, LENGTH, and NAME fields. */ > struct type * > arch_type (struct gdbarch *gdbarch, > - enum type_code code, int length, char *name) > + enum type_code code, ULONGEST length, char *name) X > { > struct type *type; > > diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h > index 887dfdb..8c4c0de 100644 > --- a/gdb/gdbtypes.h > +++ b/gdb/gdbtypes.h > @@ -514,7 +514,7 @@ struct main_type > gdbarch_bits_big_endian=0 targets, it is the bit offset to > the LSB. */ > > - int bitpos; > + LONGEST bitpos; > > /* Enum value. */ > LONGEST enumval; > @@ -684,7 +684,7 @@ struct type > HOST_CHAR_BIT. However, this would still fail to address > machines based on a ternary or decimal representation. */ > > - unsigned length; > + ULONGEST length; > > /* Core type, shared by a group of qualified types. */ > struct main_type *main_type; > @@ -1398,11 +1398,12 @@ extern struct type *alloc_type_copy (const struct type *); > extern struct gdbarch *get_type_arch (const struct type *); > > /* Helper function to construct objfile-owned types. */ > -extern struct type *init_type (enum type_code, int, int, char *, > +extern struct type *init_type (enum type_code, ULONGEST, int, char *, X > struct objfile *); > > /* Helper functions to construct architecture-owned types. */ > -extern struct type *arch_type (struct gdbarch *, enum type_code, int, char *); > +extern struct type *arch_type (struct gdbarch *, enum type_code, ULONGEST, X > + char *); > extern struct type *arch_integer_type (struct gdbarch *, int, int, char *); > extern struct type *arch_character_type (struct gdbarch *, int, int, char *); > extern struct type *arch_boolean_type (struct gdbarch *, int, int, char *); > diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c > index e635e8f..d6b7d27 100644 > --- a/gdb/gnu-v2-abi.c > +++ b/gdb/gnu-v2-abi.c > @@ -85,8 +85,8 @@ gnuv2_is_operator_name (const char *name) > > TYPE is the type in which F is located. */ > static struct value * > -gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, > +gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field *f, int j, Sorry this is unrelated formatting change. > - struct type * type, int offset) > + struct type *type, LONGEST offset) > { > struct value *arg1 = *arg1p; > struct type *type1 = check_typedef (value_type (arg1)); > @@ -187,7 +187,8 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, > > > static struct type * > -gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc) > +gnuv2_value_rtti_type (struct value *v, int *full, LONGEST *top, > + int *using_enc) > { > struct type *known_type; > struct type *rtti_type; > @@ -342,9 +343,9 @@ vb_match (struct type *type, int index, struct type *basetype) > target). The result is the offset of the baseclass value relative > to (the address of)(ARG) + OFFSET. */ > > -static int > +static LONGEST > gnuv2_baseclass_offset (struct type *type, int index, > - const bfd_byte *valaddr, int embedded_offset, > + const bfd_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, const struct value *val) > { > struct type *basetype = TYPE_BASECLASS (type, index); > @@ -362,8 +363,8 @@ gnuv2_baseclass_offset (struct type *type, int index, > if (vb_match (type, i, basetype)) > { > struct type *field_type; > - int field_offset; > - int field_length; > + LONGEST field_offset; > + ULONGEST field_length; X > CORE_ADDR addr; > > field_type = check_typedef (TYPE_FIELD_TYPE (type, i)); > @@ -387,7 +388,7 @@ gnuv2_baseclass_offset (struct type *type, int index, > /* Don't go through baseclass_offset, as that wraps > exceptions, thus, inner exceptions would be wrapped more > than once. */ > - int boffset = > + LONGEST boffset = > gnuv2_baseclass_offset (type, i, valaddr, > embedded_offset, address, val); > > diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c > index ed94b84..180d96f 100644 > --- a/gdb/gnu-v3-abi.c > +++ b/gdb/gnu-v3-abi.c > @@ -105,7 +105,7 @@ build_gdb_vtable_type (struct gdbarch *arch) > { > struct type *t; > struct field *field_list, *field; > - int offset; > + ULONGEST offset; X > > struct type *void_ptr_type > = builtin_type (arch)->builtin_data_ptr; > @@ -181,7 +181,7 @@ vtable_ptrdiff_type (struct gdbarch *gdbarch) > /* Return the offset from the start of the imaginary `struct > gdb_gnu_v3_abi_vtable' object to the vtable's "address point" > (i.e., where objects' virtual table pointers point). */ > -static int > +static LONGEST > vtable_address_point_offset (struct gdbarch *gdbarch) > { > struct type *vtable_type = gdbarch_data (gdbarch, vtable_type_gdbarch_data); > @@ -272,7 +272,7 @@ gnuv3_get_vtable (struct gdbarch *gdbarch, > > static struct type * > gnuv3_rtti_type (struct value *value, > - int *full_p, int *top_p, int *using_enc_p) > + int *full_p, LONGEST *top_p, int *using_enc_p) > { > struct gdbarch *gdbarch; > struct type *values_type = check_typedef (value_type (value)); > @@ -384,7 +384,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, > static struct value * > gnuv3_virtual_fn_field (struct value **value_p, > struct fn_field *f, int j, > - struct type *vfn_base, int offset) > + struct type *vfn_base, LONGEST offset) > { > struct type *values_type = check_typedef (value_type (*value_p)); > struct gdbarch *gdbarch; > @@ -414,16 +414,16 @@ gnuv3_virtual_fn_field (struct value **value_p, > > -1 is returned on error. */ > > -static int > +static LONGEST > gnuv3_baseclass_offset (struct type *type, int index, > - const bfd_byte *valaddr, int embedded_offset, > + const bfd_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, const struct value *val) > { > struct gdbarch *gdbarch; > struct type *ptr_type; > struct value *vtable; > struct value *vbase_array; > - long int cur_base_offset, base_offset; > + LONGEST cur_base_offset, base_offset; > > /* Determine architecture. */ > gdbarch = get_type_arch (type); > @@ -446,7 +446,7 @@ gnuv3_baseclass_offset (struct type *type, int index, > cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch); > if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0) > error (_("Misaligned vbase offset.")); > - cur_base_offset = cur_base_offset / ((int) TYPE_LENGTH (ptr_type)); > + cur_base_offset = cur_base_offset / ((LONGEST) TYPE_LENGTH (ptr_type)); > > vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset); > gdb_assert (vtable != NULL); > @@ -490,7 +490,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, > we're out of luck. */ > for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) > { > - int pos; > + LONGEST pos; > struct type *basetype; > > if (BASETYPE_VIA_VIRTUAL (domain, i)) > diff --git a/gdb/go-lang.h b/gdb/go-lang.h > index 67b5d93..51a1f7a 100644 > --- a/gdb/go-lang.h > +++ b/gdb/go-lang.h > @@ -80,7 +80,7 @@ extern void go_print_type (struct type *type, const char *varstring, > /* Defined in go-valprint.c. */ > > extern void go_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options); > diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c > index 3be4927..3a465eb 100644 > --- a/gdb/go-valprint.c > +++ b/gdb/go-valprint.c > @@ -83,7 +83,7 @@ print_go_string (struct type *type, const gdb_byte *valaddr, > /* Implements the la_val_print routine for language Go. */ > > void > -go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > +go_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options) > diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c > index aa056f9..c3c8a7e 100644 > --- a/gdb/h8300-tdep.c > +++ b/gdb/h8300-tdep.c > @@ -642,7 +642,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > int struct_return, CORE_ADDR struct_addr) > { > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > - int stack_alloc = 0, stack_offset = 0; > + ULONGEST stack_alloc = 0, stack_offset = 0; > int wordsize = BINWORD (gdbarch); > int reg = E_ARG0_REGNUM; > int argument; > @@ -668,11 +668,11 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > for (argument = 0; argument < nargs; argument++) > { > struct type *type = value_type (args[argument]); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > char *contents = (char *) value_contents (args[argument]); > > /* Pad the argument appropriately. */ > - int padded_len = align_up (len, wordsize); > + ULONGEST padded_len = align_up (len, wordsize); X > gdb_byte *padded = alloca (padded_len); > > memset (padded, 0, padded_len); > @@ -700,7 +700,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > /* Heavens to Betsy --- it's really going in registers! > Note that on the h8/300s, there are gaps between the > registers in the register file. */ > - int offset; > + ULONGEST offset; X > > for (offset = 0; offset < padded_len; offset += wordsize) > { > diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c > index 7f7fb8e..585da78 100644 > --- a/gdb/hppa-tdep.c > +++ b/gdb/hppa-tdep.c > @@ -963,7 +963,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > { > struct value *arg = args[i]; > struct type *type = value_type (arg); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > const bfd_byte *valbuf; > bfd_byte fptrbuf[8]; > int regnum; > @@ -1158,7 +1158,7 @@ hppa64_return_value (struct gdbarch *gdbarch, struct type *func_type, > struct type *type, struct regcache *regcache, > gdb_byte *readbuf, const gdb_byte *writebuf) > { > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > int regnum, offset; > > if (len > 16) > diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c > index c353154..40a772b 100644 > --- a/gdb/i386-darwin-tdep.c > +++ b/gdb/i386-darwin-tdep.c > @@ -119,7 +119,7 @@ i386_m128_p (struct type *type) > > /* Return the alignment for TYPE when passed as an argument. */ > > -static int > +static ULONGEST X > i386_darwin_arg_type_alignment (struct type *type) > { > type = check_typedef (type); > @@ -139,7 +139,7 @@ i386_darwin_arg_type_alignment (struct type *type) > || TYPE_CODE (type) == TYPE_CODE_UNION) > { > int i; > - int res = 4; > + ULONGEST res = 4; X > for (i = 0; i < TYPE_NFIELDS (type); i++) > res = max (res, > i386_darwin_arg_type_alignment (TYPE_FIELD_TYPE (type, i))); > @@ -166,7 +166,7 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > > for (write_pass = 0; write_pass < 2; write_pass++) > { > - int args_space = 0; > + ULONGEST args_space = 0; X > int num_m128 = 0; > > if (struct_return) > @@ -196,8 +196,8 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > } > else > { > - int len = TYPE_LENGTH (arg_type); > - int align = i386_darwin_arg_type_alignment (arg_type); > + ULONGEST len = TYPE_LENGTH (arg_type); X > + ULONGEST align = i386_darwin_arg_type_alignment (arg_type); X > > args_space = align_up (args_space, align); > if (write_pass) > diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c > index 753de67..0ba1ed2 100644 > --- a/gdb/i386-nat.c > +++ b/gdb/i386-nat.c > @@ -293,7 +293,7 @@ static int i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state, > valid value, bombs through internal_error. */ > static int i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, > i386_wp_op_t what, > - CORE_ADDR addr, int len, > + CORE_ADDR addr, ULONGEST len, X > enum target_hw_bp_type type); > > /* Implementation. */ > @@ -505,8 +505,8 @@ i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state, > > static int > i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, > - i386_wp_op_t what, CORE_ADDR addr, int len, > - enum target_hw_bp_type type) > + i386_wp_op_t what, CORE_ADDR addr, > + ULONGEST len, enum target_hw_bp_type type) X > { > int retval = 0; > int max_wp_len = TARGET_HAS_DR_LEN_8 ? 8 : 4; > @@ -663,7 +663,7 @@ i386_remove_watchpoint (CORE_ADDR addr, int len, int type, > address ADDR and whose length is LEN bytes. */ > > static int > -i386_region_ok_for_watchpoint (CORE_ADDR addr, int len) > +i386_region_ok_for_watchpoint (CORE_ADDR addr, LONGEST len) > { > struct i386_debug_reg_state *state = i386_debug_reg_state (); > int nregs; > diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c > index 6858b5a..1d53bf1 100644 > --- a/gdb/i386-tdep.c > +++ b/gdb/i386-tdep.c > @@ -2343,7 +2343,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > gdb_byte buf[4]; > int i; > int write_pass; > - int args_space = 0; > + ULONGEST args_space = 0; X > > /* Determine the total space required for arguments and struct > return address in a first pass (allowing for 16-byte-aligned > @@ -2351,7 +2351,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > > for (write_pass = 0; write_pass < 2; write_pass++) > { > - int args_space_used = 0; > + ULONGEST args_space_used = 0; X > int have_16_byte_aligned_arg = 0; > > if (struct_return) > @@ -2369,7 +2369,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > > for (i = 0; i < nargs; i++) > { > - int len = TYPE_LENGTH (value_enclosing_type (args[i])); > + ULONGEST len = TYPE_LENGTH (value_enclosing_type (args[i])); X > > if (write_pass) > { > @@ -2444,7 +2444,7 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type, > struct regcache *regcache, gdb_byte *valbuf) > { > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > gdb_byte buf[I386_MAX_REGISTER_SIZE]; > > if (TYPE_CODE (type) == TYPE_CODE_FLT) > @@ -2482,8 +2482,8 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type, > } > else > internal_error (__FILE__, __LINE__, > - _("Cannot extract return value of %d bytes long."), > - len); > + _("Cannot extract return value of %s bytes long."), > + pulongest (len)); It will be plongest then. > } > } > > @@ -2495,7 +2495,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type, > struct regcache *regcache, const gdb_byte *valbuf) > { > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (TYPE_CODE (type) == TYPE_CODE_FLT) > { > @@ -2547,7 +2547,8 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type, > } > else > internal_error (__FILE__, __LINE__, > - _("Cannot store return value of %d bytes long."), len); > + _("Cannot store return value of %s bytes long."), > + pulongest (len)); It will be plongest then. > } > } > \f > diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c > index 460345b..e29f97e 100644 > --- a/gdb/ia64-tdep.c > +++ b/gdb/ia64-tdep.c > @@ -3269,7 +3269,7 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache, > int offset = 0; > int regnum = IA64_GR8_REGNUM; > int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM)); > - int n = TYPE_LENGTH (type) / reglen; > + ULONGEST n = TYPE_LENGTH (type) / reglen; X > int m = TYPE_LENGTH (type) % reglen; > > while (n-- > 0) > @@ -3319,7 +3319,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache, > int offset = 0; > int regnum = IA64_GR8_REGNUM; > int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM)); > - int n = TYPE_LENGTH (type) / reglen; > + ULONGEST n = TYPE_LENGTH (type) / reglen; X > int m = TYPE_LENGTH (type) % reglen; > > while (n-- > 0) > @@ -3725,8 +3725,10 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > int argno; > struct value *arg; > struct type *type; > - int len, argoffset; > - int nslots, rseslots, memslots, slotnum, nfuncargs; > + ULONGEST argoffset; X > + ULONGEST len; X > + int rseslots, slotnum, nfuncargs; > + ULONGEST nslots, memslots; X > int floatreg; > ULONGEST bsp; > CORE_ADDR funcdescaddr, pc, global_pointer; > diff --git a/gdb/infcall.c b/gdb/infcall.c > index 8737c7b..cfc53a7 100644 > --- a/gdb/infcall.c > +++ b/gdb/infcall.c > @@ -710,7 +710,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) > > if (struct_return || lang_struct_return) > { > - int len = TYPE_LENGTH (values_type); > + ULONGEST len = TYPE_LENGTH (values_type); X > > if (gdbarch_inner_than (gdbarch, 1, 2)) > { > diff --git a/gdb/infrun.c b/gdb/infrun.c > index ab51806..360a9b7 100644 > --- a/gdb/infrun.c > +++ b/gdb/infrun.c > @@ -6710,7 +6710,7 @@ save_infcall_suspend_state (void) > if (gdbarch_get_siginfo_type_p (gdbarch)) > { > struct type *type = gdbarch_get_siginfo_type (gdbarch); > - size_t len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); > struct cleanup *back_to; > > siginfo_data = xmalloc (len); > @@ -6767,11 +6767,10 @@ restore_infcall_suspend_state (struct infcall_suspend_state *inf_state) > if (inf_state->siginfo_gdbarch == gdbarch) > { > struct type *type = gdbarch_get_siginfo_type (gdbarch); > - size_t len = TYPE_LENGTH (type); > > /* Errors ignored. */ > target_write (¤t_target, TARGET_OBJECT_SIGNAL_INFO, NULL, > - inf_state->siginfo_data, 0, len); > + inf_state->siginfo_data, 0, TYPE_LENGTH (type)); > } > > /* The inferior can be gone if the user types "print exit(0)" > diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c > index dd8ad61..a43cf65 100644 > --- a/gdb/iq2000-tdep.c > +++ b/gdb/iq2000-tdep.c > @@ -504,7 +504,7 @@ static void > iq2000_store_return_value (struct type *type, struct regcache *regcache, > const void *valbuf) > { > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > int regno = E_FN_RETURN_REGNUM; > > while (len > 0) > @@ -550,7 +550,7 @@ iq2000_extract_return_value (struct type *type, struct regcache *regcache, > returned in a register, and if larger than 8 bytes, it is > returned in a stack location which is pointed to by the same > register. */ > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (len <= (2 * 4)) > { > @@ -578,7 +578,7 @@ iq2000_extract_return_value (struct type *type, struct regcache *regcache, > ULONGEST return_buffer; > regcache_cooked_read_unsigned (regcache, E_FN_RETURN_REGNUM, > &return_buffer); > - read_memory (return_buffer, valbuf, TYPE_LENGTH (type)); > + read_memory (return_buffer, valbuf, len); Redundant for this patch IMO. > } > } > > @@ -655,8 +655,9 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > const bfd_byte *val; > bfd_byte buf[4]; > struct type *type; > - int i, argreg, typelen, slacklen; > - int stackspace = 0; > + int i, argreg, slacklen; > + ULONGEST typelen; X > + ULONGEST stackspace = 0; X > /* Used to copy struct arguments into the stack. */ > CORE_ADDR struct_ptr; > > diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c > index c3c5298..58ed339 100644 > --- a/gdb/jv-lang.c > +++ b/gdb/jv-lang.c > @@ -438,7 +438,7 @@ java_link_class_type (struct gdbarch *gdbarch, > for (i = TYPE_N_BASECLASSES (type); i < nfields; i++) > { > int accflags; > - int boffset; > + LONGEST boffset; > > if (fields == NULL) > { > @@ -887,7 +887,7 @@ java_printchar (int c, struct type *type, struct ui_file *stream) > static void > java_printstr (struct ui_file *stream, struct type *type, > const gdb_byte *string, > - unsigned int length, const char *encoding, int force_ellipses, > + ULONGEST length, const char *encoding, int force_ellipses, > const struct value_print_options *options) > { > const char *type_encoding = java_get_encoding (type); > diff --git a/gdb/jv-lang.h b/gdb/jv-lang.h > index 8ea9c3c..bf77ccf 100644 > --- a/gdb/jv-lang.h > +++ b/gdb/jv-lang.h > @@ -42,8 +42,8 @@ struct builtin_java_type > > extern const struct builtin_java_type *builtin_java_type (struct gdbarch *); > > -extern void java_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, > - struct ui_file *, int, > +extern void java_val_print (struct type *, const gdb_byte *, LONGEST, > + CORE_ADDR, struct ui_file *, int, > const struct value *, > const struct value_print_options *); > > diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c > index 12a960f..35a55b8 100644 > --- a/gdb/jv-valprint.c > +++ b/gdb/jv-valprint.c > @@ -264,7 +264,7 @@ java_value_print (struct value *val, struct ui_file *stream, > > static void > java_print_value_fields (struct type *type, const gdb_byte *valaddr, > - int offset, > + LONGEST offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, > const struct value *val, > @@ -482,7 +482,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, > > void > java_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options) > diff --git a/gdb/language.c b/gdb/language.c > index f0a8697..9ae020e 100644 > --- a/gdb/language.c > +++ b/gdb/language.c > @@ -831,7 +831,7 @@ unk_lang_printchar (int c, struct type *type, struct ui_file *stream) > > static void > unk_lang_printstr (struct ui_file *stream, struct type *type, > - const gdb_byte *string, unsigned int length, > + const gdb_byte *string, ULONGEST length, > const char *encoding, int force_ellipses, > const struct value_print_options *options) > { > @@ -849,7 +849,7 @@ unk_lang_print_type (struct type *type, const char *varstring, > > static void > unk_lang_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options) > diff --git a/gdb/language.h b/gdb/language.h > index d612c70..c571b81 100644 > --- a/gdb/language.h > +++ b/gdb/language.h > @@ -200,7 +200,7 @@ struct language_defn > struct ui_file * stream); > > void (*la_printstr) (struct ui_file * stream, struct type *elttype, > - const gdb_byte *string, unsigned int length, > + const gdb_byte *string, ULONGEST length, > const char *encoding, int force_ellipses, > const struct value_print_options *); > > @@ -242,7 +242,7 @@ struct language_defn > > void (*la_val_print) (struct type *type, > const gdb_byte *contents, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options); > diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c > index 4f67542..80df079 100644 > --- a/gdb/lm32-tdep.c > +++ b/gdb/lm32-tdep.c > @@ -262,7 +262,7 @@ lm32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > struct value *arg = args[i]; > struct type *arg_type = check_typedef (value_type (arg)); > gdb_byte *contents; > - int len; > + ULONGEST len; X > int j; > int reg; > ULONGEST val; > @@ -354,7 +354,7 @@ lm32_store_return_value (struct type *type, struct regcache *regcache, > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > ULONGEST val; > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (len <= 4) > { > diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c > index 8faa6c1..0c9d394 100644 > --- a/gdb/m2-lang.c > +++ b/gdb/m2-lang.c > @@ -104,7 +104,7 @@ m2_printchar (int c, struct type *type, struct ui_file *stream) > > static void > m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, > - unsigned int length, const char *encoding, int force_ellipses, > + ULONGEST length, const char *encoding, int force_ellipses, > const struct value_print_options *options) > { > unsigned int i; > diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h > index fc6de34..9d65366 100644 > --- a/gdb/m2-lang.h > +++ b/gdb/m2-lang.h > @@ -32,7 +32,7 @@ extern void m2_print_typedef (struct type *, struct symbol *, > extern int m2_is_long_set (struct type *type); > extern int m2_is_unbounded_array (struct type *type); > > -extern void m2_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, > +extern void m2_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, > struct ui_file *, int, > const struct value *, > const struct value_print_options *); > diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c > index fb3d49c..effe2c9 100644 > --- a/gdb/m2-typeprint.c > +++ b/gdb/m2-typeprint.c > @@ -228,9 +228,11 @@ static void m2_array (struct type *type, struct ui_file *stream, > m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1); > } > else > - fprintf_filtered (stream, "%d", > - (TYPE_LENGTH (type) > - / TYPE_LENGTH (TYPE_TARGET_TYPE (type)))); > + { > + ULONGEST val = (TYPE_LENGTH (type) > + / TYPE_LENGTH (TYPE_TARGET_TYPE (type))); Empty line after declaration. > + fprintf_filtered (stream, "%s", pulongest (val)); > + } > } > fprintf_filtered (stream, "] OF "); > m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level); > @@ -587,7 +589,8 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show, > void > m2_enum (struct type *type, struct ui_file *stream, int show, int level) > { > - int lastval, i, len; > + LONGEST lastval; > + int i, len; > > if (show < 0) > { > diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c > index 9e1c1ff..4d13dad 100644 > --- a/gdb/m2-valprint.c > +++ b/gdb/m2-valprint.c > @@ -36,7 +36,7 @@ static int print_unpacked_pointer (struct type *type, > struct ui_file *stream); > static void > m2_print_array_contents (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > @@ -68,7 +68,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high) > > static void > m2_print_long_set (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream) > { > int empty_set = 1; > @@ -159,7 +159,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr, > > static void > m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value_print_options *options) > { > @@ -256,22 +256,20 @@ print_variable_at_address (struct type *type, > > static void > m2_print_array_contents (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > int len) > { > - int eltlen; > CHECK_TYPEDEF (type); > > if (TYPE_LENGTH (type) > 0) > { > - eltlen = TYPE_LENGTH (type); > if (options->prettyprint_arrays) > print_spaces_filtered (2 + 2 * recurse, stream); > /* For an array of chars, print with string syntax. */ > - if (eltlen == 1 && > + if (TYPE_LENGTH (type) == 1 && > ((TYPE_CODE (type) == TYPE_CODE_INT) > || ((current_language->la_language == language_m2) > && (TYPE_CODE (type) == TYPE_CODE_CHAR))) > @@ -304,16 +302,16 @@ static const struct generic_val_print_decorations m2_decorations = > function; they are identical. */ > > void > -m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > - CORE_ADDR address, struct ui_file *stream, int recurse, > +m2_val_print (struct type *type, const gdb_byte *valaddr, > + LONGEST embedded_offset, CORE_ADDR address, > + struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options) > { > struct gdbarch *gdbarch = get_type_arch (type); > - unsigned int i = 0; /* Number of characters printed. */ > - unsigned len; > + ULONGEST i = 0; /* Number of characters printed. */ > + ULONGEST len; > struct type *elttype; > - unsigned eltlen; > LONGEST val; > CORE_ADDR addr; > > @@ -324,12 +322,11 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0) > { > elttype = check_typedef (TYPE_TARGET_TYPE (type)); > - eltlen = TYPE_LENGTH (elttype); > - len = TYPE_LENGTH (type) / eltlen; > + len = TYPE_LENGTH (type) / TYPE_LENGTH (elttype); > if (options->prettyprint_arrays) > print_spaces_filtered (2 + 2 * recurse, stream); > /* For an array of chars, print with string syntax. */ > - if (eltlen == 1 && > + if (TYPE_LENGTH (elttype) == 1 && > ((TYPE_CODE (elttype) == TYPE_CODE_INT) > || ((current_language->la_language == language_m2) > && (TYPE_CODE (elttype) == TYPE_CODE_CHAR))) > @@ -339,7 +336,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > elements up to it. */ > if (options->stop_print_at_null) > { > - unsigned int temp_len; > + ULONGEST temp_len; > > /* Look for a NULL char. */ > for (temp_len = 0; > diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c > index d504eb3..50d08a9 100644 > --- a/gdb/m32r-tdep.c > +++ b/gdb/m32r-tdep.c > @@ -696,7 +696,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > CORE_ADDR regval; > gdb_byte *val; > gdb_byte valbuf[MAX_REGISTER_SIZE]; > - int len; > + ULONGEST len; X > int odd_sized_struct; > > /* First force sp to a 4-byte alignment. */ > @@ -791,7 +791,7 @@ m32r_extract_return_value (struct type *type, struct regcache *regcache, > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > bfd_byte *valbuf = dst; > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > ULONGEST tmp; > > /* By using store_unsigned_integer we avoid having to do > diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c > index 1215de8..e9c3ee9 100644 > --- a/gdb/m68hc11-tdep.c > +++ b/gdb/m68hc11-tdep.c > @@ -1174,7 +1174,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > int first_stack_argnum; > struct type *type; > char *val; > - int len; > + ULONGEST len; X > char buf[2]; > > first_stack_argnum = 0; > @@ -1266,7 +1266,7 @@ static void > m68hc11_store_return_value (struct type *type, struct regcache *regcache, > const void *valbuf) > { > - int len; > + ULONGEST len; X > > len = TYPE_LENGTH (type); > > diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c > index ee72026..a219c72 100644 > --- a/gdb/m68k-tdep.c > +++ b/gdb/m68k-tdep.c > @@ -292,7 +292,7 @@ static void > m68k_extract_return_value (struct type *type, struct regcache *regcache, > gdb_byte *valbuf) > { > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > gdb_byte buf[M68K_MAX_REGISTER_SIZE]; > > if (len <= 4) > @@ -308,14 +308,14 @@ m68k_extract_return_value (struct type *type, struct regcache *regcache, > } > else > internal_error (__FILE__, __LINE__, > - _("Cannot extract return value of %d bytes long."), len); > + _("Cannot extract return value of %s bytes long."), > + pulongest (len)); It will be plongest then. > } > > static void > m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache, > gdb_byte *valbuf) > { > - int len = TYPE_LENGTH (type); > gdb_byte buf[M68K_MAX_REGISTER_SIZE]; > struct gdbarch *gdbarch = get_regcache_arch (regcache); > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > @@ -326,7 +326,7 @@ m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache, > regcache_raw_read (regcache, M68K_FP0_REGNUM, buf); > convert_typed_floating (buf, fpreg_type, valbuf, type); > } > - else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4) > + else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4) > regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf); > else > m68k_extract_return_value (type, regcache, valbuf); > @@ -338,7 +338,7 @@ static void > m68k_store_return_value (struct type *type, struct regcache *regcache, > const gdb_byte *valbuf) > { > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (len <= 4) > regcache_raw_write_part (regcache, M68K_D0_REGNUM, 4 - len, len, valbuf); > @@ -350,14 +350,14 @@ m68k_store_return_value (struct type *type, struct regcache *regcache, > } > else > internal_error (__FILE__, __LINE__, > - _("Cannot store return value of %d bytes long."), len); > + _("Cannot store return value of %s bytes long."), > + pulongest (len)); It will be plongest then. > } > > static void > m68k_svr4_store_return_value (struct type *type, struct regcache *regcache, > const gdb_byte *valbuf) > { > - int len = TYPE_LENGTH (type); > struct gdbarch *gdbarch = get_regcache_arch (regcache); > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > > @@ -368,7 +368,7 @@ m68k_svr4_store_return_value (struct type *type, struct regcache *regcache, > convert_typed_floating (valbuf, type, buf, fpreg_type); > regcache_raw_write (regcache, M68K_FP0_REGNUM, buf); > } > - else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4) > + else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4) > { > regcache_raw_write (regcache, M68K_A0_REGNUM, valbuf); > regcache_raw_write (regcache, M68K_D0_REGNUM, valbuf); > @@ -515,9 +515,9 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > for (i = nargs - 1; i >= 0; i--) > { > struct type *value_type = value_enclosing_type (args[i]); > - int len = TYPE_LENGTH (value_type); > - int container_len = (len + 3) & ~3; > - int offset; > + ULONGEST len = TYPE_LENGTH (value_type); X > + ULONGEST container_len = (len + 3) & ~3; X > + ULONGEST offset; X > > /* Non-scalars bigger than 4 bytes are left aligned, others are > right aligned. */ > diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c > index 1fda594..133be43 100644 > --- a/gdb/m88k-tdep.c > +++ b/gdb/m88k-tdep.c > @@ -259,14 +259,14 @@ m88k_store_arguments (struct regcache *regcache, int nargs, > struct value **args, CORE_ADDR sp) > { > struct gdbarch *gdbarch = get_regcache_arch (regcache); > - int num_register_words = 0; > - int num_stack_words = 0; > + ULONGEST num_register_words = 0; X > + ULONGEST num_stack_words = 0; X > int i; > > for (i = 0; i < nargs; i++) > { > struct type *type = value_type (args[i]); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (m88k_integral_or_pointer_p (type) && len < 4) > { > @@ -387,7 +387,7 @@ m88k_return_value (struct gdbarch *gdbarch, struct type *func_type, > struct type *type, struct regcache *regcache, > gdb_byte *readbuf, const gdb_byte *writebuf) > { > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > gdb_byte buf[8]; > > if (!m88k_integral_or_pointer_p (type) && !m88k_floating_p (type)) > diff --git a/gdb/memrange.c b/gdb/memrange.c > index ed41b9a..a655dd5 100644 > --- a/gdb/memrange.c > +++ b/gdb/memrange.c > @@ -21,8 +21,8 @@ > #include "memrange.h" > > int > -mem_ranges_overlap (CORE_ADDR start1, int len1, > - CORE_ADDR start2, int len2) > +mem_ranges_overlap (CORE_ADDR start1, ULONGEST len1, > + CORE_ADDR start2, ULONGEST len2) X > { > ULONGEST h, l; > > diff --git a/gdb/memrange.h b/gdb/memrange.h > index 926af22..e07b962 100644 > --- a/gdb/memrange.h > +++ b/gdb/memrange.h > @@ -30,7 +30,7 @@ struct mem_range > CORE_ADDR start; > > /* Length of the range. */ > - int length; > + ULONGEST length; X > }; > > typedef struct mem_range mem_range_s; > @@ -40,8 +40,8 @@ DEF_VEC_O(mem_range_s); > /* Returns true if the ranges defined by [start1, start1+len1) and > [start2, start2+len2) overlap. */ > > -extern int mem_ranges_overlap (CORE_ADDR start1, int len1, > - CORE_ADDR start2, int len2); > +extern int mem_ranges_overlap (CORE_ADDR start1, ULONGEST len1, > + CORE_ADDR start2, ULONGEST len2); X > > /* Sort ranges by start address, then coalesce contiguous or > overlapping ranges. */ > diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c > index fea14bf..287ef25 100644 > --- a/gdb/mep-tdep.c > +++ b/gdb/mep-tdep.c > @@ -2279,7 +2279,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv, > > for (i = 0; i < argc; i++) > { > - unsigned arg_len = TYPE_LENGTH (value_type (argv[i])); > + ULONGEST arg_len = TYPE_LENGTH (value_type (argv[i])); > > if (arg_len > MEP_GPR_SIZE) > { > @@ -2337,7 +2337,7 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > > for (i = 0; i < argc; i++) > { > - unsigned arg_size = TYPE_LENGTH (value_type (argv[i])); > + ULONGEST arg_size = TYPE_LENGTH (value_type (argv[i])); > ULONGEST value; > > /* Arguments that fit in a GPR get expanded to fill the GPR. */ > diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c > index 3ce3d1c..b33c556 100644 > --- a/gdb/microblaze-tdep.c > +++ b/gdb/microblaze-tdep.c > @@ -591,7 +591,7 @@ static void > microblaze_store_return_value (struct type *type, struct regcache *regcache, > const gdb_byte *valbuf) > { > - int len = TYPE_LENGTH (type); > + int ULONGEST len = TYPE_LENGTH (type); This is some typo. And it should be LONGEST. > gdb_byte buf[8]; > > memset (buf, 0, sizeof(buf)); > diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c > index 9a3c7fb..8c4440d 100644 > --- a/gdb/mips-tdep.c > +++ b/gdb/mips-tdep.c > @@ -302,7 +302,7 @@ static void > mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, > int reg_num, int length, > enum bfd_endian endian, gdb_byte *in, > - const gdb_byte *out, int buf_offset) > + const gdb_byte *out, LONGEST buf_offset) > { > int reg_offset = 0; > > @@ -325,8 +325,8 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, > } > if (mips_debug) > fprintf_unfiltered (gdb_stderr, > - "xfer $%d, reg offset %d, buf offset %d, length %d, ", > - reg_num, reg_offset, buf_offset, length); > + "xfer $%d, reg offset %d, buf offset %s, length %d, ", > + reg_num, reg_offset, plongest (buf_offset), length); > if (mips_debug && out != NULL) > { > int i; > @@ -3078,13 +3078,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > gdb_byte valbuf[MAX_REGISTER_SIZE]; > struct value *arg = args[argnum]; > struct type *arg_type = check_typedef (value_type (arg)); > - int len = TYPE_LENGTH (arg_type); > + ULONGEST len = TYPE_LENGTH (arg_type); X > enum type_code typecode = TYPE_CODE (arg_type); > > if (mips_debug) > fprintf_unfiltered (gdb_stdlog, > - "mips_eabi_push_dummy_call: %d len=%d type=%d", > - argnum + 1, len, (int) typecode); > + "mips_eabi_push_dummy_call: %d len=%s type=%d", > + argnum + 1, pulongest (len), (int) typecode); It will be plongest then. > > /* Function pointer arguments to mips16 code need to be made into > mips16 pointers. */ > @@ -3369,7 +3369,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct type *func_type, > > static int > mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, > - int offset) > + LONGEST offset) > { > int i; > > @@ -3384,7 +3384,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, > > for (i = 0; i < TYPE_NFIELDS (arg_type); i++) > { > - int pos; > + LONGEST pos; > struct type *field_type; > > /* We're only looking at normal fields. */ > @@ -3778,11 +3778,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct type *func_type, > : MIPS_V0_REGNUM); > field < TYPE_NFIELDS (type); field++, regnum += 2) > { > - int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) > - / TARGET_CHAR_BIT); > + LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) > + / TARGET_CHAR_BIT); > if (mips_debug) > - fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", > - offset); > + fprintf_unfiltered (gdb_stderr, "Return float struct+%s\n", > + plongest (offset)); > if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) > { > /* A 16-byte long double field goes in two consecutive > @@ -3869,7 +3869,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > int argreg; > int float_argreg; > int argnum; > - int len = 0; > + ULONGEST len = 0; X > int stack_offset = 0; > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > @@ -3896,13 +3896,12 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > for (argnum = 0; argnum < nargs; argnum++) > { > struct type *arg_type = check_typedef (value_type (args[argnum])); > - int arglen = TYPE_LENGTH (arg_type); > > /* Align to double-word if necessary. */ > if (mips_type_needs_double_align (arg_type)) > len = align_up (len, MIPS32_REGSIZE * 2); > /* Allocate space on the stack. */ > - len += align_up (arglen, MIPS32_REGSIZE); > + len += align_up (TYPE_LENGTH (arg_type), MIPS32_REGSIZE); > } > sp -= align_up (len, 16); > > @@ -3935,13 +3934,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > const gdb_byte *val; > struct value *arg = args[argnum]; > struct type *arg_type = check_typedef (value_type (arg)); > - int len = TYPE_LENGTH (arg_type); > + ULONGEST len = TYPE_LENGTH (arg_type); X > enum type_code typecode = TYPE_CODE (arg_type); > > if (mips_debug) > fprintf_unfiltered (gdb_stdlog, > - "mips_o32_push_dummy_call: %d len=%d type=%d", > - argnum + 1, len, (int) typecode); > + "mips_o32_push_dummy_call: %d len=%s type=%d", > + argnum + 1, pulongest (len), (int) typecode); It will be plongest then. > > val = value_contents (arg); > > @@ -4337,8 +4336,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > int argreg; > int float_argreg; > int argnum; > - int len = 0; > - int stack_offset = 0; > + ULONGEST len = 0; X > + ULONGEST stack_offset = 0; X > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > CORE_ADDR func_addr = find_function_addr (function, NULL); > @@ -4364,10 +4363,9 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > for (argnum = 0; argnum < nargs; argnum++) > { > struct type *arg_type = check_typedef (value_type (args[argnum])); > - int arglen = TYPE_LENGTH (arg_type); > > /* Allocate space on the stack. */ > - len += align_up (arglen, MIPS64_REGSIZE); > + len += align_up (TYPE_LENGTH (arg_type), MIPS64_REGSIZE); > } > sp -= align_up (len, 16); > > @@ -4401,13 +4399,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > gdb_byte valbuf[MAX_REGISTER_SIZE]; > struct value *arg = args[argnum]; > struct type *arg_type = check_typedef (value_type (arg)); > - int len = TYPE_LENGTH (arg_type); > + ULONGEST len = TYPE_LENGTH (arg_type); X > enum type_code typecode = TYPE_CODE (arg_type); > > if (mips_debug) > fprintf_unfiltered (gdb_stdlog, > - "mips_o64_push_dummy_call: %d len=%d type=%d", > - argnum + 1, len, (int) typecode); > + "mips_o64_push_dummy_call: %d len=%s type=%d", > + argnum + 1, pulongest (len), (int) typecode); THis will be plongest then. > > val = value_contents (arg); > > diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c > index 116a03e..ee68407 100644 > --- a/gdb/mn10300-tdep.c > +++ b/gdb/mn10300-tdep.c > @@ -83,10 +83,11 @@ struct mn10300_prologue > > /* Compute the alignment required by a type. */ > > -static int > +static ULONGEST X > mn10300_type_align (struct type *type) > { > - int i, align = 1; > + int i; > + ULONGEST align = 1; X > > switch (TYPE_CODE (type)) > { > @@ -108,7 +109,7 @@ mn10300_type_align (struct type *type) > case TYPE_CODE_UNION: > for (i = 0; i < TYPE_NFIELDS (type); i++) > { > - int falign = mn10300_type_align (TYPE_FIELD_TYPE (type, i)); > + ULONGEST falign = mn10300_type_align (TYPE_FIELD_TYPE (type, i)); X > while (align < falign) > align <<= 1; > } > @@ -1228,7 +1229,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > const int push_size = register_size (gdbarch, E_PC_REGNUM); > int regs_used; > - int len, arg_len; > + ULONGEST len, arg_len; X > int stack_offset = 0; > int argnum; > char *val, valbuf[MAX_REGISTER_SIZE]; > diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c > index 1f5f33f..43e2e69 100644 > --- a/gdb/moxie-tdep.c > +++ b/gdb/moxie-tdep.c > @@ -124,7 +124,7 @@ moxie_store_return_value (struct type *type, struct regcache *regcache, > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > CORE_ADDR regval; > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > /* Things always get returned in RET1_REGNUM, RET2_REGNUM. */ > regval = extract_unsigned_integer (valbuf, len > 4 ? 4 : len, byte_order); > @@ -321,7 +321,7 @@ moxie_extract_return_value (struct type *type, struct regcache *regcache, > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > bfd_byte *valbuf = dst; > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > ULONGEST tmp; > > /* By using store_unsigned_integer we avoid having to do > diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c > index 268be86..fa277f4 100644 > --- a/gdb/mt-tdep.c > +++ b/gdb/mt-tdep.c > @@ -783,9 +783,9 @@ mt_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > gdb_byte buf[MT_MAX_STRUCT_SIZE]; > int argreg = MT_1ST_ARGREG; > int split_param_len = 0; > - int stack_dest = sp; > + ULONGEST stack_dest = sp; X > int slacklen; > - int typelen; > + ULONGEST typelen; X > int i, j; > > /* First handle however many args we can fit into MT_1ST_ARGREG thru > diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c > index 15bf792..f0462f8 100644 > --- a/gdb/objc-lang.c > +++ b/gdb/objc-lang.c > @@ -347,7 +347,7 @@ objc_printchar (int c, struct type *type, struct ui_file *stream) > > static void > objc_printstr (struct ui_file *stream, struct type *type, > - const gdb_byte *string, unsigned int length, > + const gdb_byte *string, ULONGEST length, > const char *encoding, int force_ellipses, > const struct value_print_options *options) > { > diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c > index 54075a4..ef74f48 100644 > --- a/gdb/opencl-lang.c > +++ b/gdb/opencl-lang.c > @@ -80,11 +80,11 @@ builtin_opencl_type (struct gdbarch *gdbarch) > > static struct type * > lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code, > - unsigned int el_length, unsigned int flag_unsigned, > + ULONGEST el_length, unsigned int flag_unsigned, > int n) > { > int i; > - unsigned int length; > + ULONGEST length; > struct type *type = NULL; > struct type **types = builtin_opencl_type (gdbarch); > > @@ -174,9 +174,9 @@ lval_func_read (struct value *v) > struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); > struct type *type = check_typedef (value_type (v)); > struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); > - int offset = value_offset (v); > - int elsize = TYPE_LENGTH (eltype); > - int n, i, j = 0; > + LONGEST offset = value_offset (v); > + ULONGEST elsize = TYPE_LENGTH (eltype); X > + LONGEST n, i, j = 0; > LONGEST lowb = 0; > LONGEST highb = 0; > > @@ -203,9 +203,9 @@ lval_func_write (struct value *v, struct value *fromval) > struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); > struct type *type = check_typedef (value_type (v)); > struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); > - int offset = value_offset (v); > - int elsize = TYPE_LENGTH (eltype); > - int n, i, j = 0; > + LONGEST offset = value_offset (v); > + ULONGEST elsize = TYPE_LENGTH (eltype); X > + LONGEST n, i, j = 0; > LONGEST lowb = 0; > LONGEST highb = 0; > > @@ -243,17 +243,18 @@ lval_func_write (struct value *v, struct value *fromval) > /* Return nonzero if all bits in V within OFFSET and LENGTH are valid. */ > > static int > -lval_func_check_validity (const struct value *v, int offset, int length) > +lval_func_check_validity (const struct value *v, LONGEST offset, > + ULONGEST length) X > { > struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); > /* Size of the target type in bits. */ > - int elsize = > - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; > + ULONGEST elsize = X > + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; > int startrest = offset % elsize; > - int start = offset / elsize; > + LONGEST start = offset / elsize; > int endrest = (offset + length) % elsize; > - int end = (offset + length) / elsize; > - int i; > + LONGEST end = (offset + length) / elsize; > + LONGEST i; > > if (endrest) > end++; > @@ -281,8 +282,8 @@ lval_func_check_any_valid (const struct value *v) > { > struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); > /* Size of the target type in bits. */ > - int elsize = > - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; > + ULONGEST elsize = X > + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; > int i; > > for (i = 0; i < c->n; i++) > @@ -297,17 +298,17 @@ lval_func_check_any_valid (const struct value *v) > > static int > lval_func_check_synthetic_pointer (const struct value *v, > - int offset, int length) > + LONGEST offset, ULONGEST length) X > { > struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); > /* Size of the target type in bits. */ > - int elsize = > - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; > + ULONGEST elsize = X > + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; > int startrest = offset % elsize; > - int start = offset / elsize; > + LONGEST start = offset / elsize; > int endrest = (offset + length) % elsize; > - int end = (offset + length) / elsize; > - int i; > + LONGEST end = (offset + length) / elsize; > + LONGEST i; > > if (endrest) > end++; > diff --git a/gdb/p-lang.c b/gdb/p-lang.c > index c59ba0b..94f4ad6 100644 > --- a/gdb/p-lang.c > +++ b/gdb/p-lang.c > @@ -96,8 +96,8 @@ pascal_main_name (void) > are not multiple of TARGET_CHAR_BIT then the results are wrong > but this does not happen for Free Pascal nor for GPC. */ > int > -is_pascal_string_type (struct type *type,int *length_pos, > - int *length_size, int *string_pos, > +is_pascal_string_type (struct type *type, LONGEST *length_pos, > + ULONGEST *length_size, LONGEST *string_pos, X > struct type **char_type, > const char **arrayname) > { > @@ -217,7 +217,7 @@ pascal_printchar (int c, struct type *type, struct ui_file *stream) > > void > pascal_printstr (struct ui_file *stream, struct type *type, > - const gdb_byte *string, unsigned int length, > + const gdb_byte *string, ULONGEST length, > const char *encoding, int force_ellipses, > const struct value_print_options *options) > { > diff --git a/gdb/p-lang.h b/gdb/p-lang.h > index b1e218c..32abab2 100644 > --- a/gdb/p-lang.h > +++ b/gdb/p-lang.h > @@ -35,7 +35,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *, > extern void pascal_print_typedef (struct type *, struct symbol *, > struct ui_file *); > > -extern void pascal_val_print (struct type *, const gdb_byte *, int, > +extern void pascal_val_print (struct type *, const gdb_byte *, LONGEST, > CORE_ADDR, struct ui_file *, int, > const struct value *, > const struct value_print_options *); > @@ -49,13 +49,13 @@ extern void pascal_type_print_method_args (const char *, const char *, > /* These are in p-lang.c: */ > > extern int > - is_pascal_string_type (struct type *, int *, int *, int *, > + is_pascal_string_type (struct type *, LONGEST *, ULONGEST *, LONGEST *, X > struct type **, const char **); > > extern void pascal_printchar (int, struct type *, struct ui_file *); > > extern void pascal_printstr (struct ui_file *, struct type *, const gdb_byte *, > - unsigned int, const char *, int, > + ULONGEST, const char *, int, > const struct value_print_options *); > > extern struct type **const (pascal_builtin_types[]); > @@ -69,7 +69,7 @@ extern void > pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int); > > extern void pascal_object_print_value_fields (struct type *, const gdb_byte *, > - int, > + LONGEST, > CORE_ADDR, struct ui_file *, > int, > const struct value *, > diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c > index a00f5b3..828b0ce 100644 > --- a/gdb/p-typeprint.c > +++ b/gdb/p-typeprint.c > @@ -442,7 +442,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, > { > int i; > int len; > - int lastval; > + LONGEST lastval; > enum > { > s_none, s_public, s_private, s_protected > diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c > index d6373ae..807f396 100644 > --- a/gdb/p-valprint.c > +++ b/gdb/p-valprint.c > @@ -58,7 +58,7 @@ static const struct generic_val_print_decorations p_decorations = > > void > pascal_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options) > @@ -69,8 +69,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, > unsigned len; > LONGEST low_bound, high_bound; > struct type *elttype; > - unsigned eltlen; > - int length_pos, length_size, string_pos; > + ULONGEST eltlen; > + LONGEST length_pos, string_pos; > + ULONGEST length_size; X > struct type *char_type; > LONGEST val; > CORE_ADDR addr; > @@ -464,7 +465,7 @@ static void pascal_object_print_static_field (struct value *, > const struct value_print_options *); > > static void pascal_object_print_value (struct type *, const gdb_byte *, > - int, > + LONGEST, > CORE_ADDR, struct ui_file *, int, > const struct value *, > const struct value_print_options *, > @@ -523,7 +524,7 @@ pascal_object_is_vtbl_member (struct type *type) > > void > pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, > - int offset, > + LONGEST offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, > const struct value *val, > @@ -718,7 +719,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, > > static void > pascal_object_print_value (struct type *type, const gdb_byte *valaddr, > - int offset, > + LONGEST offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, > const struct value *val, > @@ -741,11 +742,11 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr, > > for (i = 0; i < n_baseclasses; i++) > { > - int boffset = 0; > + LONGEST boffset = 0; > struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); > const char *basename = type_name_no_tag (baseclass); > const gdb_byte *base_valaddr = NULL; > - int thisoffset; > + LONGEST thisoffset; > volatile struct gdb_exception ex; > int skip = 0; > > diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c > index 9bd11fd..ca58089 100644 > --- a/gdb/ppc-linux-nat.c > +++ b/gdb/ppc-linux-nat.c > @@ -1927,7 +1927,7 @@ num_memory_accesses (struct value *v) > of the constant. */ > static int > check_condition (CORE_ADDR watch_addr, struct expression *cond, > - CORE_ADDR *data_value, int *len) > + CORE_ADDR *data_value, ULONGEST *len) X > { > int pc = 1, num_accesses_left, num_accesses_right; > struct value *left_val, *right_val, *left_chain, *right_chain; > diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c > index 20598d0..8623c14 100644 > --- a/gdb/ppc-sysv-tdep.c > +++ b/gdb/ppc-sysv-tdep.c > @@ -100,9 +100,9 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > /* Next available vector register for vector arguments. */ > int vreg = 2; > /* Arguments start above the "LR save word" and "Back chain". */ > - int argoffset = 2 * tdep->wordsize; > + ULONGEST argoffset = 2 * tdep->wordsize; X > /* Structures start after the arguments. */ > - int structoffset = argoffset + argspace; > + ULONGEST structoffset = argoffset + argspace; X > > /* If the function is returning a `struct', then the first word > (which will be passed in r3) is used for struct return > @@ -121,7 +121,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > { > struct value *arg = args[argno]; > struct type *type = check_typedef (value_type (arg)); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > const bfd_byte *val = value_contents (arg); > > if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8 > @@ -353,7 +353,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > /* OpenCL vectors shorter than 16 bytes are passed as if > a series of independent scalars. */ > struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); > - int i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); > + ULONGEST i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); X > > for (i = 0; i < nelt; i++) > { > @@ -841,11 +841,11 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, > && opencl_abi) > { > struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); > - int i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); > + ULONGEST i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); X > > for (i = 0; i < nelt; i++) > { > - int offset = i * TYPE_LENGTH (eltype); > + ULONGEST offset = i * TYPE_LENGTH (eltype); X > > if (TYPE_CODE (eltype) == TYPE_CODE_FLT) > { > @@ -1591,7 +1591,7 @@ ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, > register. Work around this by always writing the > value to memory. Fortunately, doing this > simplifies the code. */ > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > if (len < tdep->wordsize) > write_memory (gparam + tdep->wordsize - len, val, len); > else > @@ -1840,12 +1840,12 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *func_type, > && TYPE_LENGTH (valtype) >= 16 > && opencl_abi) > { > - int n_regs = TYPE_LENGTH (valtype) / 16; > - int i; > + ULONGEST n_regs = TYPE_LENGTH (valtype) / 16; X > + ULONGEST i; X > > for (i = 0; i < n_regs; i++) > { > - int offset = i * 16; > + ULONGEST offset = i * 16; X > int regnum = tdep->ppc_vr0_regnum + 2 + i; > > if (writebuf != NULL) > diff --git a/gdb/printcmd.c b/gdb/printcmd.c > index d441dfe..639bc97 100644 > --- a/gdb/printcmd.c > +++ b/gdb/printcmd.c > @@ -296,7 +296,7 @@ print_formatted (struct value *val, int size, > struct ui_file *stream) > { > struct type *type = check_typedef (value_type (val)); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (VALUE_LVAL (val) == lval_memory) > next_address = value_address (val) + len; > @@ -352,7 +352,7 @@ float_type_from_length (struct type *type) > { > struct gdbarch *gdbarch = get_type_arch (type); > const struct builtin_type *builtin = builtin_type (gdbarch); > - unsigned int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); > > if (len == TYPE_LENGTH (builtin->builtin_float)) > type = builtin->builtin_float; > @@ -375,7 +375,7 @@ print_scalar_formatted (const void *valaddr, struct type *type, > { > struct gdbarch *gdbarch = get_type_arch (type); > LONGEST val_long = 0; > - unsigned int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > > /* String printing should go through val_print_scalar_formatted. */ > diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c > index 86d4f2c..1ceb23b 100644 > --- a/gdb/python/py-prettyprint.c > +++ b/gdb/python/py-prettyprint.c > @@ -676,7 +676,7 @@ print_children (PyObject *printer, const char *hint, > > int > apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > @@ -824,7 +824,7 @@ gdbpy_default_visualizer (PyObject *self, PyObject *args) > > int > apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > diff --git a/gdb/python/python.h b/gdb/python/python.h > index dd7066f..2a57409 100644 > --- a/gdb/python/python.h > +++ b/gdb/python/python.h > @@ -31,7 +31,7 @@ void eval_python_from_control_command (struct command_line *); > void source_python_script (FILE *file, const char *filename); > > int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > diff --git a/gdb/regcache.c b/gdb/regcache.c > index c716280..12ed8fa 100644 > --- a/gdb/regcache.c > +++ b/gdb/regcache.c > @@ -902,7 +902,7 @@ typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum, > > static enum register_status > regcache_xfer_part (struct regcache *regcache, int regnum, > - int offset, int len, void *in, const void *out, > + LONGEST offset, int len, void *in, const void *out, > enum register_status (*read) (struct regcache *regcache, > int regnum, > gdb_byte *buf), > @@ -968,7 +968,7 @@ regcache_raw_write_part (struct regcache *regcache, int regnum, > > enum register_status > regcache_cooked_read_part (struct regcache *regcache, int regnum, > - int offset, int len, gdb_byte *buf) > + LONGEST offset, int len, gdb_byte *buf) > { > struct regcache_descr *descr = regcache->descr; > > @@ -979,7 +979,7 @@ regcache_cooked_read_part (struct regcache *regcache, int regnum, > > void > regcache_cooked_write_part (struct regcache *regcache, int regnum, > - int offset, int len, const gdb_byte *buf) > + LONGEST offset, int len, const gdb_byte *buf) > { > struct regcache_descr *descr = regcache->descr; > > diff --git a/gdb/regcache.h b/gdb/regcache.h > index 93b4499..81ccda6 100644 > --- a/gdb/regcache.h > +++ b/gdb/regcache.h > @@ -129,10 +129,10 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache, > write style operations. */ > > enum register_status regcache_cooked_read_part (struct regcache *regcache, > - int regnum, int offset, > + int regnum, LONGEST offset, > int len, gdb_byte *buf); > void regcache_cooked_write_part (struct regcache *regcache, int regnum, > - int offset, int len, const gdb_byte *buf); > + LONGEST offset, int len, const gdb_byte *buf); > > /* Special routines to read/write the PC. */ > > diff --git a/gdb/remote.c b/gdb/remote.c > index 68864d1..995afe7 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -6450,7 +6450,7 @@ check_binary_download (CORE_ADDR addr) > > static int > remote_write_bytes_aux (const char *header, CORE_ADDR memaddr, > - const gdb_byte *myaddr, int len, > + const gdb_byte *myaddr, LONGEST len, > char packet_format, int use_length) > { > struct remote_state *rs = get_remote_state (); > @@ -6611,7 +6611,7 @@ remote_write_bytes_aux (const char *header, CORE_ADDR memaddr, > error. Only transfer a single packet. */ > > static int > -remote_write_bytes (CORE_ADDR memaddr, const gdb_byte *myaddr, int len) > +remote_write_bytes (CORE_ADDR memaddr, const gdb_byte *myaddr, LONGEST len) > { > char *packet_format = 0; > > @@ -8034,7 +8034,7 @@ int remote_hw_watchpoint_length_limit = -1; > int remote_hw_breakpoint_limit = -1; > > static int > -remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) > +remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) > { > if (remote_hw_watchpoint_length_limit == 0) > return 0; > diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c > index 7a84769..a8b3f6a 100644 > --- a/gdb/rl78-tdep.c > +++ b/gdb/rl78-tdep.c > @@ -1019,9 +1019,8 @@ rl78_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > for (i = nargs - 1; i >= 0; i--) > { > struct type *value_type = value_enclosing_type (args[i]); > - int len = TYPE_LENGTH (value_type); > - int container_len = (len + 1) & ~1; > - int offset; > + ULONGEST len = TYPE_LENGTH (value_type); X > + ULONGEST container_len = (len + 1) & ~1; X > > sp -= container_len; > write_memory (rl78_make_data_address (sp), > diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c > index 5531326..0df6483 100644 > --- a/gdb/rs6000-aix-tdep.c > +++ b/gdb/rs6000-aix-tdep.c > @@ -197,7 +197,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > int ii; > - int len = 0; > + ULONGEST len = 0; X > int argno; /* current argument number */ > int argbytes; /* current argument byte */ > gdb_byte tmp_buffer[50]; > @@ -327,7 +327,7 @@ ran_out_of_registers_for_arguments: > > if ((argno < nargs) || argbytes) > { > - int space = 0, jj; > + ULONGEST space = 0, jj; X > > if (argbytes) > { > diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c > index 038a3ce..7ff02ac 100644 > --- a/gdb/s390-tdep.c > +++ b/gdb/s390-tdep.c > @@ -376,9 +376,9 @@ s390_value_from_register (struct type *type, int regnum, > struct frame_info *frame) > { > struct value *value = default_value_from_register (type, regnum, frame); > - int len = TYPE_LENGTH (check_typedef (type)); > > - if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM && len < 8) > + if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM && > + TYPE_LENGTH (check_typedef (type))< 8) I would not do this simplification, check_typedef is pretty invasive function, it is more usual to keep it in the declarations or even on a separate statement line. > set_value_offset (value, 0); > > return value; > @@ -2490,8 +2490,7 @@ is_power_of_two (unsigned int n) > static int > s390_function_arg_pass_by_reference (struct type *type) > { > - unsigned length = TYPE_LENGTH (type); > - if (length > 8) > + if (TYPE_LENGTH (type) > 8) > return 1; > > return (is_struct_like (type) && !is_power_of_two (TYPE_LENGTH (type))) > @@ -2504,8 +2503,7 @@ s390_function_arg_pass_by_reference (struct type *type) > static int > s390_function_arg_float (struct type *type) > { > - unsigned length = TYPE_LENGTH (type); > - if (length > 8) > + if (TYPE_LENGTH (type) > 8) > return 0; > > return is_float_like (type); > @@ -2617,11 +2615,10 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > { > struct value *arg = args[i]; > struct type *type = check_typedef (value_type (arg)); > - unsigned length = TYPE_LENGTH (type); > > if (s390_function_arg_pass_by_reference (type)) > { > - sp -= length; > + sp -= TYPE_LENGTH (type); > sp = align_down (sp, alignment_of (type)); > copy_addr[i] = sp; > } > @@ -2670,7 +2667,7 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > { > struct value *arg = args[i]; > struct type *type = check_typedef (value_type (arg)); > - unsigned length = TYPE_LENGTH (type); > + ULONGEST length = TYPE_LENGTH (type); > > if (s390_function_arg_pass_by_reference (type)) > { > @@ -2800,8 +2797,7 @@ s390_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) > static enum return_value_convention > s390_return_value_convention (struct gdbarch *gdbarch, struct type *type) > { > - int length = TYPE_LENGTH (type); > - if (length > 8) > + if (TYPE_LENGTH (type) > 8) > return RETURN_VALUE_STRUCT_CONVENTION; > > switch (TYPE_CODE (type)) > @@ -2825,7 +2821,7 @@ s390_return_value (struct gdbarch *gdbarch, struct type *func_type, > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > int word_size = gdbarch_ptr_bit (gdbarch) / 8; > enum return_value_convention rvc; > - int length; > + ULONGEST length; X > > type = check_typedef (type); > rvc = s390_return_value_convention (gdbarch, type); > diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c > index 90ef610..530f876 100644 > --- a/gdb/score-tdep.c > +++ b/gdb/score-tdep.c > @@ -516,7 +516,7 @@ score_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > int argnum; > int argreg; > - int arglen = 0; > + ULONGEST arglen = 0; X > CORE_ADDR stack_offset = 0; > CORE_ADDR addr = 0; > > diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c > index 7f15191..73822b2 100644 > --- a/gdb/sh-tdep.c > +++ b/gdb/sh-tdep.c > @@ -1308,7 +1308,7 @@ sh_extract_return_value_nofpu (struct type *type, struct regcache *regcache, > { > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > int return_register = R0_REGNUM; > int offset; > > @@ -1362,7 +1362,7 @@ sh_store_return_value_nofpu (struct type *type, struct regcache *regcache, > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > ULONGEST val; > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (len <= 4) > { > diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c > index 2e5d8bd..181892c 100644 > --- a/gdb/sh64-tdep.c > +++ b/gdb/sh64-tdep.c > @@ -1059,7 +1059,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, > CORE_ADDR struct_addr) > { > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > - int stack_offset, stack_alloc; > + ULONGEST stack_offset, stack_alloc; X > int int_argreg; > int float_argreg; > int double_argreg; > @@ -1071,7 +1071,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, > char *val; > char valbuf[8]; > char valbuf_tmp[8]; > - int len; > + ULONGEST len; X > int argreg_size; > int fp_args[12]; > > @@ -1230,7 +1230,7 @@ sh64_extract_return_value (struct type *type, struct regcache *regcache, > { > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (TYPE_CODE (type) == TYPE_CODE_FLT) > { > @@ -1292,7 +1292,7 @@ sh64_store_return_value (struct type *type, struct regcache *regcache, > { > struct gdbarch *gdbarch = get_regcache_arch (regcache); > char buf[64]; /* more than enough... */ > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (TYPE_CODE (type) == TYPE_CODE_FLT) > { > diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c > index 00bca01..fb363d5 100644 > --- a/gdb/sparc-tdep.c > +++ b/gdb/sparc-tdep.c > @@ -470,7 +470,7 @@ sparc32_store_arguments (struct regcache *regcache, int nargs, > for (i = 0; i < nargs; i++) > { > struct type *type = value_type (args[i]); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (sparc_structure_or_union_p (type) > || (sparc_floating_p (type) && len == 16) > diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c > index f30022e..a9a2935 100644 > --- a/gdb/sparc64-tdep.c > +++ b/gdb/sparc64-tdep.c > @@ -639,7 +639,8 @@ sparc64_16_byte_align_p (struct type *type) > > static void > sparc64_store_floating_fields (struct regcache *regcache, struct type *type, > - const gdb_byte *valbuf, int element, int bitpos) > + const gdb_byte *valbuf, int element, > + LONGEST bitpos) > { > int len = TYPE_LENGTH (type); > > @@ -681,7 +682,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, > for (i = 0; i < TYPE_NFIELDS (type); i++) > { > struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); > - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); > + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); > > sparc64_store_floating_fields (regcache, subtype, valbuf, > element, subpos); > @@ -713,7 +714,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, > > static void > sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, > - gdb_byte *valbuf, int bitpos) > + gdb_byte *valbuf, LONGEST bitpos) > { > if (sparc64_floating_p (type)) > { > @@ -750,7 +751,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, > for (i = 0; i < TYPE_NFIELDS (type); i++) > { > struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); > - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); > + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); > > sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos); > } > @@ -783,7 +784,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, > for (i = 0; i < nargs; i++) > { > struct type *type = value_type (args[i]); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (sparc64_structure_or_union_p (type) > || (sparc64_complex_floating_p (type) && len == 32)) > diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c > index 78ba007..76db368 100644 > --- a/gdb/spu-tdep.c > +++ b/gdb/spu-tdep.c > @@ -316,7 +316,7 @@ spu_value_from_register (struct type *type, int regnum, > struct frame_info *frame) > { > struct value *value = default_value_from_register (type, regnum, frame); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (regnum < SPU_NUM_GPRS && len < 16) > { > diff --git a/gdb/stack.c b/gdb/stack.c > index bbd6b7f..54e200d 100644 > --- a/gdb/stack.c > +++ b/gdb/stack.c > @@ -354,7 +354,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame, > > if (val && entryval && !ui_out_is_mi_like_p (current_uiout)) > { > - unsigned len = TYPE_LENGTH (value_type (val)); > + ULONGEST len = TYPE_LENGTH (value_type (val)); > > if (!value_optimized_out (val) && value_lazy (val)) > value_fetch_lazy (val); > @@ -373,7 +373,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame, > > TRY_CATCH (except, RETURN_MASK_ERROR) > { > - unsigned len_deref; > + ULONGEST len_deref; > > val_deref = coerce_ref (val); > if (value_lazy (val_deref)) > @@ -532,8 +532,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame, > case LOC_ARG: > case LOC_REF_ARG: > { > - long current_offset = SYMBOL_VALUE (sym); > - int arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); > + LONGEST current_offset = SYMBOL_VALUE (sym); > + ULONGEST arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); X > > /* Compute address of next argument by adding the size of > this argument and rounding to an int boundary. */ > diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c > index 91125e1..a3c15d0 100644 > --- a/gdb/symfile-mem.c > +++ b/gdb/symfile-mem.c > @@ -55,6 +55,11 @@ > #include "auxv.h" > #include "elf/common.h" > > +static int symfile_target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, > + int len) > +{ > + return target_read_memory (memaddr, myaddr, len); > +} Formatting should be (see also tab -> 2 spaces): static int symfile_target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len) { return target_read_memory (memaddr, myaddr, len); } But I proposed to rather target_read_memory use size_t and we should then proposed to bfd/ that it also uses size_t for bfd_elf_bfd_from_remote_memory. > > /* Read inferior memory at ADDR to find the header of a loaded object file > and read its in-core symbols out of inferior memory. TEMPL is a bfd > @@ -77,7 +82,7 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, char *name, > error (_("add-symbol-file-from-memory not supported for this target")); > > nbfd = bfd_elf_bfd_from_remote_memory (templ, addr, &loadbase, > - target_read_memory); > + symfile_target_read_memory); This would not need to be changed afterwards. > if (nbfd == NULL) > error (_("Failed to read a valid object file image from memory.")); > > diff --git a/gdb/symmisc.c b/gdb/symmisc.c > index b0ab29b..d5fdd92 100644 > --- a/gdb/symmisc.c > +++ b/gdb/symmisc.c > @@ -516,11 +516,11 @@ print_symbol (void *args) > > case LOC_CONST_BYTES: > { > - unsigned i; > + ULONGEST i; > struct type *type = check_typedef (SYMBOL_TYPE (symbol)); > > - fprintf_filtered (outfile, "const %u hex bytes:", > - TYPE_LENGTH (type)); > + fprintf_filtered (outfile, "const %s hex bytes:", > + pulongest (TYPE_LENGTH (type))); > for (i = 0; i < TYPE_LENGTH (type); i++) > fprintf_filtered (outfile, " %02x", > (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]); > diff --git a/gdb/target.c b/gdb/target.c > index cffea2c..bc7c238 100644 > --- a/gdb/target.c > +++ b/gdb/target.c > @@ -52,7 +52,7 @@ static void default_terminal_info (char *, int); > static int default_watchpoint_addr_within_range (struct target_ops *, > CORE_ADDR, CORE_ADDR, int); > > -static int default_region_ok_for_hw_watchpoint (CORE_ADDR, int); > +static int default_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); > > static void tcomplain (void) ATTRIBUTE_NORETURN; > > @@ -128,7 +128,7 @@ static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); > static int debug_to_watchpoint_addr_within_range (struct target_ops *, > CORE_ADDR, CORE_ADDR, int); > > -static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, int); > +static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); > > static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, int, int, > struct expression *); > @@ -1757,7 +1757,7 @@ target_xfer_partial (struct target_ops *ops, > it makes no progress, and then return how much was transferred). */ > > int > -target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len) > +target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len) > { > /* Dispatch to the topmost target, not the flattened current_target. > Memory accesses check target->to_has_(all_)memory, and the > @@ -1773,7 +1773,7 @@ target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len) > the target's stack. This may trigger different cache behavior. */ > > int > -target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len) > +target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len) It may be OK for this patch but a nice 2nd patch cleanup would be to use size_t. > { > /* Dispatch to the topmost target, not the flattened current_target. > Memory accesses check target->to_has_(all_)memory, and the > @@ -1792,7 +1792,7 @@ target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len) > Callers that can deal with partial writes should call target_write. */ > > int > -target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len) > +target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, LONGEST len) Likewise. > { > /* Dispatch to the topmost target, not the flattened current_target. > Memory accesses check target->to_has_(all_)memory, and the > @@ -1811,7 +1811,8 @@ target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len) > should call target_write. */ > > int > -target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len) > +target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, > + LONGEST len) Likewise. > { > /* Dispatch to the topmost target, not the flattened current_target. > Memory accesses check target->to_has_(all_)memory, and the > @@ -3543,7 +3544,7 @@ target_fileio_read_stralloc (const char *filename) > > > static int > -default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) > +default_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) > { > return (len <= gdbarch_ptr_bit (target_gdbarch) / TARGET_CHAR_BIT); > } > @@ -4217,7 +4218,7 @@ debug_to_can_use_hw_breakpoint (int type, int cnt, int from_tty) > } > > static int > -debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) > +debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) > { > CORE_ADDR retval; > > diff --git a/gdb/target.h b/gdb/target.h > index 50a0ea6..a76f785 100644 > --- a/gdb/target.h > +++ b/gdb/target.h > @@ -478,7 +478,7 @@ struct target_ops > > /* Documentation of this routine is provided with the corresponding > target_* macro. */ > - int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, int); > + int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, LONGEST); > > int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int, > struct expression *); > @@ -996,15 +996,17 @@ extern void target_dcache_invalidate (void); > > extern int target_read_string (CORE_ADDR, char **, int, int *); > > -extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len); > +extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, > + LONGEST len); > > -extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len); > +extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, > + LONGEST len); > > extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, > - int len); > + LONGEST len); > > extern int target_write_raw_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, > - int len); > + LONGEST len); > > /* Fetches the target's memory map. If one is found it is sorted > and returned, after some consistency checking. Otherwise, NULL > diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c > index 6e47a0a..42af6bc 100644 > --- a/gdb/tracepoint.c > +++ b/gdb/tracepoint.c > @@ -967,7 +967,7 @@ collect_symbol (struct collection_list *collect, > long frame_regno, long frame_offset, > CORE_ADDR scope) > { > - unsigned long len; > + ULONGEST len; > unsigned int reg; > bfd_signed_vma offset; > int treat_as_expr = 0; > @@ -1448,7 +1448,8 @@ encode_actions_1 (struct command_line *action, > } > else > { > - unsigned long addr, len; > + CORE_ADDR addr; > + ULONGEST len; > struct cleanup *old_chain = NULL; > struct cleanup *old_chain1 = NULL; > > @@ -2613,7 +2614,8 @@ scope_info (char *args, int from_tty) > const char *symname; > char *save_args = args; > struct dict_iterator iter; > - int j, count = 0; > + int count = 0; > + ULONGEST j; X > struct gdbarch *gdbarch; > int regno; > > @@ -2743,8 +2745,10 @@ scope_info (char *args, int from_tty) > break; > } > if (SYMBOL_TYPE (sym)) > - printf_filtered (", length %d.\n", > - TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)))); > + { > + ULONGEST len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))); Missing empty line after declarations. > + printf_filtered (", length %s.\n", pulongest (len)); > + } > } > if (BLOCK_FUNCTION (block)) > break; > diff --git a/gdb/typeprint.c b/gdb/typeprint.c > index c25e705..4bbf8a7 100644 > --- a/gdb/typeprint.c > +++ b/gdb/typeprint.c > @@ -118,7 +118,7 @@ whatis_exp (char *exp, int show) > struct type *real_type = NULL; > struct type *type; > int full = 0; > - int top = -1; > + LONGEST top = -1; > int using_enc = 0; > struct value_print_options opts; > > diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c > index 240a154..8cbf3b3 100644 > --- a/gdb/v850-tdep.c > +++ b/gdb/v850-tdep.c > @@ -810,7 +810,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch, > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > int argreg; > int argnum; > - int len = 0; > + ULONGEST len = 0; X > int stack_offset; > > /* The offset onto the stack at which we will start copying parameters > @@ -891,7 +891,7 @@ v850_extract_return_value (struct type *type, struct regcache *regcache, > { > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > > if (len <= v850_reg_size) > { > @@ -918,7 +918,7 @@ v850_store_return_value (struct type *type, struct regcache *regcache, > { > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > > if (len <= v850_reg_size) > regcache_cooked_write_unsigned > diff --git a/gdb/valarith.c b/gdb/valarith.c > index a17c91a..16e760d 100644 > --- a/gdb/valarith.c > +++ b/gdb/valarith.c > @@ -196,8 +196,8 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) > { > struct type *array_type = check_typedef (value_type (array)); > struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); > - unsigned int elt_size = TYPE_LENGTH (elt_type); > - unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound); > + ULONGEST elt_size = TYPE_LENGTH (elt_type); > + ULONGEST elt_offs = elt_size * (index - lowerbound); > struct value *v; > > if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) > @@ -1474,7 +1474,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) > int > value_logical_not (struct value *arg1) > { > - int len; > + LONGEST len; > const gdb_byte *p; > struct type *type1; > > @@ -1505,8 +1505,8 @@ value_logical_not (struct value *arg1) > static int > value_strcmp (struct value *arg1, struct value *arg2) > { > - int len1 = TYPE_LENGTH (value_type (arg1)); > - int len2 = TYPE_LENGTH (value_type (arg2)); > + LONGEST len1 = TYPE_LENGTH (value_type (arg1)); > + LONGEST len2 = TYPE_LENGTH (value_type (arg2)); > const gdb_byte *s1 = value_contents (arg1); > const gdb_byte *s2 = value_contents (arg2); > int i, len = len1 < len2 ? len1 : len2; > diff --git a/gdb/valops.c b/gdb/valops.c > index ee450e3..5018864 100644 > --- a/gdb/valops.c > +++ b/gdb/valops.c > @@ -53,11 +53,11 @@ static int typecmp (int staticp, int varargs, int nargs, > struct field t1[], struct value *t2[]); > > static struct value *search_struct_field (const char *, struct value *, > - int, struct type *, int); > + LONGEST, struct type *, int); > > static struct value *search_struct_method (const char *, struct value **, > struct value **, > - int, int *, struct type *); > + LONGEST, int *, struct type *); > > static int find_oload_champ_namespace (struct value **, int, > const char *, const char *, > @@ -85,7 +85,7 @@ oload_classification classify_oload_match (struct badness_vector *, > int, int); > > static struct value *value_struct_elt_for_reference (struct type *, > - int, struct type *, > + LONGEST, struct type *, > char *, > struct type *, > int, enum noside); > @@ -102,8 +102,8 @@ static CORE_ADDR allocate_space_in_inferior (int); > static struct value *cast_into_complex (struct type *, struct value *); > > static struct fn_field *find_method_list (struct value **, const char *, > - int, struct type *, int *, > - struct type **, int *); > + LONGEST, struct type *, int *, > + struct type **, LONGEST *); > > void _initialize_valops (void); > > @@ -188,14 +188,14 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) > space. */ > > struct value * > -value_allocate_space_in_inferior (int len) > +value_allocate_space_in_inferior (ULONGEST len) X > { > struct objfile *objf; > struct value *val = find_function_in_inferior ("malloc", &objf); > struct gdbarch *gdbarch = get_objfile_arch (objf); > struct value *blocklen; > > - blocklen = value_from_longest (builtin_type (gdbarch)->builtin_int, len); > + blocklen = value_from_ulongest (builtin_type (gdbarch)->builtin_int, len); This would not be changed then. > val = call_function_by_hand (val, 1, &blocklen); > if (value_logical_not (val)) > { > @@ -261,7 +261,8 @@ value_cast_structs (struct type *type, struct value *v2) > if (TYPE_NAME (t2) != NULL) > { > /* Try downcasting using the run-time type of the value. */ > - int full, top, using_enc; > + int full, using_enc; > + LONGEST top; > struct type *real_type; > > real_type = value_rtti_type (v2, &full, &top, &using_enc); > @@ -396,12 +397,12 @@ value_cast (struct type *type, struct value *arg2) > if (code1 == TYPE_CODE_ARRAY) > { > struct type *element_type = TYPE_TARGET_TYPE (type); > - unsigned element_length = TYPE_LENGTH (check_typedef (element_type)); > + ULONGEST element_length = TYPE_LENGTH (check_typedef (element_type)); > > if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) > { > struct type *range_type = TYPE_INDEX_TYPE (type); > - int val_length = TYPE_LENGTH (type2); > + ULONGEST val_length = TYPE_LENGTH (type2); X > LONGEST low_bound, high_bound, new_length; > > if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) > @@ -651,7 +652,7 @@ value_reinterpret_cast (struct type *type, struct value *arg) > static int > dynamic_cast_check_1 (struct type *desired_type, > const gdb_byte *valaddr, > - int embedded_offset, > + LONGEST embedded_offset, > CORE_ADDR address, > struct value *val, > struct type *search_type, > @@ -663,8 +664,8 @@ dynamic_cast_check_1 (struct type *desired_type, > > for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) > { > - int offset = baseclass_offset (search_type, i, valaddr, embedded_offset, > - address, val); > + LONGEST offset = baseclass_offset (search_type, i, valaddr, > + embedded_offset, address, val); > > if (class_types_same_p (desired_type, TYPE_BASECLASS (search_type, i))) > { > @@ -698,7 +699,7 @@ dynamic_cast_check_1 (struct type *desired_type, > static int > dynamic_cast_check_2 (struct type *desired_type, > const gdb_byte *valaddr, > - int embedded_offset, > + LONGEST embedded_offset, > CORE_ADDR address, > struct value *val, > struct type *search_type, > @@ -708,7 +709,7 @@ dynamic_cast_check_2 (struct type *desired_type, > > for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) > { > - int offset; > + LONGEST offset; > > if (! BASETYPE_VIA_PUBLIC (search_type, i)) > continue; > @@ -739,7 +740,8 @@ dynamic_cast_check_2 (struct type *desired_type, > struct value * > value_dynamic_cast (struct type *type, struct value *arg) > { > - int full, top, using_enc; > + int full, using_enc; > + LONGEST top; > struct type *resolved_type = check_typedef (type); > struct type *arg_type = check_typedef (value_type (arg)); > struct type *class_type, *rtti_type; > @@ -990,7 +992,7 @@ value_fetch_lazy (struct value *val) > struct value *parent = value_parent (val); > LONGEST offset = value_offset (val); > LONGEST num; > - int length = TYPE_LENGTH (type); > + ULONGEST length = TYPE_LENGTH (type); X > > if (!value_bits_valid (val, > TARGET_CHAR_BIT * offset + value_bitpos (val), > @@ -1012,7 +1014,8 @@ value_fetch_lazy (struct value *val) > else if (VALUE_LVAL (val) == lval_memory) > { > CORE_ADDR addr = value_address (val); > - int length = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); > + struct type *enclosing_type = value_enclosing_type (val); > + ULONGEST length = TYPE_LENGTH (check_typedef (enclosing_type)); X > > if (length) > read_value_memory (val, 0, value_stack (val), > @@ -1123,7 +1126,7 @@ value_fetch_lazy (struct value *val) > void > read_value_memory (struct value *val, int embedded_offset, > int stack, CORE_ADDR memaddr, > - gdb_byte *buffer, size_t length) > + gdb_byte *buffer, ULONGEST length) This should not be changed, or it should be reverted in a 2nd cleanup patch. size_t is perfect for in-memory buffer. > { > if (length) > { > @@ -1256,7 +1259,7 @@ value_assign (struct value *toval, struct value *fromval) > { > const gdb_byte *dest_buffer; > CORE_ADDR changed_addr; > - int changed_len; > + ULONGEST changed_len; X > gdb_byte buffer[sizeof (LONGEST)]; > > if (value_bitsize (toval)) > @@ -1329,7 +1332,7 @@ value_assign (struct value *toval, struct value *fromval) > if (value_bitsize (toval)) > { > struct value *parent = value_parent (toval); > - int offset = value_offset (parent) + value_offset (toval); > + LONGEST offset = value_offset (parent) + value_offset (toval); > int changed_len; > gdb_byte buffer[sizeof (LONGEST)]; > int optim, unavail; > @@ -1794,7 +1797,7 @@ value_array (int lowbound, int highbound, struct value **elemvec) > { > int nelem; > int idx; > - unsigned int typelength; > + ULONGEST typelength; > struct value *val; > struct type *arraytype; > > @@ -1985,7 +1988,7 @@ typecmp (int staticp, int varargs, int nargs, > fields, look for a baseclass named NAME. */ > > static struct value * > -search_struct_field (const char *name, struct value *arg1, int offset, > +search_struct_field (const char *name, struct value *arg1, LONGEST offset, > struct type *type, int looking_for_baseclass) > { > int i; > @@ -2043,7 +2046,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, > <variant field>. */ > > struct value *v; > - int new_offset = offset; > + LONGEST new_offset = offset; > > /* This is pretty gross. In G++, the offset in an > anonymous union is relative to the beginning of the > @@ -2080,7 +2083,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, > > if (BASETYPE_VIA_VIRTUAL (type, i)) > { > - int boffset; > + LONGEST boffset; > struct value *v2; > > boffset = baseclass_offset (type, i, > @@ -2144,7 +2147,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, > > static struct value * > search_struct_method (const char *name, struct value **arg1p, > - struct value **args, int offset, > + struct value **args, LONGEST offset, > int *static_memfuncp, struct type *type) > { > int i; > @@ -2208,9 +2211,9 @@ search_struct_method (const char *name, struct value **arg1p, > > for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) > { > - int base_offset; > + LONGEST base_offset; > int skip = 0; > - int this_offset; > + LONGEST this_offset; > > if (BASETYPE_VIA_VIRTUAL (type, i)) > { > @@ -2386,8 +2389,8 @@ value_struct_elt (struct value **argp, struct value **args, > > static struct fn_field * > find_method_list (struct value **argp, const char *method, > - int offset, struct type *type, int *num_fns, > - struct type **basetype, int *boffset) > + LONGEST offset, struct type *type, int *num_fns, > + struct type **basetype, LONGEST *boffset) > { > int i; > struct fn_field *f; > @@ -2420,7 +2423,7 @@ find_method_list (struct value **argp, const char *method, > /* Not found in object, check in base subobjects. */ > for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) > { > - int base_offset; > + LONGEST base_offset; > > if (BASETYPE_VIA_VIRTUAL (type, i)) > { > @@ -2456,7 +2459,7 @@ find_method_list (struct value **argp, const char *method, > struct fn_field * > value_find_oload_method_list (struct value **argp, const char *method, > int offset, int *num_fns, > - struct type **basetype, int *boffset) > + struct type **basetype, LONGEST *boffset) > { > struct type *t; > > @@ -2548,7 +2551,7 @@ find_overload_match (struct value **args, int nargs, > /* Number of overloaded instances being considered. */ > int num_fns = 0; > struct type *basetype = NULL; > - int boffset; > + LONGEST boffset; > > struct cleanup *all_cleanups = make_cleanup (null_cleanup, NULL); > > @@ -3255,7 +3258,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) > the form "DOMAIN::NAME". */ > > static struct value * > -value_struct_elt_for_reference (struct type *domain, int offset, > +value_struct_elt_for_reference (struct type *domain, LONGEST offset, > struct type *curtype, char *name, > struct type *intype, > int want_address, > @@ -3292,7 +3295,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, > if (want_address) > return value_from_longest > (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), > - offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3)); > + offset + (TYPE_FIELD_BITPOS (t, i) >> 3)); > else if (noside == EVAL_AVOID_SIDE_EFFECTS) > return allocate_value (TYPE_FIELD_TYPE (t, i)); > else > @@ -3435,7 +3438,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, > for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) > { > struct value *v; > - int base_offset; > + LONGEST base_offset; > > if (BASETYPE_VIA_VIRTUAL (t, i)) > base_offset = 0; > @@ -3525,7 +3528,7 @@ value_maybe_namespace_elt (const struct type *curtype, > > struct type * > value_rtti_indirect_type (struct value *v, int *full, > - int *top, int *using_enc) > + LONGEST *top, int *using_enc) > { > struct value *target; > struct type *type, *real_type, *target_type; > @@ -3575,12 +3578,12 @@ value_rtti_indirect_type (struct value *v, int *full, > struct value * > value_full_object (struct value *argp, > struct type *rtype, > - int xfull, int xtop, > + int xfull, LONGEST xtop, > int xusing_enc) > { > struct type *real_type; > int full = 0; > - int top = -1; > + LONGEST top = -1; > int using_enc = 0; > struct value *new_val; > > diff --git a/gdb/valprint.c b/gdb/valprint.c > index 25b62bc..f5e168a 100644 > --- a/gdb/valprint.c > +++ b/gdb/valprint.c > @@ -253,7 +253,7 @@ scalar_type_p (struct type *type) > int > valprint_check_validity (struct ui_file *stream, > struct type *type, > - int embedded_offset, > + LONGEST embedded_offset, > const struct value *val) > { > CHECK_TYPEDEF (type); > @@ -317,7 +317,7 @@ val_print_invalid_address (struct ui_file *stream) > > void > generic_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options, > @@ -680,7 +680,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr, > RECURSE. */ > > void > -val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, > +val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > @@ -892,7 +892,7 @@ val_print_type_code_flags (struct type *type, const gdb_byte *valaddr, > > void > val_print_scalar_formatted (struct type *type, > - const gdb_byte *valaddr, int embedded_offset, > + const gdb_byte *valaddr, LONGEST embedded_offset, > const struct value *val, > const struct value_print_options *options, > int size, > @@ -1433,7 +1433,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr, > > void > print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr, > - unsigned len, enum bfd_endian byte_order) > + ULONGEST len, enum bfd_endian byte_order) > { > const gdb_byte *p; > > @@ -1550,7 +1550,7 @@ maybe_print_array_index (struct type *index_type, LONGEST index, > > void > val_print_array_elements (struct type *type, > - const gdb_byte *valaddr, int embedded_offset, > + const gdb_byte *valaddr, LONGEST embedded_offset, > CORE_ADDR address, struct ui_file *stream, > int recurse, > const struct value *val, > @@ -1558,9 +1558,9 @@ val_print_array_elements (struct type *type, > unsigned int i) > { > unsigned int things_printed = 0; > - unsigned len; > + ULONGEST len; > struct type *elttype, *index_type; > - unsigned eltlen; > + ULONGEST eltlen; > /* Position of the array element we are examining to see > whether it is repeated. */ > unsigned int rep1; > @@ -2046,8 +2046,8 @@ generic_emit_char (int c, struct type *type, struct ui_file *stream, > omitted. */ > > void > -generic_printstr (struct ui_file *stream, struct type *type, > - const gdb_byte *string, unsigned int length, > +generic_printstr (struct ui_file *stream, struct type *type, > + const gdb_byte *string, ULONGEST length, > const char *encoding, int force_ellipses, > int quote_char, int c_style_terminator, > const struct value_print_options *options) > diff --git a/gdb/valprint.h b/gdb/valprint.h > index 56c0c92..2841929 100644 > --- a/gdb/valprint.h > +++ b/gdb/valprint.h > @@ -113,7 +113,7 @@ extern void maybe_print_array_index (struct type *index_type, LONGEST index, > struct ui_file *stream, > const struct value_print_options *); > > -extern void val_print_array_elements (struct type *, const gdb_byte *, int, > +extern void val_print_array_elements (struct type *, const gdb_byte *, LONGEST, > CORE_ADDR, struct ui_file *, int, > const struct value *, > const struct value_print_options *, > @@ -127,7 +127,7 @@ extern void val_print_type_code_flags (struct type *type, > struct ui_file *stream); > > extern void val_print_scalar_formatted (struct type *, > - const gdb_byte *, int, > + const gdb_byte *, LONGEST, > const struct value *, > const struct value_print_options *, > int, > @@ -143,7 +143,7 @@ extern void print_decimal_chars (struct ui_file *, const gdb_byte *, > unsigned int, enum bfd_endian); > > extern void print_hex_chars (struct ui_file *, const gdb_byte *, > - unsigned int, enum bfd_endian); > + ULONGEST, enum bfd_endian); > > extern void print_char_chars (struct ui_file *, struct type *, > const gdb_byte *, unsigned int, enum bfd_endian); > @@ -187,7 +187,7 @@ struct generic_val_print_decorations > > > extern void generic_val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *original_value, > const struct value_print_options *options, > @@ -196,8 +196,8 @@ extern void generic_val_print (struct type *type, const gdb_byte *valaddr, > extern void generic_emit_char (int c, struct type *type, struct ui_file *stream, > int quoter, const char *encoding); > > -extern void generic_printstr (struct ui_file *stream, struct type *type, > - const gdb_byte *string, unsigned int length, > +extern void generic_printstr (struct ui_file *stream, struct type *type, > + const gdb_byte *string, ULONGEST length, > const char *encoding, int force_ellipses, > int quote_char, int c_style_terminator, > const struct value_print_options *options); > diff --git a/gdb/value.c b/gdb/value.c > index d498289..30a4a42 100644 > --- a/gdb/value.c > +++ b/gdb/value.c > @@ -67,10 +67,10 @@ struct internal_function > struct range > { > /* Lowest offset in the range. */ > - int offset; > + LONGEST offset; > > /* Length of the range. */ > - int length; > + ULONGEST length; X > }; > > typedef struct range range_s; > @@ -81,8 +81,8 @@ DEF_VEC_O(range_s); > [offset2, offset2+len2) overlap. */ > > static int > -ranges_overlap (int offset1, int len1, > - int offset2, int len2) > +ranges_overlap (LONGEST offset1, ULONGEST len1, X > + LONGEST offset2, ULONGEST len2) X > { > ULONGEST h, l; > > @@ -106,7 +106,7 @@ range_lessthan (const range_s *r1, const range_s *r2) > OFFSET+LENGTH). */ > > static int > -ranges_contain (VEC(range_s) *ranges, int offset, int length) > +ranges_contain (VEC(range_s) *ranges, LONGEST offset, ULONGEST length) X > { > range_s what; > int i; > @@ -239,7 +239,7 @@ struct value > lval == lval_register, this is a further offset from > location.address within the registers structure. Note also the > member embedded_offset below. */ > - int offset; > + LONGEST offset; > > /* Only used for bitfields; number of bits contained in them. */ > int bitsize; > @@ -309,8 +309,8 @@ struct value > `type', and `embedded_offset' is zero, so everything works > normally. */ > struct type *enclosing_type; > - int embedded_offset; > - int pointed_to_offset; > + LONGEST embedded_offset; > + LONGEST pointed_to_offset; > > /* Values are stored in a chain, so that they can be deleted easily > over calls to the inferior. Values assigned to internal > @@ -332,7 +332,8 @@ struct value > }; > > int > -value_bytes_available (const struct value *value, int offset, int length) > +value_bytes_available (const struct value *value, LONGEST offset, > + ULONGEST length) X > { > gdb_assert (!value->lazy); > > @@ -353,7 +354,8 @@ value_entirely_available (struct value *value) > } > > void > -mark_value_bytes_unavailable (struct value *value, int offset, int length) > +mark_value_bytes_unavailable (struct value *value, LONGEST offset, > + ULONGEST length) X > { > range_s newr; > int i; > @@ -524,7 +526,7 @@ mark_value_bytes_unavailable (struct value *value, int offset, int length) > > static int > find_first_range_overlap (VEC(range_s) *ranges, int pos, > - int offset, int length) > + LONGEST offset, ULONGEST length) X > { > range_s *r; > int i; > @@ -537,9 +539,9 @@ find_first_range_overlap (VEC(range_s) *ranges, int pos, > } > > int > -value_available_contents_eq (const struct value *val1, int offset1, > - const struct value *val2, int offset2, > - int length) > +value_available_contents_eq (const struct value *val1, LONGEST offset1, > + const struct value *val2, LONGEST offset2, > + ULONGEST length) X > { > int idx1 = 0, idx2 = 0; > > @@ -767,13 +769,13 @@ deprecated_set_value_type (struct value *value, struct type *type) > value->type = type; > } > > -int > +LONGEST > value_offset (const struct value *value) > { > return value->offset; > } > void > -set_value_offset (struct value *value, int offset) > +set_value_offset (struct value *value, LONGEST offset) > { > value->offset = offset; > } > @@ -924,8 +926,9 @@ value_contents_all (struct value *value) > DST_OFFSET+LENGTH) range are wholly available. */ > > void > -value_contents_copy_raw (struct value *dst, int dst_offset, > - struct value *src, int src_offset, int length) > +value_contents_copy_raw (struct value *dst, LONGEST dst_offset, > + struct value *src, LONGEST src_offset, > + ULONGEST length) X > { > range_s *r; > int i; > @@ -973,8 +976,8 @@ value_contents_copy_raw (struct value *dst, int dst_offset, > DST_OFFSET+LENGTH) range are wholly available. */ > > void > -value_contents_copy (struct value *dst, int dst_offset, > - struct value *src, int src_offset, int length) > +value_contents_copy (struct value *dst, LONGEST dst_offset, > + struct value *src, LONGEST src_offset, ULONGEST length) X > { > require_not_optimized_out (src); > > @@ -1034,7 +1037,7 @@ value_contents_equal (struct value *val1, struct value *val2) > { > struct type *type1; > struct type *type2; > - int len; > + ULONGEST len; X > > type1 = check_typedef (value_type (val1)); > type2 = check_typedef (value_type (val2)); > @@ -1069,7 +1072,7 @@ value_entirely_optimized_out (const struct value *value) > } > > int > -value_bits_valid (const struct value *value, int offset, int length) > +value_bits_valid (const struct value *value, LONGEST offset, ULONGEST length) X > { > if (!value->optimized_out) > return 1; > @@ -1082,7 +1085,7 @@ value_bits_valid (const struct value *value, int offset, int length) > > int > value_bits_synthetic_pointer (const struct value *value, > - int offset, int length) > + LONGEST offset, ULONGEST length) X > { > if (value->lval != lval_computed > || !value->location.computed.funcs->check_synthetic_pointer) > @@ -1092,26 +1095,26 @@ value_bits_synthetic_pointer (const struct value *value, > length); > } > > -int > +LONGEST > value_embedded_offset (struct value *value) > { > return value->embedded_offset; > } > > void > -set_value_embedded_offset (struct value *value, int val) > +set_value_embedded_offset (struct value *value, LONGEST val) > { > value->embedded_offset = val; > } > > -int > +LONGEST > value_pointed_to_offset (struct value *value) > { > return value->pointed_to_offset; > } > > void > -set_value_pointed_to_offset (struct value *value, int val) > +set_value_pointed_to_offset (struct value *value, LONGEST val) > { > value->pointed_to_offset = val; > } > @@ -1914,7 +1917,7 @@ get_internalvar_function (struct internalvar *var, > } > > void > -set_internalvar_component (struct internalvar *var, int offset, int bitpos, > +set_internalvar_component (struct internalvar *var, LONGEST offset, int bitpos, > int bitsize, struct value *newval) > { > gdb_byte *addr; > @@ -2583,7 +2586,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type) > FIELDNO says which field. */ > > struct value * > -value_primitive_field (struct value *arg1, int offset, > +value_primitive_field (struct value *arg1, LONGEST offset, > int fieldno, struct type *arg_type) > { > struct value *v; > @@ -2613,8 +2616,8 @@ value_primitive_field (struct value *arg1, int offset, > bit. Assume that the address, offset, and embedded offset > are sufficiently aligned. */ > > - int bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); > - int container_bitsize = TYPE_LENGTH (type) * 8; > + LONGEST bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); > + ULONGEST container_bitsize = TYPE_LENGTH (type) * 8; X > > v = allocate_value_lazy (type); > v->bitsize = TYPE_FIELD_BITSIZE (arg_type, fieldno); > @@ -2636,7 +2639,7 @@ value_primitive_field (struct value *arg1, int offset, > /* This field is actually a base subobject, so preserve the > entire object's contents for later references to virtual > bases, etc. */ > - int boffset; > + LONGEST boffset; > > /* Lazy register values with offsets are not supported. */ > if (VALUE_LVAL (arg1) == lval_register && value_lazy (arg1)) > @@ -2713,7 +2716,7 @@ value_field (struct value *arg1, int fieldno) > struct value * > value_fn_field (struct value **arg1p, struct fn_field *f, > int j, struct type *type, > - int offset) > + LONGEST offset) > { > struct value *v; > struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); > @@ -2773,8 +2776,8 @@ value_fn_field (struct value **arg1p, struct fn_field *f, > > static int > unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, > - int embedded_offset, int bitpos, int bitsize, > - const struct value *original_value, > + LONGEST embedded_offset, LONGEST bitpos, > + int bitsize, const struct value *original_value, > LONGEST *result) > { > enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (field_type)); > @@ -2782,7 +2785,7 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, > ULONGEST valmask; > int lsbcount; > int bytes_read; > - int read_offset; > + LONGEST read_offset; > > /* Read the minimum number of bytes required; there may not be > enough bytes to read an entire ULONGEST. */ > @@ -2852,7 +2855,7 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, > > int > unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, > - int embedded_offset, int bitpos, int bitsize, > + LONGEST embedded_offset, int bitpos, int bitsize, > const struct value *original_value, > LONGEST *result) > { > @@ -2870,10 +2873,10 @@ unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, > > static int > unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, int fieldno, > + LONGEST embedded_offset, int fieldno, > const struct value *val, LONGEST *result) > { > - int bitpos = TYPE_FIELD_BITPOS (type, fieldno); > + LONGEST bitpos = TYPE_FIELD_BITPOS (type, fieldno); > int bitsize = TYPE_FIELD_BITSIZE (type, fieldno); > struct type *field_type = TYPE_FIELD_TYPE (type, fieldno); > > @@ -2889,7 +2892,7 @@ unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, > > int > unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, int fieldno, > + LONGEST embedded_offset, int fieldno, > const struct value *val, LONGEST *result) > { > gdb_assert (val != NULL); > @@ -2921,7 +2924,7 @@ unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno) > struct value * > value_field_bitfield (struct type *type, int fieldno, > const gdb_byte *valaddr, > - int embedded_offset, const struct value *val) > + LONGEST embedded_offset, const struct value *val) > { > LONGEST l; > > @@ -2948,12 +2951,12 @@ value_field_bitfield (struct type *type, int fieldno, > > void > modify_field (struct type *type, gdb_byte *addr, > - LONGEST fieldval, int bitpos, int bitsize) > + LONGEST fieldval, LONGEST bitpos, unsigned int bitsize) WHy to make bitsize unsigned here? > { > enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); > ULONGEST oword; > ULONGEST mask = (ULONGEST) -1 >> (8 * sizeof (ULONGEST) - bitsize); > - int bytesize; > + ULONGEST bytesize; X > > /* Normalize BITPOS. */ > addr += bitpos / 8; > diff --git a/gdb/value.h b/gdb/value.h > index 76c8e85..f953217 100644 > --- a/gdb/value.h > +++ b/gdb/value.h > @@ -82,8 +82,8 @@ extern void set_value_parent (struct value *value, struct value *parent); > within the registers structure. Note also the member > embedded_offset below. */ > > -extern int value_offset (const struct value *); > -extern void set_value_offset (struct value *, int offset); > +extern LONGEST value_offset (const struct value *); > +extern void set_value_offset (struct value *, LONGEST offset); > > /* The comment from "struct value" reads: ``Is it modifiable? Only > relevant if lval != not_lval.''. Shouldn't the value instead be > @@ -154,10 +154,10 @@ extern struct type *value_actual_type (struct value *value, > int resolve_simple_types, > int *real_type_found); > > -extern int value_pointed_to_offset (struct value *value); > -extern void set_value_pointed_to_offset (struct value *value, int val); > -extern int value_embedded_offset (struct value *value); > -extern void set_value_embedded_offset (struct value *value, int val); > +extern LONGEST value_pointed_to_offset (struct value *value); > +extern void set_value_pointed_to_offset (struct value *value, LONGEST val); > +extern LONGEST value_embedded_offset (struct value *value); > +extern void set_value_embedded_offset (struct value *value, LONGEST val); > > /* For lval_computed values, this structure holds functions used to > retrieve and set the value (or portions of the value). > @@ -185,7 +185,8 @@ struct lval_funcs > /* Check the validity of some bits in VALUE. This should return 1 > if all the bits starting at OFFSET and extending for LENGTH bits > are valid, or 0 if any bit is invalid. */ > - int (*check_validity) (const struct value *value, int offset, int length); > + int (*check_validity) (const struct value *value, LONGEST offset, > + ULONGEST length); X > > /* Return 1 if any bit in VALUE is valid, 0 if they are all invalid. */ > int (*check_any_valid) (const struct value *value); > @@ -203,7 +204,7 @@ struct lval_funcs > /* If non-NULL, this is used to determine whether the indicated bits > of VALUE are a synthetic pointer. */ > int (*check_synthetic_pointer) (const struct value *value, > - int offset, int length); > + LONGEST offset, ULONGEST length); X > > /* Return a duplicate of VALUE's closure, for use in a new value. > This may simply return the same closure, if VALUE's is > @@ -240,7 +241,7 @@ extern struct value *allocate_computed_value (struct type *type, > Otherwise, return 1. */ > > extern int valprint_check_validity (struct ui_file *stream, struct type *type, > - int embedded_offset, > + LONGEST embedded_offset, > const struct value *val); > > extern struct value *allocate_optimized_out_value (struct type *type); > @@ -411,13 +412,13 @@ extern struct value *coerce_array (struct value *value); > bits in the given range are valid, zero if any bit is invalid. */ > > extern int value_bits_valid (const struct value *value, > - int offset, int length); > + LONGEST offset, ULONGEST length); X > > /* Given a value, determine whether the bits starting at OFFSET and > extending for LENGTH bits are a synthetic pointer. */ > > extern int value_bits_synthetic_pointer (const struct value *value, > - int offset, int length); > + LONGEST offset, ULONGEST length); X > > /* Given a value, determine whether the contents bytes starting at > OFFSET and extending for LENGTH bytes are available. This returns > @@ -425,7 +426,7 @@ extern int value_bits_synthetic_pointer (const struct value *value, > byte is unavailable. */ > > extern int value_bytes_available (const struct value *value, > - int offset, int length); > + LONGEST offset, ULONGEST length); X > > /* Like value_bytes_available, but return false if any byte in the > whole object is unavailable. */ > @@ -435,7 +436,7 @@ extern int value_entirely_available (struct value *value); > LENGTH bytes as unavailable. */ > > extern void mark_value_bytes_unavailable (struct value *value, > - int offset, int length); > + LONGEST offset, ULONGEST length); X > > /* Compare LENGTH bytes of VAL1's contents starting at OFFSET1 with > LENGTH bytes of VAL2's contents starting at OFFSET2. > @@ -445,7 +446,7 @@ extern void mark_value_bytes_unavailable (struct value *value, > example, to compare a complete object value with itself, including > its enclosing type chunk, you'd do: > > - int len = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); > + ULONGEST len = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); X > value_available_contents (val, 0, val, 0, len); > > Returns true iff the set of available contents match. Unavailable > @@ -467,9 +468,10 @@ extern void mark_value_bytes_unavailable (struct value *value, > value_available_contents_eq(val, 3, val, 4, 4) => 0 > */ > > -extern int value_available_contents_eq (const struct value *val1, int offset1, > - const struct value *val2, int offset2, > - int length); > +extern int value_available_contents_eq (const struct value *val1, > + LONGEST offset1, > + const struct value *val2, > + LONGEST offset2, ULONGEST length); X > > /* Read LENGTH bytes of memory starting at MEMADDR into BUFFER, which > is (or will be copied to) VAL's contents buffer offset by > @@ -480,7 +482,7 @@ extern int value_available_contents_eq (const struct value *val1, int offset1, > > extern void read_value_memory (struct value *val, int embedded_offset, > int stack, CORE_ADDR memaddr, > - gdb_byte *buffer, size_t length); > + gdb_byte *buffer, ULONGEST length); I think I commented it somewhere, size_t is right, so if you want it here for split the 2nd cleanup patch should revert it. > > \f > > @@ -505,7 +507,7 @@ extern CORE_ADDR unpack_pointer (struct type *type, const gdb_byte *valaddr); > > extern int unpack_value_bits_as_long (struct type *field_type, > const gdb_byte *valaddr, > - int embedded_offset, int bitpos, > + LONGEST embedded_offset, int bitpos, > int bitsize, > const struct value *original_value, > LONGEST *result); > @@ -514,12 +516,12 @@ extern LONGEST unpack_field_as_long (struct type *type, > const gdb_byte *valaddr, > int fieldno); > extern int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, int fieldno, > + LONGEST embedded_offset, int fieldno, > const struct value *val, LONGEST *result); > > extern struct value *value_field_bitfield (struct type *type, int fieldno, > const gdb_byte *valaddr, > - int embedded_offset, > + LONGEST embedded_offset, > const struct value *val); > > extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); > @@ -573,12 +575,12 @@ extern struct value *default_read_var_value (struct symbol *var, > extern struct value *allocate_value (struct type *type); > extern struct value *allocate_value_lazy (struct type *type); > extern void allocate_value_contents (struct value *value); > -extern void value_contents_copy (struct value *dst, int dst_offset, > - struct value *src, int src_offset, > - int length); > -extern void value_contents_copy_raw (struct value *dst, int dst_offset, > - struct value *src, int src_offset, > - int length); > +extern void value_contents_copy (struct value *dst, LONGEST dst_offset, > + struct value *src, LONGEST src_offset, > + ULONGEST length); X > +extern void value_contents_copy_raw (struct value *dst, LONGEST dst_offset, > + struct value *src, LONGEST src_offset, > + ULONGEST length); X > > extern struct value *allocate_repeat_value (struct type *type, int count); > > @@ -644,7 +646,8 @@ extern struct value *value_static_field (struct type *type, int fieldno); > extern struct fn_field *value_find_oload_method_list (struct value **, > const char *, > int, int *, > - struct type **, int *); > + struct type **, > + LONGEST *); > > enum oload_search_type { NON_METHOD, METHOD, BOTH }; > > @@ -657,16 +660,16 @@ extern int find_overload_match (struct value **args, int nargs, > > extern struct value *value_field (struct value *arg1, int fieldno); > > -extern struct value *value_primitive_field (struct value *arg1, int offset, > +extern struct value *value_primitive_field (struct value *arg1, LONGEST offset, > int fieldno, > struct type *arg_type); > > > -extern struct type *value_rtti_indirect_type (struct value *, int *, int *, > +extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *, > int *); > > extern struct value *value_full_object (struct value *, struct type *, int, > - int, int); > + LONGEST, int); > > extern struct value *value_cast_pointers (struct type *, struct value *); > > @@ -756,7 +759,7 @@ extern void set_internalvar_string (struct internalvar *var, > extern void clear_internalvar (struct internalvar *var); > > extern void set_internalvar_component (struct internalvar *var, > - int offset, > + LONGEST offset, > int bitpos, int bitsize, > struct value *newvalue); > > @@ -836,7 +839,7 @@ extern struct value *value_x_unop (struct value *arg1, enum exp_opcode op, > enum noside noside); > > extern struct value *value_fn_field (struct value **arg1p, struct fn_field *f, > - int j, struct type *type, int offset); > + int j, struct type *type, LONGEST offset); > > extern int binop_types_user_defined_p (enum exp_opcode op, > struct type *type1, > @@ -864,7 +867,8 @@ extern void release_value_or_incref (struct value *val); > extern int record_latest_value (struct value *val); > > extern void modify_field (struct type *type, gdb_byte *addr, > - LONGEST fieldval, int bitpos, int bitsize); > + LONGEST fieldval, LONGEST bitpos, > + unsigned int bitsize); Why making bitsize unsigned? > > extern void type_print (struct type *type, const char *varstring, > struct ui_file *stream, int show); > @@ -894,7 +898,7 @@ extern void value_print_array_elements (struct value *val, > extern struct value *value_release_to_mark (struct value *mark); > > extern void val_print (struct type *type, const gdb_byte *valaddr, > - int embedded_offset, CORE_ADDR address, > + LONGEST embedded_offset, CORE_ADDR address, > struct ui_file *stream, int recurse, > const struct value *val, > const struct value_print_options *options, > @@ -945,7 +949,7 @@ extern struct value *value_literal_complex (struct value *, struct value *, > extern struct value *find_function_in_inferior (const char *, > struct objfile **); > > -extern struct value *value_allocate_space_in_inferior (int); > +extern struct value *value_allocate_space_in_inferior (ULONGEST); X > > extern struct value *value_subscripted_rvalue (struct value *array, > LONGEST index, int lowerbound); > diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c > index 0dcca75..378cf05 100644 > --- a/gdb/vax-tdep.c > +++ b/gdb/vax-tdep.c > @@ -116,7 +116,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, > struct gdbarch *gdbarch = get_regcache_arch (regcache); > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > gdb_byte buf[4]; > - int count = 0; > + ULONGEST count = 0; X > int i; > > /* We create an argument list on the stack, and make the argument > @@ -125,7 +125,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, > /* Push arguments in reverse order. */ > for (i = nargs - 1; i >= 0; i--) > { > - int len = TYPE_LENGTH (value_enclosing_type (args[i])); > + ULONGEST len = TYPE_LENGTH (value_enclosing_type (args[i])); X > > sp -= (len + 3) & ~3; > count += (len + 3) / 4; > @@ -208,7 +208,7 @@ vax_return_value (struct gdbarch *gdbarch, struct type *func_type, > struct type *type, struct regcache *regcache, > gdb_byte *readbuf, const gdb_byte *writebuf) > { > - int len = TYPE_LENGTH (type); > + ULONGEST len = TYPE_LENGTH (type); X > gdb_byte buf[8]; > > if (TYPE_CODE (type) == TYPE_CODE_STRUCT > diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c > index cfef755..c77e25d 100644 > --- a/gdb/xstormy16-tdep.c > +++ b/gdb/xstormy16-tdep.c > @@ -162,8 +162,9 @@ static void > xstormy16_extract_return_value (struct type *type, struct regcache *regcache, > void *valbuf) > { > - int len = TYPE_LENGTH (type); > - int i, regnum = E_1ST_ARG_REGNUM; > + ULONGEST len = TYPE_LENGTH (type); X > + ULONGEST i; X > + int regnum = E_1ST_ARG_REGNUM; > > for (i = 0; i < len; i += xstormy16_reg_size) > regcache_raw_read (regcache, regnum++, (char *) valbuf + i); > @@ -188,8 +189,9 @@ xstormy16_store_return_value (struct type *type, struct regcache *regcache, > } > else > { > - int len = TYPE_LENGTH (type); > - int i, regnum = E_1ST_ARG_REGNUM; > + ULONGEST len = TYPE_LENGTH (type); X > + ULONGEST i; X > + int regnum = E_1ST_ARG_REGNUM; > > for (i = 0; i < len; i += xstormy16_reg_size) > regcache_raw_write (regcache, regnum++, (char *) valbuf + i); > @@ -235,8 +237,9 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch, > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > CORE_ADDR stack_dest = sp; > int argreg = E_1ST_ARG_REGNUM; > - int i, j; > - int typelen, slacklen; > + int i, slacklen; > + LONGEST j; > + ULONGEST typelen; X > const gdb_byte *val; > char buf[xstormy16_pc_size]; > > diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c > index 78d8888..79308b7 100644 > --- a/gdb/xtensa-tdep.c > +++ b/gdb/xtensa-tdep.c > @@ -1581,7 +1581,7 @@ xtensa_extract_return_value (struct type *type, > { > struct gdbarch *gdbarch = get_regcache_arch (regcache); > bfd_byte *valbuf = dst; > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > ULONGEST pc, wb; > int callsize, areg; > int offset = 0; > @@ -1599,8 +1599,8 @@ xtensa_extract_return_value (struct type *type, > /* On Xtensa, we can return up to 4 words (or 2 for call12). */ > if (len > (callsize > 8 ? 8 : 16)) > internal_error (__FILE__, __LINE__, > - _("cannot extract return value of %d bytes long"), > - len); > + _("cannot extract return value of %s bytes long"), > + pulongest (len)); It should be plongest already with your patch. > > /* Get the register offset of the return > register (A2) in the caller window. */ > @@ -1615,7 +1615,8 @@ xtensa_extract_return_value (struct type *type, > areg = gdbarch_tdep (gdbarch)->a0_base + C0_ARGS; > } > > - DEBUGINFO ("[xtensa_extract_return_value] areg %d len %d\n", areg, len); > + DEBUGINFO ("[xtensa_extract_return_value] areg %d len %s\n", areg, > + pulongest (len)); It should be plongest already with your patch. > > if (len < 4 && gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) > offset = 4 - len; > @@ -1640,7 +1641,7 @@ xtensa_store_return_value (struct type *type, > unsigned int areg; > ULONGEST pc, wb; > int callsize; > - int len = TYPE_LENGTH (type); > + LONGEST len = TYPE_LENGTH (type); > int offset = 0; > > DEBUGTRACE ("xtensa_store_return_value (...)\n"); > @@ -1654,8 +1655,8 @@ xtensa_store_return_value (struct type *type, > > if (len > (callsize > 8 ? 8 : 16)) > internal_error (__FILE__, __LINE__, > - _("unimplemented for this length: %d"), > - TYPE_LENGTH (type)); > + _("unimplemented for this length: %s"), > + pulongest (TYPE_LENGTH (type))); > areg = arreg_number (gdbarch, > gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb); > > @@ -1729,18 +1730,18 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, > { > enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); > int i; > - int size, onstack_size; > + ULONGEST size, onstack_size; X > gdb_byte *buf = (gdb_byte *) alloca (16); > CORE_ADDR ra, ps; > struct argument_info > { > const bfd_byte *contents; > - int length; > + ULONGEST length; X > int onstack; /* onstack == 0 => in reg */ > int align; /* alignment */ > union > { > - int offset; /* stack offset if on stack. */ > + LONGEST offset; /* stack offset if on stack. */ > int regno; /* regno if in register. */ > } u; > }; > @@ -1764,9 +1765,9 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, > { > struct value *arg = args[i]; > struct type *arg_type = check_typedef (value_type (arg)); > - fprintf_unfiltered (gdb_stdlog, "%2d: %s %3d ", i, > + fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i, This is not correct, there was formatting to width 3. > host_address_to_string (arg), > - TYPE_LENGTH (arg_type)); > + pulongest (TYPE_LENGTH (arg_type))); > switch (TYPE_CODE (arg_type)) > { > case TYPE_CODE_INT: > diff --git a/gdb/testsuite/gdb.base/structs-longest-bitpos.c b/gdb/testsuite/gdb.base/structs-longest-bitpos.c > new file mode 100644 > index 0000000..6fb4614 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/structs-longest-bitpos.c > @@ -0,0 +1,28 @@ > +/* This testcase is part of GDB, the GNU debugger. > + > + Copyright 2012 Free Software Foundation, Inc. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see <http://www.gnu.org/licenses/>. */ > + > +struct foo > +{ > + char buf[0xffff000000]; > + char buf2[2]; > +} *f; > + > +int > +main () This is not C++: main (void) > +{ > + return 0; > +} > diff --git a/gdb/testsuite/gdb.base/structs-longest-bitpos.exp b/gdb/testsuite/gdb.base/structs-longest-bitpos.exp > new file mode 100644 > index 0000000..ba49518 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/structs-longest-bitpos.exp > @@ -0,0 +1,30 @@ > +# This testcase is part of GDB, the GNU debugger. > + > +# Copyright 2012 Free Software Foundation, Inc. > + > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see <http://www.gnu.org/licenses/>. > + > +set testfile "structs-longest-bitpos" > +set srcfile ${testfile}.c > +set binfile ${objdir}/${subdir}/${testfile} > + > +if { [prepare_for_testing structs-longest-bitpos.exp "structs-longest-bitpos" "" {debug}] } { It can be just (voluntary, FYI): if { [prepare_for_testing ${testfile}.exp ${testfile}] } { > + return -1 > +} > + > +# The array size should not overflow > +gdb_test "print &f->buf" "= \\(char \\(\\*\\)\\\[1099494850560\\\]\\) 0x0" It can be just (voluntary, FYI): gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0} > + > +# The offset should not overflow > +gdb_test "print &f->buf2" "= \\(char \\(\\*\\)\\\[2\\\]\\) 0xffff000000" It can be just (voluntary, FYI): gdb_test "print &f->buf2" {= \(char \(\*\)\[2\]\) 0xffff000000} Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-15 20:07 ` Jan Kratochvil @ 2012-05-16 3:50 ` Siddhesh Poyarekar 2012-05-16 7:19 ` Jan Kratochvil 2012-05-23 13:52 ` Siddhesh Poyarekar 1 sibling, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-05-16 3:50 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey On Tue, 15 May 2012 22:04:54 +0200, Jan wrote: > while I have a local patch for it it is easier to state that: > * the patch needs a small rebase to HEAD for very recent changes. > * it does not compile on 32-bit i386 host OS due to %ld used for > LONGEST. > Thanks for the very exhaustive review. I'll need some time to go through all of the points below, but I'll come up with a new patch once I have. > In such case I think we can keep signedness for all the changes. > While one may consider more clean to use unsigned types in some cases > it can bring unexpected regressions, for example in > amd64_push_arguments you correctly changed the first occurence: > > > - int len = TYPE_LENGTH (type); > > + LONGEST len = TYPE_LENGTH (type); > > But in other cases you use ULONGEST. In this case ULONGEST would be > a regression as there is below: > > for (j = 0; len > 0; j++, len -= 8) > > If you have carefully checked all the signedness changes for possible > regressions I will re-review it. Still it seems to me unrelated to > this patch (and possibly not worth the effort, YMMV). > Or did you see some specific splint warnings for it? > I have marked in this patch such lines by ^X$. > I understand changing to patch to keep the signedness looks like > worsening the patch. I think I agree with you on this because I had not thought of the difficulty involved in isolating regressions due to the size of this patch. It would be safer in this case to keep length as LONGEST because while I did try to check for all cases where ULONGEST may cause a regression (like above), but I cannot say for sure that it's all perfect. The splint warnings are actually for the opposite (for length not being ULONGEST), since splint is not that smart in these aspects. Funnily, I think it will be easier because splint will be happy about the fact that both bitpos and length are the same type. I'll work on that and the rest of the review comments and come up with the next draft for this patch. Thanks, Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-16 3:50 ` Siddhesh Poyarekar @ 2012-05-16 7:19 ` Jan Kratochvil 2012-05-16 7:41 ` Siddhesh Poyarekar 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-05-16 7:19 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey On Wed, 16 May 2012 05:50:12 +0200, Siddhesh Poyarekar wrote: > It would be safer in this case to keep length as LONGEST because > while I did try to check for all cases where ULONGEST may cause a > regression (like above), but I cannot say for sure that it's all > perfect. But type->length was already unsigned before. I think it is fine to keep type->length ULONGEST, there should be no regression due to it. We agree that unsigned type (ULONGEST) is right for type->length. I meant more all the local variables turned signed->unsigned or unsigned->signed. Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-16 7:19 ` Jan Kratochvil @ 2012-05-16 7:41 ` Siddhesh Poyarekar 2012-05-20 15:43 ` Doug Evans 0 siblings, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-05-16 7:41 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey On Wed, 16 May 2012 09:19:11 +0200, Jan wrote: > On Wed, 16 May 2012 05:50:12 +0200, Siddhesh Poyarekar wrote: > > It would be safer in this case to keep length as LONGEST because > > while I did try to check for all cases where ULONGEST may cause a > > regression (like above), but I cannot say for sure that it's all > > perfect. > > But type->length was already unsigned before. I think it is fine to > keep type->length ULONGEST, there should be no regression due to it. > We agree that unsigned type (ULONGEST) is right for type->length. > > I meant more all the local variables turned signed->unsigned or > unsigned->signed. Ah ok, I misread that. I'll watch out for that. Thanks, Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-16 7:41 ` Siddhesh Poyarekar @ 2012-05-20 15:43 ` Doug Evans 2012-05-20 20:24 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Doug Evans @ 2012-05-20 15:43 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: Jan Kratochvil, gdb-patches, Tom Tromey On Wed, May 16, 2012 at 12:41 AM, Siddhesh Poyarekar <siddhesh@redhat.com> wrote: > On Wed, 16 May 2012 09:19:11 +0200, Jan wrote: >> On Wed, 16 May 2012 05:50:12 +0200, Siddhesh Poyarekar wrote: >> > It would be safer in this case to keep length as LONGEST because >> > while I did try to check for all cases where ULONGEST may cause a >> > regression (like above), but I cannot say for sure that it's all >> > perfect. >> >> But type->length was already unsigned before. I think it is fine to >> keep type->length ULONGEST, there should be no regression due to it. >> We agree that unsigned type (ULONGEST) is right for type->length. >> >> I meant more all the local variables turned signed->unsigned or >> unsigned->signed. > > Ah ok, I misread that. I'll watch out for that. > > Thanks, > Siddhesh Since it's now ok to use int64_t,uint64_t (right?) I wonder if we should move away from LONGEST,ULONGEST. [I remember a port Cygnus once did where long long was 128 bits. 1/2 :-)] ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-20 15:43 ` Doug Evans @ 2012-05-20 20:24 ` Jan Kratochvil 2012-05-20 20:28 ` Doug Evans 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-05-20 20:24 UTC (permalink / raw) To: Doug Evans; +Cc: Siddhesh Poyarekar, gdb-patches, Tom Tromey On Sun, 20 May 2012 17:42:56 +0200, Doug Evans wrote: > Since it's now ok to use int64_t,uint64_t (right?) I wonder if we > should move away from LONGEST,ULONGEST. > [I remember a port Cygnus once did where long long was 128 bits. 1/2 :-)] I agree. Although if for example Siddhesh has the patch already mostly ready with LONGEST/ULONGEST I do not think it needs to be reworked, do you? Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-20 20:24 ` Jan Kratochvil @ 2012-05-20 20:28 ` Doug Evans 0 siblings, 0 replies; 70+ messages in thread From: Doug Evans @ 2012-05-20 20:28 UTC (permalink / raw) To: Jan Kratochvil; +Cc: Siddhesh Poyarekar, gdb-patches, Tom Tromey On Sun, May 20, 2012 at 1:24 PM, Jan Kratochvil <jan.kratochvil@redhat.com> wrote: > On Sun, 20 May 2012 17:42:56 +0200, Doug Evans wrote: >> Since it's now ok to use int64_t,uint64_t (right?) I wonder if we >> should move away from LONGEST,ULONGEST. >> [I remember a port Cygnus once did where long long was 128 bits. 1/2 :-)] > > I agree. Although if for example Siddhesh has the patch already mostly ready > with LONGEST/ULONGEST I do not think it needs to be reworked, do you? Naw, I'm not suggesting it has to be reworked. Now seemed like a good time to raise the issue, that's all. ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-15 20:07 ` Jan Kratochvil 2012-05-16 3:50 ` Siddhesh Poyarekar @ 2012-05-23 13:52 ` Siddhesh Poyarekar 2012-05-23 17:46 ` Jan Kratochvil 1 sibling, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-05-23 13:52 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey Hi Jan, I'm back to working on this. A couple of clarifications on the review: > > static void > > -copy_bitwise (gdb_byte *dest, unsigned int dest_offset_bits, > > - const gdb_byte *source, unsigned int > > source_offset_bits, > > - unsigned int bit_count, > > +copy_bitwise (gdb_byte *dest, ULONGEST dest_offset_bits, > > + const gdb_byte *source, ULONGEST source_offset, > > + ULONGEST bit_count, > > int bits_big_endian) > > { > > - unsigned int dest_avail; > > + unsigned int dest_avail, source_offset_bits; > > int datum; > > > > /* Reduce everything to byte-size pieces. */ > > dest += dest_offset_bits / 8; > > dest_offset_bits %= 8; > > - source += source_offset_bits / 8; > > - source_offset_bits %= 8; > > + source += source_offset / 8; > > + source_offset_bits = source_offset % 8; > > I do not fully understand this whole change but it looks unrelated to > this patch to me. I had to split up the source_offset and source_offset bits because source_offset can be LONGEST but the bits would always be less than 8. I did this because otherwise I would have had to change signatures of functions that use source_offset_bits even when it is not really needed (extract_bits and extract_bits_primitive). > > size of this argument and rounding to an int boundary. */ > > diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c > > index 91125e1..a3c15d0 100644 > > --- a/gdb/symfile-mem.c > > +++ b/gdb/symfile-mem.c > > @@ -55,6 +55,11 @@ > > #include "auxv.h" > > #include "elf/common.h" > > > > +static int symfile_target_read_memory (CORE_ADDR memaddr, gdb_byte > > *myaddr, > > + int len) > > +{ > > + return target_read_memory (memaddr, myaddr, len); > > +} > > Formatting should be (see also tab -> 2 spaces): > > static int > symfile_target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int > len) { > return target_read_memory (memaddr, myaddr, len); > } > > But I proposed to rather target_read_memory use size_t and we should > then proposed to bfd/ that it also uses size_t for > bfd_elf_bfd_from_remote_memory. Perhaps it will be helpful if I keep this change (and consequently the rest of the read/write_memory function changes) as a separate patch? AFAICT the only place where not having these changes as part of the original patch will potentially cause problems is in do_search_struct_field. That way I'll also do the size_t changes right away instead of changing and then reverting the change. > > void > > modify_field (struct type *type, gdb_byte *addr, > > - LONGEST fieldval, int bitpos, int bitsize) > > + LONGEST fieldval, LONGEST bitpos, unsigned int > > bitsize) > > WHy to make bitsize unsigned here? It's a minor nit to make the arguments match the comment above it: Requires 0 < BITSIZE <= lbits, 0 <= BITPOS % 8 + BITSIZE <= lbits, and 0 <= BITPOS, where lbits is the size of a LONGEST in bits. */ but this does not belong in this patch. I'll have to get together these smaller patches too so that they're not missed out. I'm still working on the rest of the points, which is mainly maintain signedness when expanding variables and a couple of other problems. Regards, Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-23 13:52 ` Siddhesh Poyarekar @ 2012-05-23 17:46 ` Jan Kratochvil 2012-05-24 1:36 ` Siddhesh Poyarekar 2012-05-31 6:39 ` [PATCH v2] " Siddhesh Poyarekar 0 siblings, 2 replies; 70+ messages in thread From: Jan Kratochvil @ 2012-05-23 17:46 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey Hi Siddhesh, On Wed, 23 May 2012 15:52:45 +0200, Siddhesh Poyarekar wrote: > > > static void > > > -copy_bitwise (gdb_byte *dest, unsigned int dest_offset_bits, > > > - const gdb_byte *source, unsigned int > > > source_offset_bits, > > > - unsigned int bit_count, > > > +copy_bitwise (gdb_byte *dest, ULONGEST dest_offset_bits, > > > + const gdb_byte *source, ULONGEST source_offset, > > > + ULONGEST bit_count, > > > int bits_big_endian) > > > { > > > - unsigned int dest_avail; > > > + unsigned int dest_avail, source_offset_bits; > > > int datum; > > > > > > /* Reduce everything to byte-size pieces. */ > > > dest += dest_offset_bits / 8; > > > dest_offset_bits %= 8; > > > - source += source_offset_bits / 8; > > > - source_offset_bits %= 8; > > > + source += source_offset / 8; > > > + source_offset_bits = source_offset % 8; > > > > I do not fully understand this whole change but it looks unrelated to > > this patch to me. > > I had to split up the source_offset and source_offset bits because > source_offset can be LONGEST but the bits would always be less than 8. > I did this because otherwise I would have had to change signatures of > functions that use source_offset_bits even when it is not really needed > (extract_bits and extract_bits_primitive). OK, understood now. Therefore just to make splint quiet. Just in such case - without running splint now myself - dest_offset_bits seems to have exactly the same problem, it is passed to insert_bits. > > static int > > symfile_target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int > > len) { > > return target_read_memory (memaddr, myaddr, len); > > } > > > > But I proposed to rather target_read_memory use size_t and we should > > then proposed to bfd/ that it also uses size_t for > > bfd_elf_bfd_from_remote_memory. > > Perhaps it will be helpful if I keep this change (and consequently the > rest of the read/write_memory function changes) as a separate patch? Yes, this size_t change - needs to be also posted to binutils@sourceware.org for approval (the bfd/ part). I think it should be done first and the mail to binutils@sourceware.org (Cc gdb-patches) should not contain parts affecting only gdb/ (it should contain parts needed to keep gdb/ compatible with the bfd/ changes). Also maybe binutils will have different opinion on it. Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-23 17:46 ` Jan Kratochvil @ 2012-05-24 1:36 ` Siddhesh Poyarekar 2012-05-24 15:01 ` Jan Kratochvil 2012-05-31 6:39 ` [PATCH v2] " Siddhesh Poyarekar 1 sibling, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-05-24 1:36 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey On Wed, 23 May 2012 19:46:10 +0200, Jan wrote: > Hi Siddhesh, > > On Wed, 23 May 2012 15:52:45 +0200, Siddhesh Poyarekar wrote: > > > > static void > > > > -copy_bitwise (gdb_byte *dest, unsigned int dest_offset_bits, > > > > - const gdb_byte *source, unsigned int > > > > source_offset_bits, > > > > - unsigned int bit_count, > > > > +copy_bitwise (gdb_byte *dest, ULONGEST dest_offset_bits, > > > > + const gdb_byte *source, ULONGEST source_offset, > > > > + ULONGEST bit_count, > > > > int bits_big_endian) > > > > { > > > > - unsigned int dest_avail; > > > > + unsigned int dest_avail, source_offset_bits; > > > > int datum; > > > > > > > > /* Reduce everything to byte-size pieces. */ > > > > dest += dest_offset_bits / 8; > > > > dest_offset_bits %= 8; > > > > - source += source_offset_bits / 8; > > > > - source_offset_bits %= 8; > > > > + source += source_offset / 8; > > > > + source_offset_bits = source_offset % 8; > > > > > > I do not fully understand this whole change but it looks > > > unrelated to this patch to me. > > > > I had to split up the source_offset and source_offset bits because > > source_offset can be LONGEST but the bits would always be less than > > 8. I did this because otherwise I would have had to change > > signatures of functions that use source_offset_bits even when it is > > not really needed (extract_bits and extract_bits_primitive). > > OK, understood now. Therefore just to make splint quiet. > > Just in such case - without running splint now myself - > dest_offset_bits seems to have exactly the same problem, it is passed > to insert_bits. dest_offset_bits is safe to be truncated when passing into insert_bits. The trouble with source_offset_bits is that its pointer is passed into extract_bits, because of which the function signature change becomes non-optional unless just a cast is OK here. > Yes, this size_t change - needs to be also posted to > binutils@sourceware.org for approval (the bfd/ part). I think it > should be done first and the mail to binutils@sourceware.org (Cc > gdb-patches) should not contain parts affecting only gdb/ (it should > contain parts needed to keep gdb/ compatible with the bfd/ changes). > Also maybe binutils will have different opinion on it. OK, thanks for letting me know. I'll do this first. Regards, Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-24 1:36 ` Siddhesh Poyarekar @ 2012-05-24 15:01 ` Jan Kratochvil 2012-05-31 18:15 ` [PATCH v3] " Siddhesh Poyarekar 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-05-24 15:01 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey On Thu, 24 May 2012 03:36:34 +0200, Siddhesh Poyarekar wrote: > On Wed, 23 May 2012 19:46:10 +0200, Jan wrote: > > On Wed, 23 May 2012 15:52:45 +0200, Siddhesh Poyarekar wrote: > > > > > static void > > > > > -copy_bitwise (gdb_byte *dest, unsigned int dest_offset_bits, > > > > > - const gdb_byte *source, unsigned int > > > > > source_offset_bits, > > > > > - unsigned int bit_count, > > > > > +copy_bitwise (gdb_byte *dest, ULONGEST dest_offset_bits, > > > > > + const gdb_byte *source, ULONGEST source_offset, > > > > > + ULONGEST bit_count, > > > > > int bits_big_endian) > > > > > { > > > > > - unsigned int dest_avail; > > > > > + unsigned int dest_avail, source_offset_bits; > > > > > int datum; > > > > > > > > > > /* Reduce everything to byte-size pieces. */ > > > > > dest += dest_offset_bits / 8; > > > > > dest_offset_bits %= 8; > > > > > - source += source_offset_bits / 8; > > > > > - source_offset_bits %= 8; > > > > > + source += source_offset / 8; > > > > > + source_offset_bits = source_offset % 8; [...] > dest_offset_bits is safe to be truncated when passing into insert_bits. > The trouble with source_offset_bits is that its pointer is passed into > extract_bits, because of which the function signature change becomes > non-optional unless just a cast is OK here. Understood/agreed, due to: datum = extract_bits (&source, &source_offset_bits, 8, bits_big_endian); Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-24 15:01 ` Jan Kratochvil @ 2012-05-31 18:15 ` Siddhesh Poyarekar 2012-06-05 22:27 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-05-31 18:15 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey [-- Attachment #1: Type: text/plain, Size: 539 bytes --] Hi, Here's a new draft of the patch I have been working on to expand bitpos and type.length. This change is completed by my earlier two submissions, i.e.: http://sourceware.org/ml/gdb-patches/2012-05/msg00988.html http://sourceware.org/ml/gdb-patches/2012-05/msg01073.html This patch should build by itself however and hence it should be possible to review it independently. I have run the full testsuite on x86_64 to confirm that there are no regressions. I have also done a build test on RHEL-5 i386 and x86_64. Regards, Siddhesh [-- Attachment #2: bitpos-changelog.txt --] [-- Type: text/plain, Size: 28966 bytes --] gdb/ChangeLog 2012-05-31 Siddhesh Poyarekar <siddhesh@redhat.com> * ada-lang.c (fat_pntr_bounds_bitpos): Return LONGEST. (fat_pntr_data_bitpos): Likewise. (desc_bound_bitpos): Likewise. (constrained_packed_array_type): Expand elt_bits parameter to LONGEST. (move_bits): Expand parameters src_offset and n to LONGEST. (cond_offset_host): Expand parameter offset to LONGEST. (cond_offset_target): Likewise. (ada_type_of_array): Expand array_bitsize to LONGEST. (decode_constrained_packed_array_type): Expand bits to LONGEST. (decode_constrained_packed_array): Expand bit_pos to LONGEST. (ada_value_primitive_packed_val): Expand parameter offset to LONGEST. Expand targ and ntarg to LONGEST. (ada_value_assign): Expand from_size to LONGEST. (value_assign_to_component): Expand bits to LONGEST. (ensure_lval): Expand len to LONGEST. (value_pointer): Expand len to ULONGEST. (value_tag_from_contents_and_address): Expand tag_byte_offset to LONGEST. (ada_value_primitive_field): Expand parameter offset to LONGEST. Expand bit_pos to LONGEST. (find_struct_field): Expand parameters offset and byte_offset_p to LONGEST. Expand bit_pos and fld_offset to LONGEST. (ada_search_struct_field): Expand parameter offset to LONGEST. Expand var_offset to LONGEST. (ada_index_struct_field): Expand parameters index and offset to LONGEST. (ada_index_struct_field_1): Expand parameters index_p and offset to LONGEST. (ada_value_struct_elt): Expand byte_offset to LONGEST. (align_value): Return ULONGEST. Expand parameter off and alignment to ULONGEST. (ada_template_to_fixed_record_type_1): Expand off, bit_len and fld_bit_len to LONGEST. Expand field_offset to LONGEST. Use pulongest function to print TYPE_LENGTH. (to_fixed_array_type): Expand len to LONGEST. * ada-lang.h (ada_val_print): Expand parameter embedded_offset to LONGEST. (ada_printstr): Expand parameter length to ULONGEST. (ada_value_primitive_packed_val): Expand parameter offset to LONGEST. * ada-typeprint.c (ada_print_type): Use pulongest to print TYPE_LENGTH. * ada-valprint.c (val_print_packed_array_elements): Expand eltlen to ULONGEST. (char_at): Expand parameter i to LONGEST. (printstr): Expand parameter length to ULONGEST. (ada_printstr): Likewise. (ada_val_print): Expand embedded_offset to LONGEST. (ada_val_print_array): Expand eltlen, len to ULONGEST and temp_len to LONGEST. (ada_val_print_1): Expand parameter offset to LONGEST. Expand len to LONGEST. (print_variant_part): Expand parameters offset and outer_offset to LONGEST. (print_field_values): Likewise. Expand bit_pos to LONGEST. * alpha-tdep.c (struct alpha_arg): Expand member len to LONGEST. (alpha_push_dummy_call): Expand len to LONGEST. (alpha_extract_return_value): Likewise. (alpha_store_return_value): Likewise. * amd64-tdep.c (amd64_classify_aggregate): Expand len, bitsize, endpos and pos to LONGEST. (amd64_classify): Expand len to LONGEST. (amd64_return_value): Likewise. (amd64_push_arguments): Expand num_elements, element and len to LONGEST. (amd64_get_longjmp_target): Expand len to LONGEST. * amd64-windows-tdep.c (amd64_windows_return_value): Likewise. * arm-linux-nat.c (arm_linux_hw_watchpoint_initialize): Expand parameter len to LONGEST. (arm_linux_region_ok_for_hw_watchpoint): Likewise. (arm_linux_insert_watchpoint): Likewise. (arm_linux_remove_watchpoint): Likewise. * arm-tdep.c (arm_push_dummy_call): Expand len to LONGEST. (arm_extract_return_value): Likewise. (arm_store_return_value): Likewise. * avr-tdep.c (avr_return_value): Expand i to LONGEST. (push_stack_item): Expand parameter len to LONGEST. (avr_push_dummy_call): Expand last_regnum, len to LONGEST. * ax-gdb.c (gen_trace_static_fields): Expand length to LONGEST. (gen_traced_pop): Likewise. (gen_left_shift): Expand parameter distance to LONGEST. (gen_offset): Expand parameter offset to LONGEST. (gen_bitfield_ref): Expand parameters start, end to LONGEST. Expand bound_start, bound_end, offset to LONGEST. (gen_primitive_field): Expand parameter offset to LONGEST. (gen_struct_ref_recursive): Likewise. * bfin-tdep.c (bfin_push_dummy_call): Expand total_len, len, container_len to LONGEST. (bfin_extract_return_value): Expand len to LONGEST. (bfin_store_return_value): Likewise. * breakpoint.c (update_watchpoint): Expand len to LONGEST. (can_use_hardware_watchpoint): Likewise. (invalidate_bp_value_on_memory_change): Expand parameter len to LONGEST. * breakpoint.h (struct bp_location): Expand member length to LONGEST. * c-lang.c (c_printstr): Expand parameter length to ULONGEST. (evaluate_subexp_c): Expand element_size, i to LONGEST. * c-lang.h (c_val_print): Expand parameter embedded_offset to LONGEST. (c_printstr): Expand parameter length to ULONGEST. (cp_print_value_fields): Expand parameter offset to LONGEST. (cp_print_value_fields_rtti): Likewise. * c-typeprint.c (c_type_print_varspec_suffix): Remove cast down to int and use plongest to print LONGEST. * c-valprint.c (c_val_print): Expand parameter embedded_offset to LONGEST. Expand offset to LONGEST, eltlen to ULONGEST. (c_value_print): Expand top to LONGEST. * cp-abi.c (baseclass_offset): Return LONGEST. Expand parameter embedded_offset to LONGEST. Expand res to LONGEST. (value_virtual_fn_field): Expand parameter offset to LONGEST. (value_rtti_type): Expand parameter top to point to LONGEST. * cp-abi.h (value_virtual_fn_field): Expand offset to LONGEST. (value_rtti_type): Expand top to point to LONGEST. (baseclass_offset): Return LONGEST. Expand parameter embedded_offset to LONGEST. (struct cp_abi_ops): Expand parameter offset for virtual_fn_field to LONGEST. Expand parameter top to point to LONGEST in value_rtti_type. Return LONGEST from baseclass_offset and expand parameter for embedded_offset to LONGEST. * cp-valprint.c (cp_print_value_fields): Expand parameter offset to LONGEST. (cp_print_value_fields_rtti): Likewise. Expand top to LONGEST. (cp_print_value): Expand parameter offset to LONGEST. Expand thisoffset, boffset to LONGEST. * cris-tdep.c (push_stack_item): Expand parameter len to LONGEST. (cris_push_dummy_call): Expand len, reg_demand, i to LONGEST. (cris_store_return_value): Expand len to LONGEST. (cris_extract_return_value): Likewise. * d-lang.h (d_val_print): Expand parameter embedded_offset to LONGEST. * d-valprint.c (dynamic_array_type): Likewise. (d_val_print): Likewise. * doublest.c (floatformat_from_length): Expand parameter len to LONGEST. Use plongest to format string for LONGEST. * dwarf2loc.c (copy_bitwise): Expand parameters dest_offset_bits, bit_count to ULONGEST. Rename parameter source_offset_bits to source_offset and expand to ULONGEST. New variable source_offset_bits. (read_pieced_value): Expand offset, dest_offset_bits, source_offset_bits, source_offset to LONGEST. Expand type_len, this_size, this_size_bits to ULONGEST. (write_pieced_value): Expand type_len, this_size, this_size_bits to ULONGEST. Expand dest_offset_bits, source_offset_bits, dest_offset, source_offset to LONGEST. (check_pieced_value_bits): Expand parameters bit_offset and bit_length to LONGEST. (check_pieced_value_validity): Likewise. (check_pieced_synthetic_pointer): Likewise. (indirect_pieced_value): Expand bit_length, byte_offset and bit_offset to LONGEST. (dwarf2_evaluate_loc_desc_full): Expand n to ULONGEST. * dwarf2read.c (struct dwarf_block): Expand member size to size_t. (dwarf2_const_value_length_mismatch_complaint): Expand parameters arg2 and arg3 to LONGEST. Use plongest to print arg2 and arg3. (dwarf2_add_field): Expand anonymous_size to LONGEST. (dump_die_shallow): Use %zd to print dwarf_block.size. * eval.c (evaluate_struct_tuple): Expand bitpos to LONGEST. (init_array_element): Expand element_size to LONGEST. (binop_promote): Expand promoted_len1, promoted_len2, result_len to ULONGEST. (evaluate_subexp_standard): Expand mem_offset, top, element_size to LONGEST. * f-lang.c (f_printstr): Expand parameter length to ULONGEST. * f-lang.h (f_val_print): Expand parameter embedded_offset to LONGEST. * f-valprint.c (f77_array_offset_tbl): Make LONGEST. (f77_create_arrayprint_offset_tbl): Expand eltlen to LONGEST. (f77_print_array_1): Expand parameter embedded_offset to LONGEST. (f77_print_array): Likewise. (f_val_print): Likewise. Expand offset to LONGEST. * findcmd.c (parse_find_args): Expand val_bytes to LONGEST. * findvar.c (default_read_var_value): Expand len to LONGEST. (default_value_from_register): Likewise. (read_frame_register_value): Expand offset, reg_offset, len, reg_len to LONGEST. * frv-tdep.c (frv_extract_return_value): Expand len to LONGEST. Use plongest to format print len. (frv_push_dummy_call): Expand len to LONGEST. (frv_store_return_value): Likewise. Use plongest to format print len. * gdbtypes.c (init_type): Expand parameter length to LONGEST. (is_unique_ancestor_worker): Expand parameters offset, embedded_offset to LONGEST. Expand this_offset to LONGEST. (is_unique_ancestor): Expand offset to LONGEST. (recursive_dump_type): Use pulongest to format print TYPE_LENGTH. Use plongest to format print TYPE_FIELD_BITPOS. (arch_type): Expand parameter length to LONGEST. * gdbtypes.h (type.main_type.fld_bnds.fields): Expand bitpos to LONGEST. (type): Expand length to ULONGEST. (init_type): Expand parameter length to LONGEST. (arch_type): Likewise. * gnu-v2-abi.c (gnuv2_virtual_fn_field): Expand parameter offset to LONGEST. (gnuv2_value_rtti_type): Expand parameter top to point to LONGEST. (gnuv2_baseclass_offset): Return LONGEST. Expand parameter embedded_offset to LONGEST. Expand field_offset, boffset, field_length to LONGEST. * gnu-v3-abi.c (build_gdb_vtable_type): Expand offset to LONGEST. (vtable_address_point_offset): Return LONGEST. (gnuv3_rtti_type): Expand parameter top_p to point to LONGEST. (gnuv3_virtual_fn_field): Expand parameter offset to LONGEST. (gnuv3_baseclass_offset): Return LONGEST. Expand parameter embedded_ofset to LONGEST. Expand cur_base_offset, base_offset to LONGEST. (gnuv3_find_method_in): Expand pos to LONGEST. * go-lang.h (go_val_print): Expand parameter embedded_offset to LONGEST. * go-valprint.c (go_val_print): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Expand stack_alloc, stack_offset, len, padded_len, offset to LONGEST. * hppa-tdep.c (hppa64_push_dummy_call): Expand len to LONGEST. (hppa64_return_value): Likewise. * i386-darwin-tdep.c (i386_darwin_arg_type_alignment): Return LONGEST. Expand res to LONGEST. (i386_darwin_push_dummy_call): Expand arg_spaces, len, align to LONGEST. * i386-nat.c (i386_show_dr): Expand parameter len to LONGEST. Use plongest to format print len. (i386_handle_nonaligned_watchpoint): Expand parameter len to LONGEST. (i386_insert_watchpoint): Likewise. (i386_remove_watchpoint): Likewise. (i386_region_ok_for_watchpoint): Likewise. * i386-tdep.c (i386_push_dummy_call): Expand arg_space, arg_space_used, len to LONGEST. (i386_extract_return_value): Expand len to LONGEST. Use plongest to format print len. (i386_store_return_value): Likewise. * ia64-linux-nat.c (ia64_linux_insert_watchpoint): Expand parameter len to LONGEST. (ia64_linux_remove_watchpoint): Likewise. * ia64-tdep.c (ia64_extract_return_value): Expand n to LONGEST. (ia64_store_return_value): Likewise. (ia64_push_dummy_call): Expand argoffset, len, nslots, memslots to LONGEST. * inf-ttrace.c (inf_ttrace_insert_watchpoint): Expand parameter len to LONGEST. (inf_ttrace_remove_watchpoint): Likewise. (inf_ttrace_region_ok_for_hw_watchpoint): Likewise. * infcall.c (call_function_by_hand): Expand len to LONGEST. * infrun.c (save_infcall_suspend_state): Expand len to ULONGEST. (restore_infcall_suspend_state): Eliminate single-use variable len. * iq2000-tdep.c (iq2000_store_return_value): Expand len to LONGEST. (iq2000_extract_return_value): Likewise. (iq2000_push_dummy_call): Expand typelen, stackspace to LONGEST. * jv-lang.c (java_link_class_type): Expand boffset to LONGEST. (java_printstr): Expand parameter length to ULONGEST. * jv-lang.h (java_val_print): Expand parameter embedded_offset to LONGEST. * jv-valprint.c (java_print_value_fields): Expand parameter offset to LONGEST. (java_val_print): Expand parameter embedded_offset to LONGEST. * language.c (unk_lang_printstr): Expand parameter length to ULONGEST. (unk_lang_val_print): Expand parameter embedded_offset to LONGEST. * language.h (language_defn): Expand parameter length of la_printstr to ULONGEST. Expand parameter embedded_offset of la_val_print to LONGEST. * lm32-tdep.c (lm32_push_dummy_call): Expand len to LONGEST. (lm32_store_return_value): Likewise. * m2-lang.c (m2_printstr): Expand parameter length to ULONGEST. * m2-lang.h (m2_val_print): Expand parameter embedded_offset to LONGEST. * m2-typeprint.c (m2_array): Use pulongest to print TYPE_LENGTH. (m2_enum): expand lastval to LONGEST. * m2-valprint.c (m2_print_long_set): Expand parameter embedded_offset to LONGEST. (m2_print_unbounded_array): Likewise. (m2_print_array_contents): Likewise. Eliminate eltlen and use TYPE_LENGTH directly. (m2_val_print): Expand parameter embedded_offset to LONGEST. Expand i, len, temp_len to ULONGEST. Remove eltlen, use TYPE_LENGTH directly. * m32r-tdep.c (m32r_push_dummy_call): Expand len to LONGEST. (m32r_extract_return_value): Likewise. * m68hc11-tdep.c (m68hc11_push_dummy_call): Expand len to LONGEST. (m68hc11_store_return_value): Likewise. * m68k-tdep.c (m68k_extract_return_value): Expand len to LONGEST. Use plongest to format print len. (m68k_svr4_extract_return_value): Replace single-use variable len with TYPE_LENGTH. (m68k_store_return_value): Expand len to LONGEST. Use plongest to format print len. (m68k_svr4_store_return_value): Replace single-use variable len with TYPE_LENGTH. (m68k_push_dummy_call): Expand len, container_len, offset to LONGEST. * m88k-tdep.c (m88k_store_arguments): Expand num_register_words, num_stack_words, len to LONGEST. (m88k_return_value): Expand len to LONGEST. * memrange.c (mem_ranges_overlap): Expand parameters len1, len2 to LONGEST. * memrange.h (struct mem_range): Expand member length to LONGEST. (mem_ranges_overlap): Expand parameters len1, len2 to LONGEST. * mep-tdep.c (push_large_arguments): Expand arg_len to ULONGEST. (mep_push_dummy_call): Expand arg_size to ULONGEST. * microblaze-tdep.c (microblaze_store_return_value): Expand len to LONGEST. * mips-linux-nat.c (mips_linux_region_ok_for_hw_watchpoint): Expand parameter len to LONGEST. (mips_linux_insert_watchpoint): Likewise. (mips_linux_remove_watchpoint): Likewise. * mips-tdep.c (mips_xfer_register): Expand parameter buf_offset to LONGEST. Use plongest to format print buf_offset. (mips_eabi_push_dummy_call): Expand len to LONGEST. Use plongest to format print len. (mips_n32n64_fp_arg_chunk_p): Expand parameter offset to LONGEST. Expand pos to LONGEST. (mips_n32n64_return_value): Expand offset to LONGEST. Use plongest to format print offset. (mips_o32_push_dummy_call): Expand len to LONGEST. Eliminate single-use variable arglen. Use plongest to format print len. (mips_o64_push_dummy_call): Expand len, stack_offset to LONGEST. Eliminate single-use variable arglen. Use plongest to format print len. * mn10300-tdep.c (mn10300_type_align): Return LONGEST. Expand align, falign to LONGEST. (mn10300_push_dummy_call): Expand len, arg_len to LONGEST. * moxie-tdep.c (moxie_store_return_value): Expand len to LONGEST. (moxie_extract_return_value): Likewise. * mt-tdep.c (mt_push_dummy_call): Expand stack_dest, typelen to LONGEST. * nto-procfs.c (procfs_hw_watchpoint): Expand parameter len to LONGEST. (procfs_remove_hw_watchpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. * objc-lang.c (objc_printstr): Expand parameter length to ULONGEST. * opencl-lang.c (lookup_opencl_vector_type): Expand parameter el_length to ULONGEST. Expand length to ULONGEST. (lval_func_read): Expand offset, n, i, j and elsize to LONGEST. (lval_func_write): Likewise. (lval_func_check_validity): Expand parameter length to LONGEST. Expand elsize, start, end, i to LONGEST. (lval_func_check_any_valid): Expand elsize to LONGEST. (lval_func_check_synthetic_pointer): Expand parameters offset and length to LONGEST. Expand elsize, start, end, i to LONGEST. * p-lang.c (is_pascal_string_type): Expand parameters length_pos, string_pos, length_size to point to LONGEST. (pascal_printstr): Expand parameter length to ULONGEST. * p-lang.h (pascal_val_print): Expand parameter embedded_offset to LONGEST. (is_pascal_string_type): Expand parameters length_pos, string_pos, length_size to point to LONGEST. (pascal_printstr): Expand parameter length to ULONGEST. (pascal_object_print_value_fields): Expand parameter offset to LONGEST. * p-typeprint.c (pascal_type_print_base): Expand lastval to LONGEST. * p-valprint.c (pascal_val_print): Expand parameter embedded_offset to LONGEST. Expand eltlen to ULONGEST. Expand length_size, length_pos, string_pos to LONGEST. (pascal_object_print_value_fields): Expand parameter offset to LONGEST. (pascal_object_print_value): Likewise. Expand boffset, thisoffset to LONGEST. * ppc-linux-nat.c (check_condition): Expand parameter len to point to LONGEST. (ppc_linux_can_accel_watchpoint_condition): Expand parameter len to LONGEST. (create_watchpoint_request): Likewise. (ppc_linux_insert_watchpoint): Likewise. (ppc_linux_remove_watchpoint): Likewise. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Expand argoffset, structoffset, len, i, nelt to LONGEST. (do_ppc_sysv_return_value): Expand i, nelt, offset to LONGEST. (ppc64_sysv_abi_push_dummy_call): Expand len to LONGEST. (ppc64_sysv_abi_return_value): Expand n_regs, i, offset to LONGEST. * printcmd.c (print_formatted): Expand len to LONGEST. (float_type_from_length): Expand len to ULONGEST. (print_scalar_formatted): Likewise. * procfs.c (procfs_set_watchpoint): Expand parameter len to LONGEST. (procfs_insert_watchpoint): Likewise. (procfs_remove_watchpoint): Likewise. (procfs_region_ok_for_hw_watchpoint): Likewise. * python/py-prettyprint.c (apply_val_pretty_printer): Expand parameter embedded_offset to LONGEST. * python/python.h (apply_val_pretty_printer): Likewise. * regcache.c (regcache_xfer_part): Expand parameter offset to LONGEST. (regcache_cooked_read_part): Likewise. (regcache_cooked_write_part): Likewise. * regcache.h (regcache_cooked_read_part): Likewise. (regcache_cooked_write_part): Likewise. * remote-m32r-sdi.c (m32r_insert_watchpoint): Expand parameter len to LONGEST. Use plongest to format print len. (m32r_remove_watchpoint): Likewise. * remote-mips.c (struct lsi_breakpoint_info): Expand member len to LONGEST. (calculate_mask): Expand parameter len to LONGEST. (mips_insert_watchpoint): Likewise. (mips_remove_watchpoint): Likewise. (mips_set_breakpoint): Likewise. (mips_clear_breakpoint): Likewise. * remote.c (remote_insert_watchpoint): Expand parameter len to LONGEST. Use int_string to format print len. (remote_remove_watchpoint): Likewise. (remote_region_ok_for_hw_watchpoint): Expand parameter len to LONGEST. * rl78-tdep.c (rl78_push_dummy_call): Expand len, container_len to LONGEST. * rs6000-aix-tdep.c (rs6000_push_dummy_call): Expand len to LONGEST. (ran_out_of_registers_for_arguments): Expand space, jj to LONGEST. * rx-tdep.c (rx_return_value): Use valtype_len instead of repeated TYPE_LENGTH. * s390-nat.c (s390_insert_watchpoint): Expand parameter len to LONGEST. (s390_remove_watchpoint): Likewise. (s390_region_ok_for_hw_watchpoint): Likewise. * s390-tdep.c (s390_value_from_register): Expand len to LONGEST. (s390_function_arg_pass_by_reference): Eliminate single-use variable length. (s390_function_arg_float): Likewise. (s390_push_dummy_call): Likewise. Expand length to ULONGEST. (s390_frame_align): Eliminate single-us variable length. (s390_return_value_convention): Eliminate single-us variable length. (s390_return_value): Expand length to LONGEST. * score-tdep.c (score_push_dummy_call): Expand arglen to LONGEST. * sh-tdep.c (sh_extract_return_value_nofpu): Expand len to LONGEST. (sh_store_return_value_nofpu): Likewise. * sh64-tdep.c (sh64_push_dummy_call): Expand stack_offset, stack_alloc, len to LONGEST. (sh64_extract_return_value): Expand len to LONGEST. (sh64_store_return_value): Likewise. * sparc-tdep.c (sparc32_store_arguments): Likewise. * sparc64-tdep.c (sparc64_store_floating_fields): Expand parameter bitpos to LONGEST. Expand subpos to LONGEST. (sparc64_extract_floating_fields): Likewise. (sparc64_store_arguments): Expand len to LONGEST. * spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Expand parameter len to LONGEST. * spu-tdep.c (spu_value_from_register): Expand len to LONGEST. * stack.c (read_frame_arg): Expand len, len_deref to ULONGEST. (print_frame_args): Expand current_offset, arg_size to LONGEST. * symmisc.c (print_symbol): Expand i to ULONGEST. Use pulongest to format print TYPE_LENGTH. * target.c (default_region_ok_for_hw_watchpoint): Expand parameter len to LONGEST. (debug_to_insert_watchpoint): Likewise. (debug_to_remove_watchpoint): Likewise. (debug_to_region_ok_for_hw_watchpoint): Likewise. (debug_to_can_accel_watchpoint_condition): Likewise. (update_current_target): Adjust function signatures for to_insert_watchpoint, to_remove_watchpoint and to_can_accel_watchpoint_condition. * target.h (struct target_ops): Expand parameter len to LONGEST for to_remove_watchpoint, to_insert_watchpoint, to_region_ok_for_hw_watchpoint and to_can_accel_watchpoint_condition. * tracepoint.c (collect_symbol): Expand len to ULONGEST. Use pulongest to format print len. (encode_actions_1): Make addr as CORE_ADDR. Expand len to ULONGEST. (scope_info): Expand j to LONGEST. Use pulongest to format print TYPE_LENGTH. * typeprint.c (whatis_exp): Expand top to LONGEST. * v850-tdep.c (v850_push_dummy_call): Expand len to LONGEST. (v850_extract_return_value): Likewise. (v850_store_return_value): Likewise. * valarith.c (value_subscripted_rvalue): Expand elt_size, elt_offs to ULONGEST. (value_logical_not): Expand len to LONGEST. (value_strcmp): Expand len1, len2 to LONGEST. * valops.c (value_allocate_space_in_inferior): Expand parameter len to LONGEST. (value_cast_structs): Expand top to LONGEST. (value_cast): Expand element_length to ULONGEST. Expand val_length to LONGEST. (dynamic_cast_check_1): Expand parameter embedded_offset to LONGEST. Expand offset to LONGEST. (dynamic_cast_check_2): Likewise. (value_dynamic_cast): Expand top to LONGEST. (value_fetch_lazy): Expand length to LONGEST. (value_assign): Expand changed_len, offset to LONGEST. (value_array): Expand typelength to ULONGEST. (do_search_struct_field): Expand parameter offset to LONGEST. Expand new_offset, boffset to LONGEST. (search_struct_field): Expand parameter offset to LONGEST. (search_struct_method): Likewise. Expand base_offset, this_offset to LONGEST. (find_method_list): Expand parameter offset to LONGEST, parameter boffset to point to LONGEST. Expand base_offset to LONGEST. (value_find_oload_method_list): Expand parameter boffset to point to LONGEST. (find_overload_match): Expand boffset to LONGEST. (value_struct_elt_for_reference): Expand parameter offset to LONGEST. Remove unneeded cast. Expand base_offset to LONGEST. (value_rtti_indirect_type): Expand parameter top to point to LONGEST. (value_full_object): Expand parameter xtop to LONGEST. Expand top to LONGEST. * valprint.c (valprint_check_validity): Expand parameter embedded_offset to LONGEST. (generic_val_print): Likewise. (val_print): Likewise. (val_print_scalar_formatted): Likewise. (print_hex_chars): Expand parameter len to ULONGEST. (val_print_array_elements): Expand parameter embedded_offset to LONGEST. Expand len, eltlen to ULONGEST. (generic_printstr): Expand parameter length to ULONGEST. * valprint.h (val_print_array_elements): Expand parameter embedded_offset to LONGEST. (val_print_scalar_formatted): Likewise. (print_hex_chars): Expand parameter len to ULONGEST. (generic_val_print): Expand parameter embedded_offset to LONGEST. (generic_printstr): Expand parameter length to ULONGEST. * value.c (struct range): Expand members offset, length to LONGEST. (ranges_overlap): Expand parameters offset1, offset2, len1 and len2 to LONGEST. (range_contain): Expand parameter offset, length to LONGEST. (struct value): Expand members offset, embedded_offset, pointed_to_offset to LONGEST. (value_bytes_available): Expand parameters offset, length to LONGEST. (mark_value_bytes_unavailable): Likewise. (find_first_range_overlap): Likewise. (value_available_contents_eq): Expand parameters offset1, offset2 and length to LONGEST. (value_offset): Return LONGEST. (set_value_offset): Expand parameter offset to LONGEST. (value_contents_copy_raw): Expand parameters src_offset, dst_offset, length to LONGEST. (value_contents_copy): Likewise. (value_contents_equal): Expand len to LONGEST. (value_bits_valid): Expand parameters offset, length to LONGEST. (value_bits_synthetic_pointer): Likewise. (value_embedded_offset): Return LONGEST. (set_value_embedded_offset): Expand parameter val to LONGEST. (value_pointed_to_offset): Return LONGEST. (set_value_pointed_to_offset): Expand parameter val to LONGEST. (set_internalvar_component): Expand parameter offset to LONGEST. (value_primitive_field): Likewise. Expand bitpos, boffset, container_bitpos to LONGEST. (value_fn_field): Expand parameter offset to LONGEST. (unpack_value_bits_as_long_1): Expand parameters embedded_offset, bitpos to LONGEST. Expand read_offset to LONGEST. (unpack_value_bits_as_long): Expand parameter embeded_offset to LONGEST. (unpack_value_field_as_long_1): Likewise. Expand bitpos to LONGEST. (unpack_value_field_as_long): Expand parameter embedded_offset to LONGEST. (value_field_bitfield): Likewise. (modify_field): Expand parameter bitpos to LONGEST. Expand bytesize to LONGEST. * value.h (value_offset): Return LONGEST. (set_value_offset): Expand parameter offset to LONGEST. (value_pointed_to_offset): Return LONGEST. (set_value_pointed_to_offset): Expand parameter val to LONGEST. (value_embedded_offset): Return LONGEST. (set_value_embedded_offset): Expand parameter val to LONGEST. (struct lval_funcs): Expand parameters offset and length to LONGEST for check_validity. Likewise for check_synthetic_pointer. (valprint_check_validity): Expand parameter embedded_offset to LONGEST. (value_bits_valid): Expand parameters offset, length to LONGEST. (value_bits_synthetic_pointer): Likewise. (value_bytes_available): Likewise. (mark_value_bytes_unavailable): Likewise. (value_available_contents_eq): Expand parameters offset1, offset2, length to LONGEST. (unpack_value_bits_as_long): Expand parameter embeded_offset to LONGEST. (unpack_value_field_as_long): Likewise. (value_field_bitfield): Likewise. (value_contents_copy_raw): Expand parameters src_offset, dst_offset, length to LONGEST. (value_contents_copy): Likewise. (value_find_oload_method_list): Expand parameter boffset to point to LONGEST. (value_primitive_field): Expand parameter offset to LONGEST. (value_rtti_indirect_type): Expand parameter top to point to LONGEST. (value_full_object): Expand parameter xtop to LONGEST. (set_internalvar_component): Expand parameter offset to LONGEST. (value_fn_field): Expand parameter offset to LONGEST. (modify_field): Expand parameter bitpos to LONGEST. (val_print): Expand parameter embedded_offset to LONGEST. (value_allocate_space_in_inferior): Expand parameter len to LONGEST. * vax-tdep.c (vax_store_arguments): Expand count, len to LONGEST. (vax_return_value): Expand len to LONGEST. * xstormy16-tdep.c (xstormy16_extract_return_value): Expand len, i to LONGEST. (xstormy16_store_return_value): Likewise. (xstormy16_push_dummy_call): Expand j, typelen to LONGEST. * xtensa-tdep.c (xtensa_extract_return_value): Expand len to LONGEST. Use plongest to format print len. (xtensa_store_return_value): Expand len to LONGEST. Use pulongest to print TYPE_LENGTH. (struct argument_info): Expoand member length to LONGEST. (struct argument_info.u): Expand member offset to LONGEST. (xtensa_push_dummy_call): Expand size and onstack_size to LONGEST. Use int_string to format print TYPE_LENGTH. gdb/testsuite/ChangeLog: 2012-05-31 Siddhesh Poyarekar <siddhesh@redhat.com> * gdb.base/structs-longest-bitpos.c: New test case. * gdb.base/structs-longest-bitpos.exp: New test case. gdb/doc/ChangeLog: 2012-05-31 Siddhesh Poyarekar <siddhesh@redhat.com> * observer.texi (memory_changed): Expand parameter len to LONGEST. [-- Attachment #3: gdb-bitpos.patch --] [-- Type: text/x-patch, Size: 224729 bytes --] diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index af0fdb5..f67a929 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -80,7 +80,7 @@ static struct type *desc_bounds_type (struct type *); static struct value *desc_bounds (struct value *); -static int fat_pntr_bounds_bitpos (struct type *); +static LONGEST fat_pntr_bounds_bitpos (struct type *); static int fat_pntr_bounds_bitsize (struct type *); @@ -88,13 +88,13 @@ static struct type *desc_data_target_type (struct type *); static struct value *desc_data (struct value *); -static int fat_pntr_data_bitpos (struct type *); +static LONGEST fat_pntr_data_bitpos (struct type *); static int fat_pntr_data_bitsize (struct type *); static struct value *desc_one_bound (struct value *, int, int); -static int desc_bound_bitpos (struct type *, int, int); +static LONGEST desc_bound_bitpos (struct type *, int, int); static int desc_bound_bitsize (struct type *, int, int); @@ -174,7 +174,7 @@ static struct type *static_unwrap_type (struct type *type); static struct value *unwrap_value (struct value *); -static struct type *constrained_packed_array_type (struct type *, long *); +static struct type *constrained_packed_array_type (struct type *, LONGEST *); static struct type *decode_constrained_packed_array_type (struct type *); @@ -189,7 +189,8 @@ static int ada_is_unconstrained_packed_array_type (struct type *); static struct value *value_subscript_packed (struct value *, int, struct value **); -static void move_bits (gdb_byte *, int, const gdb_byte *, int, int, int); +static void move_bits (gdb_byte *, int, const gdb_byte *, LONGEST, LONGEST, + int); static struct value *coerce_unspec_val_to_type (struct value *, struct type *); @@ -217,14 +218,14 @@ static struct value *value_val_atr (struct type *, struct value *); static struct symbol *standard_lookup (const char *, const struct block *, domain_enum); -static struct value *ada_search_struct_field (char *, struct value *, int, +static struct value *ada_search_struct_field (char *, struct value *, LONGEST, struct type *); -static struct value *ada_value_primitive_field (struct value *, int, int, +static struct value *ada_value_primitive_field (struct value *, LONGEST, int, struct type *); -static int find_struct_field (const char *, struct type *, int, - struct type **, int *, int *, int *, int *); +static int find_struct_field (const char *, struct type *, LONGEST, + struct type **, LONGEST *, int *, int *, int *); static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR, struct value *); @@ -240,7 +241,7 @@ static void ada_language_arch_info (struct gdbarch *, static void check_size (const struct type *); -static struct value *ada_index_struct_field (int, struct value *, int, +static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST, struct type *); static struct value *assign_aggregate (struct value *, struct value *, @@ -586,7 +587,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) } static const gdb_byte * -cond_offset_host (const gdb_byte *valaddr, long offset) +cond_offset_host (const gdb_byte *valaddr, LONGEST offset) { if (valaddr == NULL) return NULL; @@ -595,7 +596,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) } static CORE_ADDR -cond_offset_target (CORE_ADDR address, long offset) +cond_offset_target (CORE_ADDR address, LONGEST offset) { if (address == 0) return 0; @@ -1601,7 +1602,7 @@ desc_bounds (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the bounds data. */ -static int +static LONGEST fat_pntr_bounds_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 1); @@ -1667,7 +1668,7 @@ desc_data (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the data. */ -static int +static LONGEST fat_pntr_data_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 0); @@ -1702,7 +1703,7 @@ desc_one_bound (struct value *bounds, int i, int which) of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper bound, if WHICH is 1. The first bound is I=1. */ -static int +static LONGEST desc_bound_bitpos (struct type *type, int i, int which) { return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); @@ -1892,7 +1893,7 @@ ada_type_of_array (struct value *arr, int bounds) zero, and does not need to be recomputed. */ if (lo < hi) { - int array_bitsize = + LONGEST array_bitsize = (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; @@ -2044,7 +2045,7 @@ decode_packed_array_bitsize (struct type *type) in bits. */ static struct type * -constrained_packed_array_type (struct type *type, long *elt_bits) +constrained_packed_array_type (struct type *type, LONGEST *elt_bits) { struct type *new_elt_type; struct type *new_type; @@ -2096,7 +2097,7 @@ decode_constrained_packed_array_type (struct type *type) char *name; const char *tail; struct type *shadow_type; - long bits; + LONGEST bits; if (!raw_name) raw_name = ada_type_name (desc_base_type (type)); @@ -2167,7 +2168,8 @@ decode_constrained_packed_array (struct value *arr) array with no wrapper. In order to interpret the value through the (left-justified) packed array type we just built, we must first left-justify it. */ - int bit_size, bit_pos; + int bit_size; + LONGEST bit_pos; ULONGEST mod; mod = ada_modulus (value_type (arr)) - 1; @@ -2268,15 +2270,16 @@ has_negatives (struct type *type) struct value * ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, - long offset, int bit_offset, int bit_size, + LONGEST offset, int bit_offset, int bit_size, struct type *type) { struct value *v; - int src, /* Index into the source area */ - targ, /* Index into the target area */ - srcBitsLeft, /* Number of source bits left to move */ - nsrc, ntarg, /* Number of source and target bytes */ - unusedLS, /* Number of bits in next significant + int src; /* Index into the source area */ + LONGEST targ; /* Index into the target area */ + int srcBitsLeft, /* Number of source bits left to move */ + nsrc; /* Number of source bytes */ + LONGEST ntarg; /* Number of target bytes */ + int unusedLS, /* Number of bits in next significant byte of source that are unused */ accumSize; /* Number of meaningful bits in accum */ unsigned char *bytes; /* First byte containing data to unpack */ @@ -2426,7 +2429,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, not overlap. */ static void move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source, - int src_offset, int n, int bits_big_endian_p) + LONGEST src_offset, LONGEST n, int bits_big_endian_p) { unsigned int accum, mask; int accum_bits, chunk_size; @@ -2516,7 +2519,7 @@ ada_value_assign (struct value *toval, struct value *fromval) { int len = (value_bitpos (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; - int from_size; + LONGEST from_size; char *buffer = (char *) alloca (len); struct value *val; CORE_ADDR to_addr = value_address (toval); @@ -2562,7 +2565,7 @@ value_assign_to_component (struct value *container, struct value *component, (LONGEST) (value_address (component) - value_address (container)); int bit_offset_in_container = value_bitpos (component) - value_bitpos (container); - int bits; + LONGEST bits; val = value_cast (value_type (component), val); @@ -4082,7 +4085,7 @@ ensure_lval (struct value *val) if (VALUE_LVAL (val) == not_lval || VALUE_LVAL (val) == lval_internalvar) { - int len = TYPE_LENGTH (ada_check_typedef (value_type (val))); + LONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val))); const CORE_ADDR addr = value_as_long (value_allocate_space_in_inferior (len)); @@ -4156,7 +4159,7 @@ static CORE_ADDR value_pointer (struct value *value, struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); - unsigned len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); gdb_byte *buf = alloca (len); CORE_ADDR addr; @@ -6043,7 +6046,7 @@ value_tag_from_contents_and_address (struct type *type, const gdb_byte *valaddr, CORE_ADDR address) { - int tag_byte_offset; + LONGEST tag_byte_offset; struct type *tag_type; if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, @@ -6426,7 +6429,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) only in that it can handle packed values of arbitrary type. */ static struct value * -ada_value_primitive_field (struct value *arg1, int offset, int fieldno, +ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type) { struct type *type; @@ -6438,7 +6441,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) { - int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); + LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); return ada_value_primitive_packed_val (arg1, value_contents (arg1), @@ -6465,9 +6468,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, Returns 1 if found, 0 otherwise. */ static int -find_struct_field (const char *name, struct type *type, int offset, +find_struct_field (const char *name, struct type *type, LONGEST offset, struct type **field_type_p, - int *byte_offset_p, int *bit_offset_p, int *bit_size_p, + LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p, int *index_p) { int i; @@ -6485,8 +6488,8 @@ find_struct_field (const char *name, struct type *type, int offset, for (i = 0; i < TYPE_NFIELDS (type); i += 1) { - int bit_pos = TYPE_FIELD_BITPOS (type, i); - int fld_offset = offset + bit_pos / 8; + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); + LONGEST fld_offset = offset + bit_pos / 8; const char *t_field_name = TYPE_FIELD_NAME (type, i); if (t_field_name == NULL) @@ -6556,7 +6559,7 @@ num_visible_fields (struct type *type) Searches recursively through wrapper fields (e.g., '_parent'). */ static struct value * -ada_search_struct_field (char *name, struct value *arg, int offset, +ada_search_struct_field (char *name, struct value *arg, LONGEST offset, struct type *type) { int i; @@ -6589,7 +6592,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset, int j; struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i)); - int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; + LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) { @@ -6607,8 +6610,8 @@ ada_search_struct_field (char *name, struct value *arg, int offset, return NULL; } -static struct value *ada_index_struct_field_1 (int *, struct value *, - int, struct type *); +static struct value *ada_index_struct_field_1 (LONGEST *, struct value *, + LONGEST, struct type *); /* Return field #INDEX in ARG, where the index is that returned by @@ -6617,7 +6620,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, * If found, return value, else return NULL. */ static struct value * -ada_index_struct_field (int index, struct value *arg, int offset, +ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset, struct type *type) { return ada_index_struct_field_1 (&index, arg, offset, type); @@ -6629,7 +6632,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, * *INDEX_P. */ static struct value * -ada_index_struct_field_1 (int *index_p, struct value *arg, int offset, +ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset, struct type *type) { int i; @@ -6719,7 +6722,8 @@ ada_value_struct_elt (struct value *arg, char *name, int no_err) v = ada_search_struct_field (name, arg, 0, t); else { - int bit_offset, bit_size, byte_offset; + int bit_offset, bit_size; + LONGEST byte_offset; struct type *field_type; CORE_ADDR address; @@ -7025,8 +7029,8 @@ ada_coerce_ref (struct value *val0) /* Return OFF rounded upward if necessary to a multiple of ALIGNMENT (a power of 2). */ -static unsigned int -align_value (unsigned int off, unsigned int alignment) +static ULONGEST +align_value (ULONGEST off, ULONGEST alignment) { return (off + alignment - 1) & ~(alignment - 1); } @@ -7405,10 +7409,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, struct value *mark = value_mark (); struct value *dval; struct type *rtype; - int nfields, bit_len; + int nfields; int variant_field; - long off; - int fld_bit_len; + LONGEST off, bit_len, fld_bit_len; int f; /* Compute the number of fields in this record type that are going @@ -7479,7 +7482,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, that follow this one. */ if (ada_is_aligner_type (field_type)) { - long field_offset = TYPE_FIELD_BITPOS (field_type, f); + LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f); field_valaddr = cond_offset_host (field_valaddr, field_offset); field_address = cond_offset_target (field_address, field_offset); @@ -7598,11 +7601,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, if (TYPE_LENGTH (type) <= 0) { if (TYPE_NAME (rtype)) - warning (_("Invalid type size for `%s' detected: %d."), - TYPE_NAME (rtype), TYPE_LENGTH (type)); + warning (_("Invalid type size for `%s' detected: %s."), + TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type))); else - warning (_("Invalid type size for <unnamed> detected: %d."), - TYPE_LENGTH (type)); + warning (_("Invalid type size for <unnamed> detected: %s."), + pulongest (TYPE_LENGTH (type))); } else { @@ -7939,7 +7942,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, type was a regular (non-packed) array type. As a result, the bitsize of the array elements needs to be set again, and the array length needs to be recomputed based on that bitsize. */ - int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result)); + LONGEST len = (TYPE_LENGTH (result) + / TYPE_LENGTH (TYPE_TARGET_TYPE (result))); int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0); TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0); diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index 9a93c50..3de0723 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -168,7 +168,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int, extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream); -extern void ada_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern void ada_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -183,7 +183,7 @@ extern void ada_emit_char (int, struct type *, struct ui_file *, int, int); extern void ada_printchar (int, struct type *, struct ui_file *); extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *, - unsigned int, const char *, int, + ULONGEST, const char *, int, const struct value_print_options *); struct value *ada_convert_actual (struct value *actual, @@ -257,7 +257,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); extern struct value *ada_value_primitive_packed_val (struct value *, const gdb_byte *, - long, int, int, + LONGEST, int, int, struct type *); extern struct type *ada_coerce_to_simple_array_type (struct type *); diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index 40f3058..10acc5e 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -815,8 +815,8 @@ ada_print_type (struct type *type0, const char *varstring, const char *name = ada_type_name (type); if (!ada_is_range_type_name (name)) - fprintf_filtered (stream, _("<%d-byte integer>"), - TYPE_LENGTH (type)); + fprintf_filtered (stream, _("<%s-byte integer>"), + pulongest (TYPE_LENGTH (type))); else { fprintf_filtered (stream, "range "); @@ -837,7 +837,8 @@ ada_print_type (struct type *type0, const char *varstring, } break; case TYPE_CODE_FLT: - fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type)); + fprintf_filtered (stream, _("<%s-byte float>"), + pulongest (TYPE_LENGTH (type))); break; case TYPE_CODE_ENUM: if (show < 0) diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 95ec7ec..0945478 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -42,15 +42,15 @@ static void print_record (struct type *, const gdb_byte *, int, const struct value_print_options *); static int print_field_values (struct type *, const gdb_byte *, - int, + LONGEST, struct ui_file *, int, const struct value *, const struct value_print_options *, - int, struct type *, int); + int, struct type *, LONGEST); static void adjust_type_signedness (struct type *); -static void ada_val_print_1 (struct type *, const gdb_byte *, int, CORE_ADDR, +static void ada_val_print_1 (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -144,7 +144,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, unsigned int things_printed = 0; unsigned len; struct type *elttype, *index_type; - unsigned eltlen; + ULONGEST eltlen; unsigned long bitsize = TYPE_FIELD_BITSIZE (type, 0); struct value *mark = value_mark (); LONGEST low = 0; @@ -293,7 +293,7 @@ ada_emit_char (int c, struct type *type, struct ui_file *stream, of a character. */ static int -char_at (const gdb_byte *string, int i, int type_len, +char_at (const gdb_byte *string, LONGEST i, int type_len, enum bfd_endian byte_order) { if (type_len == 1) @@ -465,7 +465,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) static void printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, - unsigned int length, int force_ellipses, int type_len, + ULONGEST length, int force_ellipses, int type_len, const struct value_print_options *options) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype)); @@ -556,7 +556,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, void ada_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { @@ -570,7 +570,7 @@ ada_printstr (struct ui_file *stream, struct type *type, void ada_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) @@ -602,8 +602,8 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); struct type *elttype = TYPE_TARGET_TYPE (type); - unsigned int eltlen; - unsigned int len; + ULONGEST eltlen; + ULONGEST len; /* We know that ELTTYPE cannot possibly be null, because we found that TYPE is a string-like type. Similarly, the size of ELTTYPE @@ -621,7 +621,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, elements up to it. */ if (options->stop_print_at_null) { - int temp_len; + LONGEST temp_len; /* Look for a NULL char. */ for (temp_len = 0; @@ -654,7 +654,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, static void ada_val_print_1 (struct type *type, const gdb_byte *valaddr, - int offset, CORE_ADDR address, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -730,7 +730,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, if (ada_is_fixed_point_type (type)) { LONGEST v = unpack_long (type, valaddr + offset_aligned); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); fprintf_filtered (stream, len < 4 ? "%.11g" : "%.17g", (double) ada_fixed_to_float (type, v)); @@ -924,12 +924,12 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, static int print_variant_part (struct type *type, int field_num, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int comma_needed, - struct type *outer_type, int outer_offset) + struct type *outer_type, LONGEST outer_offset) { struct type *var_type = TYPE_FIELD_TYPE (type, field_num); int which = ada_which_variant_applies (var_type, outer_type, @@ -1036,11 +1036,11 @@ print_record (struct type *type, const gdb_byte *valaddr, static int print_field_values (struct type *type, const gdb_byte *valaddr, - int offset, struct ui_file *stream, int recurse, + LONGEST offset, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int comma_needed, - struct type *outer_type, int outer_offset) + struct type *outer_type, LONGEST outer_offset) { int i, len; @@ -1121,7 +1121,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, } else { - int bit_pos = TYPE_FIELD_BITPOS (type, i); + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); int bit_size = TYPE_FIELD_BITSIZE (type, i); struct value_print_options opts; diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 5d3affa..9dd64fe 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -303,7 +303,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct alpha_arg { const gdb_byte *contents; - int len; + LONGEST len; int offset; }; struct alpha_arg *alpha_args @@ -424,7 +424,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { const gdb_byte *contents = m_arg->contents; int offset = m_arg->offset; - int len = m_arg->len; + LONGEST len = m_arg->len; /* Copy the bytes destined for registers into arg_reg_buffer. */ if (offset < sizeof(arg_reg_buffer)) @@ -475,7 +475,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int length = TYPE_LENGTH (valtype); + LONGEST length = TYPE_LENGTH (valtype); gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; ULONGEST l; @@ -544,7 +544,7 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache, const gdb_byte *valbuf) { struct gdbarch *gdbarch = get_regcache_arch (regcache); - int length = TYPE_LENGTH (valtype); + LONGEST length = TYPE_LENGTH (valtype); gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; ULONGEST l; diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index df91a51..2f786d7 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -445,7 +445,7 @@ amd64_non_pod_p (struct type *type) static void amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); /* 1. If the size of an object is larger than two eightbytes, or in C++, is a non-POD structure or union type, or contains @@ -484,10 +484,10 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int pos = TYPE_FIELD_BITPOS (type, i) / 64; + LONGEST pos = TYPE_FIELD_BITPOS (type, i) / 64; enum amd64_reg_class subclass[2]; - int bitsize = TYPE_FIELD_BITSIZE (type, i); - int endpos; + LONGEST bitsize = TYPE_FIELD_BITSIZE (type, i); + LONGEST endpos; if (bitsize == 0) bitsize = TYPE_LENGTH (subtype) * 8; @@ -551,7 +551,7 @@ void amd64_classify (struct type *type, enum amd64_reg_class class[2]) { enum type_code code = TYPE_CODE (type); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); class[0] = class[1] = AMD64_NO_CLASS; @@ -600,7 +600,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum amd64_reg_class class[2]; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM }; static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM }; int integer_reg = 0; @@ -729,8 +729,8 @@ amd64_push_arguments (struct regcache *regcache, int nargs, that register number (or a negative value otherwise). */ int *arg_addr_regno = alloca (nargs * sizeof (int)); int num_stack_args = 0; - int num_elements = 0; - int element = 0; + LONGEST num_elements = 0; + LONGEST element = 0; int integer_reg = 0; int sse_reg = 0; int i; @@ -744,7 +744,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); enum amd64_reg_class class[2]; int needed_integer_regs = 0; int needed_sse_regs = 0; @@ -838,7 +838,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, { struct type *type = value_type (stack_args[i]); const gdb_byte *valbuf = value_contents (stack_args[i]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); CORE_ADDR arg_addr = sp + element * 8; write_memory (arg_addr, valbuf, len); @@ -2578,7 +2578,7 @@ amd64_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc) CORE_ADDR jb_addr; struct gdbarch *gdbarch = get_frame_arch (frame); int jb_pc_offset = gdbarch_tdep (gdbarch)->jb_pc_offset; - int len = TYPE_LENGTH (builtin_type (gdbarch)->builtin_func_ptr); + LONGEST len = TYPE_LENGTH (builtin_type (gdbarch)->builtin_func_ptr); /* If JB_PC_OFFSET is -1, we have no way to find out where the longjmp will land. */ diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c index 4a40f47..e2ccdf9 100644 --- a/gdb/amd64-windows-tdep.c +++ b/gdb/amd64-windows-tdep.c @@ -77,7 +77,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regnum = -1; /* See if our value is returned through a register. If it is, then diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index f9f6ba5..b818f2c 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -920,7 +920,7 @@ arm_linux_get_hwbp_type (int rw) /* Initialize the hardware breakpoint structure P for a watchpoint at ADDR to LEN. The type of watchpoint is given in RW. */ static void -arm_linux_hw_watchpoint_initialize (CORE_ADDR addr, int len, int rw, +arm_linux_hw_watchpoint_initialize (CORE_ADDR addr, LONGEST len, int rw, struct arm_linux_hw_breakpoint *p) { const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap (); @@ -1067,7 +1067,7 @@ arm_linux_remove_hw_breakpoint (struct gdbarch *gdbarch, /* Are we able to use a hardware watchpoint for the LEN bytes starting at ADDR? */ static int -arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap (); CORE_ADDR max_wp_length, aligned_addr; @@ -1099,7 +1099,7 @@ arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) /* Insert a Hardware breakpoint. */ static int -arm_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +arm_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { struct lwp_info *lp; @@ -1117,7 +1117,7 @@ arm_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, /* Remove a hardware breakpoint. */ static int -arm_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw, +arm_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { struct lwp_info *lp; diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index df5dea7..52dfb25 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3574,7 +3574,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { - int len; + LONGEST len; struct type *arg_type; struct type *target_type; enum type_code typecode; @@ -8768,7 +8768,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs, /* If the type is a plain integer, then the access is straight-forward. Otherwise we have to play around a bit more. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; ULONGEST tmp; @@ -8790,7 +8790,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs, /* For a structure or union the behaviour is as if the value had been stored to word-aligned memory and then loaded into registers with 32-bit load instruction(s). */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; bfd_byte tmpbuf[INT_REGISTER_SIZE]; @@ -8971,7 +8971,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, /* Integral values greater than one word are stored in consecutive registers starting with r0. This will always be a multiple of the regiser size. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; while (len > 0) @@ -8987,7 +8987,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, /* For a structure or union the behaviour is as if the value had been stored to word-aligned memory and then loaded into registers with 32-bit load instruction(s). */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; bfd_byte tmpbuf[INT_REGISTER_SIZE]; diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 864d288..e138699 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -905,7 +905,7 @@ avr_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int i; + LONGEST i; /* Single byte are returned in r24. Otherwise, the MSB of the return value is always in r25, calculate which register holds the LSB. */ @@ -1176,7 +1176,8 @@ struct stack_item }; static struct stack_item * -push_stack_item (struct stack_item *prev, const bfd_byte *contents, int len) +push_stack_item (struct stack_item *prev, const bfd_byte *contents, + LONGEST len) { struct stack_item *si; si = xmalloc (sizeof (struct stack_item)); @@ -1265,12 +1266,12 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < nargs; i++) { - int last_regnum; + LONGEST last_regnum; int j; struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); const bfd_byte *contents = value_contents (arg); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); /* Calculate the potential last register needed. */ last_regnum = regnum - (len + (len & 1)); diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 1bf03df..53d2154 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -80,12 +80,12 @@ static void gen_traced_pop (struct gdbarch *, struct agent_expr *, static void gen_sign_extend (struct agent_expr *, struct type *); static void gen_extend (struct agent_expr *, struct type *); static void gen_fetch (struct agent_expr *, struct type *); -static void gen_left_shift (struct agent_expr *, int); +static void gen_left_shift (struct agent_expr *, LONGEST); static void gen_frame_args_address (struct gdbarch *, struct agent_expr *); static void gen_frame_locals_address (struct gdbarch *, struct agent_expr *); -static void gen_offset (struct agent_expr *ax, int offset); +static void gen_offset (struct agent_expr *ax, LONGEST offset); static void gen_sym_offset (struct agent_expr *, struct symbol *); static void gen_var_ref (struct gdbarch *, struct agent_expr *ax, struct axs_value *value, struct symbol *var); @@ -133,15 +133,16 @@ static void gen_deref (struct agent_expr *, struct axs_value *); static void gen_address_of (struct agent_expr *, struct axs_value *); static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - struct type *type, int start, int end); + struct type *type, LONGEST start, LONGEST end); static void gen_primitive_field (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - int offset, int fieldno, struct type *type); + LONGEST offset, int fieldno, + struct type *type); static int gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - char *field, int offset, + char *field, LONGEST offset, struct type *type); static void gen_struct_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -363,7 +364,7 @@ gen_trace_static_fields (struct gdbarch *gdbarch, { case axs_lvalue_memory: { - int length = TYPE_LENGTH (check_typedef (value.type)); + LONGEST length = TYPE_LENGTH (check_typedef (value.type)); ax_const_l (ax, length); ax_simple (ax, aop_trace); @@ -421,7 +422,7 @@ gen_traced_pop (struct gdbarch *gdbarch, case axs_lvalue_memory: { - int length = TYPE_LENGTH (check_typedef (value->type)); + LONGEST length = TYPE_LENGTH (check_typedef (value->type)); if (string_trace) ax_simple (ax, aop_dup); @@ -565,7 +566,7 @@ gen_fetch (struct agent_expr *ax, struct type *type) right shift it by -DISTANCE bits if DISTANCE < 0. This generates unsigned (logical) right shifts. */ static void -gen_left_shift (struct agent_expr *ax, int distance) +gen_left_shift (struct agent_expr *ax, LONGEST distance) { if (distance > 0) { @@ -619,7 +620,7 @@ gen_frame_locals_address (struct gdbarch *gdbarch, struct agent_expr *ax) programming in ML, it would be clearer why these are the same thing. */ static void -gen_offset (struct agent_expr *ax, int offset) +gen_offset (struct agent_expr *ax, LONGEST offset) { /* It would suffice to simply push the offset and add it, but this makes it easier to read positive and negative offsets in the @@ -1275,7 +1276,7 @@ gen_address_of (struct agent_expr *ax, struct axs_value *value) static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *type, - int start, int end) + LONGEST start, LONGEST end) { /* Note that ops[i] fetches 8 << i bits. */ static enum agent_op ops[] @@ -1310,13 +1311,13 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, /* The first and one-after-last bits in the field, but rounded down and up to byte boundaries. */ - int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; - int bound_end = (((end + TARGET_CHAR_BIT - 1) - / TARGET_CHAR_BIT) - * TARGET_CHAR_BIT); + LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; + LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1) + / TARGET_CHAR_BIT) + * TARGET_CHAR_BIT); /* current bit offset within the structure */ - int offset; + LONGEST offset; /* The index in ops of the opcode we're considering. */ int op; @@ -1435,7 +1436,7 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, static void gen_primitive_field (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - int offset, int fieldno, struct type *type) + LONGEST offset, int fieldno, struct type *type) { /* Is this a bitfield? */ if (TYPE_FIELD_PACKED (type, fieldno)) @@ -1460,7 +1461,7 @@ gen_primitive_field (struct expression *exp, static int gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - char *field, int offset, struct type *type) + char *field, LONGEST offset, struct type *type) { int i, rslt; int nbases = TYPE_N_BASECLASSES (type); diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c index fb2ead0..77c22e2 100644 --- a/gdb/bfin-tdep.c +++ b/gdb/bfin-tdep.c @@ -506,14 +506,14 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, char buf[4]; int i; long reg_r0, reg_r1, reg_r2; - int total_len = 0; + LONGEST total_len = 0; enum bfin_abi abi = bfin_abi (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); - int len = TYPE_LENGTH (value_type); + LONGEST len = TYPE_LENGTH (value_type); total_len += (len + 3) & ~3; } @@ -531,8 +531,8 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, { struct type *value_type = value_enclosing_type (args[i]); struct type *arg_type = check_typedef (value_type); - int len = TYPE_LENGTH (value_type); - int container_len = (len + 3) & ~3; + LONGEST len = TYPE_LENGTH (value_type); + LONGEST container_len = (len + 3) & ~3; sp -= container_len; write_memory (sp, value_contents_writeable (args[i]), container_len); @@ -613,7 +613,7 @@ bfin_extract_return_value (struct type *type, struct gdbarch *gdbarch = get_regcache_arch (regs); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); ULONGEST tmp; int regno = BFIN_R0_REGNUM; @@ -642,7 +642,7 @@ bfin_store_return_value (struct type *type, registers starting with R0. This will always be a multiple of the register size. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = BFIN_R0_REGNUM; gdb_assert (len <= 8); diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index a867b10..e8df2ac 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1750,7 +1750,8 @@ update_watchpoint (struct watchpoint *b, int reparse) && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR addr; - int len, type; + LONGEST len; + int type; struct bp_location *loc, **tmp; addr = value_address (v); @@ -10685,7 +10686,7 @@ can_use_hardware_watchpoint (struct value *v) && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR vaddr = value_address (v); - int len; + LONGEST len; int num_regs; len = (target_exact_watchpoints @@ -14296,7 +14297,7 @@ show_breakpoint_cmd (char *args, int from_tty) GDB itself. */ static void -invalidate_bp_value_on_memory_change (CORE_ADDR addr, int len, +invalidate_bp_value_on_memory_change (CORE_ADDR addr, LONGEST len, const bfd_byte *data) { struct breakpoint *bp; diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index a957b6f..aebf507 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -407,7 +407,7 @@ struct bp_location /* For hardware watchpoints, the size of the memory region being watched. For hardware ranged breakpoints, the size of the breakpoint range. */ - int length; + LONGEST length; /* Type of hardware watchpoint. */ enum target_hw_bp_type watchpoint_type; diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 28dce8d..303cf4d 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -189,7 +189,7 @@ c_printchar (int c, struct type *type, struct ui_file *stream) void c_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *user_encoding, int force_ellipses, const struct value_print_options *options) { @@ -679,7 +679,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, } else { - int i; + LONGEST i; /* Write the terminating character. */ for (i = 0; i < TYPE_LENGTH (type); ++i) @@ -688,7 +688,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, if (satisfy_expected) { LONGEST low_bound, high_bound; - int element_size = TYPE_LENGTH (type); + LONGEST element_size = TYPE_LENGTH (type); if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type), &low_bound, &high_bound) < 0) diff --git a/gdb/c-lang.h b/gdb/c-lang.h index 5cbe34d..c02b8f4 100644 --- a/gdb/c-lang.h +++ b/gdb/c-lang.h @@ -72,7 +72,7 @@ extern void c_print_typedef (struct type *, struct ui_file *); extern void c_val_print (struct type *, const gdb_byte *, - int, CORE_ADDR, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -92,7 +92,7 @@ extern void c_printchar (int, struct type *, struct ui_file *); extern void c_printstr (struct ui_file * stream, struct type *elttype, const gdb_byte *string, - unsigned int length, + ULONGEST length, const char *user_encoding, int force_ellipses, const struct value_print_options *options); @@ -118,14 +118,14 @@ extern void cp_print_class_member (const gdb_byte *, struct type *, struct ui_file *, char *); extern void cp_print_value_fields (struct type *, struct type *, - const gdb_byte *, int, CORE_ADDR, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, struct type **, int); extern void cp_print_value_fields_rtti (struct type *, - const gdb_byte *, int, CORE_ADDR, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index a5892b5..7acbb8b 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -625,8 +625,8 @@ c_type_print_varspec_suffix (struct type *type, fprintf_filtered (stream, "["); if (get_array_bounds (type, &low_bound, &high_bound)) - fprintf_filtered (stream, "%d", - (int) (high_bound - low_bound + 1)); + fprintf_filtered (stream, "%s", + plongest (high_bound - low_bound + 1)); fprintf_filtered (stream, "]"); c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 7a1bb02..2de41d7 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -133,7 +133,7 @@ static const struct generic_val_print_decorations c_decorations = void c_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -144,7 +144,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, unsigned len; struct type *elttype, *unresolved_elttype; struct type *unresolved_type = type; - unsigned eltlen; + ULONGEST eltlen; CORE_ADDR addr; CHECK_TYPEDEF (type); @@ -364,9 +364,9 @@ c_val_print (struct type *type, const gdb_byte *valaddr, /* Print vtable entry - we only get here if NOT using -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ - int offset = (embedded_offset - + TYPE_FIELD_BITPOS (type, - VTBL_FNADDR_OFFSET) / 8); + LONGEST offset = (embedded_offset + + TYPE_FIELD_BITPOS (type, + VTBL_FNADDR_OFFSET) / 8); struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET); CORE_ADDR addr @@ -445,7 +445,8 @@ c_value_print (struct value *val, struct ui_file *stream, const struct value_print_options *options) { struct type *type, *real_type, *val_type; - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct value_print_options opts = *options; opts.deref_ref = 1; diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c index 16b5356..03f4baf 100644 --- a/gdb/cp-abi.c +++ b/gdb/cp-abi.c @@ -68,13 +68,13 @@ is_operator_name (const char *name) return (*current_cp_abi.is_operator_name) (name); } -int +LONGEST baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { volatile struct gdb_exception ex; - int res = 0; + LONGEST res = 0; gdb_assert (current_cp_abi.baseclass_offset != NULL); @@ -98,7 +98,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, struct value * value_virtual_fn_field (struct value **arg1p, struct fn_field *f, int j, - struct type *type, int offset) + struct type *type, LONGEST offset) { if ((current_cp_abi.virtual_fn_field) == NULL) return NULL; @@ -108,7 +108,7 @@ value_virtual_fn_field (struct value **arg1p, struct type * value_rtti_type (struct value *v, int *full, - int *top, int *using_enc) + LONGEST *top, int *using_enc) { struct type *ret = NULL; volatile struct gdb_exception e; diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h index 8451450..a34e9fe 100644 --- a/gdb/cp-abi.h +++ b/gdb/cp-abi.h @@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, struct fn_field *f, int j, struct type *type, - int offset); + LONGEST offset); /* Try to find the run-time type of VALUE, using C++ run-time type @@ -135,7 +135,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, FULL, TOP, and USING_ENC can each be zero, in which case we don't provide the corresponding piece of information. */ extern struct type *value_rtti_type (struct value *value, - int *full, int *top, + int *full, LONGEST *top, int *using_enc); /* Compute the offset of the baseclass which is the INDEXth baseclass @@ -144,11 +144,11 @@ extern struct type *value_rtti_type (struct value *value, contents of VAL. The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. */ -extern int baseclass_offset (struct type *type, - int index, const gdb_byte *valaddr, - int embedded_offset, - CORE_ADDR address, - const struct value *val); +extern LONGEST baseclass_offset (struct type *type, + int index, const gdb_byte *valaddr, + LONGEST embedded_offset, + CORE_ADDR address, + const struct value *val); /* Describe the target of a pointer to method. CONTENTS is the byte pattern representing the pointer to method. TYPE is the pointer to @@ -204,12 +204,13 @@ struct cp_abi_ops struct value *(*virtual_fn_field) (struct value **arg1p, struct fn_field * f, int j, struct type * type, - int offset); + LONGEST offset); struct type *(*rtti_type) (struct value *v, int *full, - int *top, int *using_enc); - int (*baseclass_offset) (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, - CORE_ADDR address, const struct value *val); + LONGEST *top, int *using_enc); + LONGEST (*baseclass_offset) (struct type *type, int index, + const bfd_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + const struct value *val); void (*print_method_ptr) (const gdb_byte *contents, struct type *type, struct ui_file *stream); diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 2e3beea..5aba016 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -82,7 +82,7 @@ static void cp_print_static_field (struct type *, struct value *, const struct value_print_options *); static void cp_print_value (struct type *, struct type *, - const gdb_byte *, int, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -156,7 +156,7 @@ cp_is_vtbl_member (struct type *type) void cp_print_value_fields (struct type *type, struct type *real_type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -443,7 +443,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, void cp_print_value_fields_rtti (struct type *type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -459,7 +459,8 @@ cp_print_value_fields_rtti (struct type *type, TARGET_CHAR_BIT * TYPE_LENGTH (type))) { struct value *value; - int full, top, using_enc; + int full, using_enc; + LONGEST top; /* Ugh, we have to convert back to a value here. */ value = value_from_contents_and_address (type, valaddr + offset, @@ -483,7 +484,7 @@ cp_print_value_fields_rtti (struct type *type, static void cp_print_value (struct type *type, struct type *real_type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -493,7 +494,7 @@ cp_print_value (struct type *type, struct type *real_type, = (struct type **) obstack_next_free (&dont_print_vb_obstack); struct obstack tmp_obstack = dont_print_vb_obstack; int i, n_baseclasses = TYPE_N_BASECLASSES (type); - int thisoffset; + LONGEST thisoffset; struct type *thistype; if (dont_print_vb == 0) @@ -507,7 +508,7 @@ cp_print_value (struct type *type, struct type *real_type, for (i = 0; i < n_baseclasses; i++) { - int boffset = 0; + LONGEST boffset = 0; int skip; struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); const char *basename = TYPE_NAME (baseclass); diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 6739037..b011ec8 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -676,7 +676,7 @@ struct stack_item }; static struct stack_item * -push_stack_item (struct stack_item *prev, void *contents, int len) +push_stack_item (struct stack_item *prev, void *contents, LONGEST len) { struct stack_item *si; si = xmalloc (sizeof (struct stack_item)); @@ -849,10 +849,10 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { - int len; + LONGEST len; char *val; - int reg_demand; - int i; + LONGEST reg_demand; + LONGEST i; len = TYPE_LENGTH (value_type (args[argnum])); val = (char *) value_contents (args[argnum]); @@ -1662,7 +1662,7 @@ cris_store_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { @@ -1833,7 +1833,7 @@ cris_extract_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { diff --git a/gdb/d-lang.h b/gdb/d-lang.h index f93405a..84b149f 100644 --- a/gdb/d-lang.h +++ b/gdb/d-lang.h @@ -25,7 +25,7 @@ extern char *d_demangle (const char *mangled, int options); extern void d_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c index 3a8d11d..5d066e7 100644 --- a/gdb/d-valprint.c +++ b/gdb/d-valprint.c @@ -29,7 +29,7 @@ static int dynamic_array_type (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) @@ -71,9 +71,9 @@ dynamic_array_type (struct type *type, const gdb_byte *valaddr, /* Implements the la_val_print routine for language D. */ void -d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, - const struct value *val, +d_val_print (struct type *type, const gdb_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) { int ret; diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi index 6827ed8..6370d92 100644 --- a/gdb/doc/observer.texi +++ b/gdb/doc/observer.texi @@ -216,7 +216,7 @@ The inferior @var{inf} has been removed from the list of inferiors. This method is called immediately before freeing @var{inf}. @end deftypefun -@deftypefun void memory_changed (CORE_ADDR @var{addr}, int @var{len}, const bfd_byte *@var{data}) +@deftypefun void memory_changed (CORE_ADDR @var{addr}, LONGEST @var{len}, const bfd_byte *@var{data}) Bytes from @var{data} to @var{data} + @var{len} have been written to the current inferior at @var{addr}. @end deftypefun diff --git a/gdb/doublest.c b/gdb/doublest.c index c8c9e05..e67158e 100644 --- a/gdb/doublest.c +++ b/gdb/doublest.c @@ -770,7 +770,7 @@ floatformat_from_doublest (const struct floatformat *fmt, but not passed on by GDB. This should be fixed. */ static const struct floatformat * -floatformat_from_length (struct gdbarch *gdbarch, int len) +floatformat_from_length (struct gdbarch *gdbarch, LONGEST len) { const struct floatformat *format; @@ -798,8 +798,8 @@ floatformat_from_length (struct gdbarch *gdbarch, int len) else format = NULL; if (format == NULL) - error (_("Unrecognized %d-bit floating-point type."), - len * TARGET_CHAR_BIT); + error (_("Unrecognized %s-bit floating-point type."), + plongest (len * TARGET_CHAR_BIT)); return format; } diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 8c97f19..f01ce03 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -1446,19 +1446,19 @@ insert_bits (unsigned int datum, BITS_BIG_ENDIAN is taken directly from gdbarch. */ static void -copy_bitwise (gdb_byte *dest, unsigned int dest_offset_bits, - const gdb_byte *source, unsigned int source_offset_bits, - unsigned int bit_count, +copy_bitwise (gdb_byte *dest, ULONGEST dest_offset_bits, + const gdb_byte *source, ULONGEST source_offset, + ULONGEST bit_count, int bits_big_endian) { - unsigned int dest_avail; + unsigned int dest_avail, source_offset_bits; int datum; /* Reduce everything to byte-size pieces. */ dest += dest_offset_bits / 8; dest_offset_bits %= 8; - source += source_offset_bits / 8; - source_offset_bits %= 8; + source += source_offset / 8; + source_offset_bits = source_offset % 8; dest_avail = 8 - dest_offset_bits % 8; @@ -1496,13 +1496,13 @@ static void read_pieced_value (struct value *v) { int i; - long offset = 0; + LONGEST offset = 0; ULONGEST bits_to_skip; gdb_byte *contents; struct piece_closure *c = (struct piece_closure *) value_computed_closure (v); struct frame_info *frame = frame_find_by_id (VALUE_FRAME_ID (v)); - size_t type_len; + ULONGEST type_len; size_t buffer_size = 0; char *buffer = NULL; struct cleanup *cleanup; @@ -1529,8 +1529,8 @@ read_pieced_value (struct value *v) for (i = 0; i < c->n_pieces && offset < type_len; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size, this_size_bits; - long dest_offset_bits, source_offset_bits, source_offset; + ULONGEST this_size, this_size_bits; + LONGEST dest_offset_bits, source_offset_bits, source_offset; const gdb_byte *intermediate_buffer; /* Compute size, source, and destination offsets for copying, in @@ -1685,7 +1685,7 @@ write_pieced_value (struct value *to, struct value *from) struct piece_closure *c = (struct piece_closure *) value_computed_closure (to); struct frame_info *frame = frame_find_by_id (VALUE_FRAME_ID (to)); - size_t type_len; + ULONGEST type_len; size_t buffer_size = 0; char *buffer = NULL; struct cleanup *cleanup; @@ -1713,8 +1713,8 @@ write_pieced_value (struct value *to, struct value *from) for (i = 0; i < c->n_pieces && offset < type_len; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size_bits, this_size; - long dest_offset_bits, source_offset_bits, dest_offset, source_offset; + ULONGEST this_size_bits, this_size; + LONGEST dest_offset_bits, source_offset_bits, dest_offset, source_offset; int need_bitwise; const gdb_byte *source_buffer; @@ -1843,8 +1843,8 @@ write_pieced_value (struct value *to, struct value *from) implicit pointer. */ static int -check_pieced_value_bits (const struct value *value, int bit_offset, - int bit_length, +check_pieced_value_bits (const struct value *value, LONGEST bit_offset, + LONGEST bit_length, enum dwarf_value_location check_for) { struct piece_closure *c @@ -1898,8 +1898,8 @@ check_pieced_value_bits (const struct value *value, int bit_offset, } static int -check_pieced_value_validity (const struct value *value, int bit_offset, - int bit_length) +check_pieced_value_validity (const struct value *value, LONGEST bit_offset, + LONGEST bit_length) { return check_pieced_value_bits (value, bit_offset, bit_length, DWARF_VALUE_MEMORY); @@ -1917,8 +1917,8 @@ check_pieced_value_invalid (const struct value *value) a synthetic pointer. */ static int -check_pieced_synthetic_pointer (const struct value *value, int bit_offset, - int bit_length) +check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, + LONGEST bit_length) { return check_pieced_value_bits (value, bit_offset, bit_length, DWARF_VALUE_IMPLICIT_POINTER); @@ -1943,9 +1943,10 @@ indirect_pieced_value (struct value *value) struct type *type; struct frame_info *frame; struct dwarf2_locexpr_baton baton; - int i, bit_offset, bit_length; + int i; + LONGEST bit_length; struct dwarf_expr_piece *piece = NULL; - LONGEST byte_offset; + LONGEST byte_offset, bit_offset; type = check_typedef (value_type (value)); if (TYPE_CODE (type) != TYPE_CODE_PTR) @@ -2192,7 +2193,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, struct value *value = dwarf_expr_fetch (ctx, 0); gdb_byte *contents; const gdb_byte *val_bytes; - size_t n = TYPE_LENGTH (value_type (value)); + ULONGEST n = TYPE_LENGTH (value_type (value)); if (byte_offset + TYPE_LENGTH (type) > n) invalid_synthetic_pointer (); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 8dbc53e..32c270c 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -826,7 +826,7 @@ struct die_info /* Blocks are a bunch of untyped bytes. */ struct dwarf_block { - unsigned int size; + size_t size; /* Valid only if SIZE is not zero. */ gdb_byte *data; @@ -963,12 +963,12 @@ dwarf2_complex_location_expr_complaint (void) } static void -dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2, - int arg3) +dwarf2_const_value_length_mismatch_complaint (const char *arg1, LONGEST arg2, + LONGEST arg3) { complaint (&symfile_complaints, - _("const value length mismatch for '%s', got %d, expected %d"), - arg1, arg2, arg3); + _("const value length mismatch for '%s', got %s, expected %s"), + arg1, plongest (arg2), plongest (arg3)); } static void @@ -8484,7 +8484,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ - int anonymous_size; + LONGEST anonymous_size; int bit_offset = DW_UNSND (attr); attr = dwarf2_attr (die, DW_AT_byte_size, cu); @@ -14672,11 +14672,11 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) case DW_FORM_block4: case DW_FORM_block: case DW_FORM_block1: - fprintf_unfiltered (f, "block: size %d", + fprintf_unfiltered (f, "block: size %zd", DW_BLOCK (&die->attrs[i])->size); break; case DW_FORM_exprloc: - fprintf_unfiltered (f, "expression: size %u", + fprintf_unfiltered (f, "expression: size %zd", DW_BLOCK (&die->attrs[i])->size); break; case DW_FORM_ref_addr: diff --git a/gdb/eval.c b/gdb/eval.c index 7f1dfac..c09d38f 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -319,7 +319,8 @@ evaluate_struct_tuple (struct value *struct_val, int pc = *pos; struct value *val = NULL; int nlabels = 0; - int bitpos, bitsize; + int bitsize; + LONGEST bitpos; bfd_byte *addr; /* Skip past the labels, and count them. */ @@ -462,7 +463,7 @@ init_array_element (struct value *array, struct value *element, enum noside noside, LONGEST low_bound, LONGEST high_bound) { LONGEST index; - int element_size = TYPE_LENGTH (value_type (element)); + LONGEST element_size = TYPE_LENGTH (value_type (element)); if (exp->elts[*pos].opcode == BINOP_COMMA) { @@ -625,11 +626,11 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch, /* FIXME: Also mixed integral/booleans, with result an integer. */ { const struct builtin_type *builtin = builtin_type (gdbarch); - unsigned int promoted_len1 = TYPE_LENGTH (type1); - unsigned int promoted_len2 = TYPE_LENGTH (type2); + ULONGEST promoted_len1 = TYPE_LENGTH (type1); + ULONGEST promoted_len2 = TYPE_LENGTH (type2); int is_unsigned1 = TYPE_UNSIGNED (type1); int is_unsigned2 = TYPE_UNSIGNED (type2); - unsigned int result_len; + ULONGEST result_len; int unsigned_operation; /* Determine type length and signedness after promotion for @@ -796,7 +797,7 @@ evaluate_subexp_standard (struct type *expect_type, int lower; int code; int ix; - long mem_offset; + LONGEST mem_offset; struct type **arg_types; int save_pos1; struct symbol *function = NULL; @@ -985,7 +986,7 @@ evaluate_subexp_standard (struct type *expect_type, struct type *range_type = TYPE_INDEX_TYPE (type); struct type *element_type = TYPE_TARGET_TYPE (type); struct value *array = allocate_value (expect_type); - int element_size = TYPE_LENGTH (check_typedef (element_type)); + LONGEST element_size = TYPE_LENGTH (check_typedef (element_type)); LONGEST low_bound, high_bound, index; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) @@ -1993,7 +1994,8 @@ evaluate_subexp_standard (struct type *expect_type, { struct type *type = value_type (arg1); struct type *real_type; - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct value_print_options opts; get_user_print_options (&opts); diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 3368d01..e3bd983 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -138,7 +138,7 @@ f_printchar (int c, struct type *type, struct ui_file *stream) static void f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, - unsigned int length, const char *encoding, int force_ellipses, + ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { const char *type_encoding = f_get_encoding (type); diff --git a/gdb/f-lang.h b/gdb/f-lang.h index 4aae3c5..d20a46f 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h @@ -28,7 +28,7 @@ extern void f_error (char *); /* Defined in f-exp.y */ extern void f_print_type (struct type *, const char *, struct ui_file *, int, int); -extern void f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern void f_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 8b84b5a..7ba0626 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -46,7 +46,7 @@ static void f77_create_arrayprint_offset_tbl (struct type *, struct ui_file *); static void f77_get_dynamic_length_of_aggregate (struct type *); -int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; +LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; /* Array which holds offsets to be applied to get a row's elements for a given array. Array also holds the size of each subarray. */ @@ -124,7 +124,7 @@ static void f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) { struct type *tmp_type; - int eltlen; + LONGEST eltlen; int ndimen = 1; int upper, lower; @@ -164,7 +164,7 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) static void f77_print_array_1 (int nss, int ndimensions, struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -215,7 +215,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, static void f77_print_array (struct type *type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -258,8 +258,9 @@ static const struct generic_val_print_decorations f_decorations = function; they are identical. */ void -f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, +f_val_print (struct type *type, const gdb_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) { @@ -381,7 +382,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, fprintf_filtered (stream, "( "); for (index = 0; index < TYPE_NFIELDS (type); index++) { - int offset = TYPE_FIELD_BITPOS (type, index) / 8; + LONGEST offset = TYPE_FIELD_BITPOS (type, index) / 8; val_print (TYPE_FIELD_TYPE (type, index), valaddr, embedded_offset + offset, diff --git a/gdb/findcmd.c b/gdb/findcmd.c index 3fce269..2ee44aa 100644 --- a/gdb/findcmd.c +++ b/gdb/findcmd.c @@ -169,7 +169,7 @@ parse_find_args (char *args, ULONGEST *max_countp, while (*s != '\0') { LONGEST x; - int val_bytes; + LONGEST val_bytes; while (isspace (*s)) ++s; diff --git a/gdb/findvar.c b/gdb/findvar.c index ed7903c..b8c81b9 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -415,7 +415,7 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) struct value *v; struct type *type = SYMBOL_TYPE (var); CORE_ADDR addr; - int len; + LONGEST len; /* Call check_typedef on our type to make sure that, if TYPE is a TYPE_CODE_TYPEDEF, its length is set to the length of the target type @@ -621,7 +621,7 @@ default_value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); struct value *value = allocate_value (type); VALUE_LVAL (value) = lval_register; @@ -651,10 +651,10 @@ void read_frame_register_value (struct value *value, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); - int offset = 0; - int reg_offset = value_offset (value); + LONGEST offset = 0; + LONGEST reg_offset = value_offset (value); int regnum = VALUE_REGNUM (value); - int len = TYPE_LENGTH (check_typedef (value_type (value))); + LONGEST len = TYPE_LENGTH (check_typedef (value_type (value))); gdb_assert (VALUE_LVAL (value) == lval_register); @@ -669,7 +669,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) while (len > 0) { struct value *regval = get_frame_register_value (frame, regnum); - int reg_len = TYPE_LENGTH (value_type (regval)) - reg_offset; + LONGEST reg_len = TYPE_LENGTH (value_type (regval)) - reg_offset; /* If the register length is larger than the number of bytes remaining to copy, then only copy the appropriate bytes. */ diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 9262b10..0873da6 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1120,7 +1120,7 @@ frv_extract_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { @@ -1139,7 +1139,7 @@ frv_extract_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Illegal return value length: %d"), len); + _("Illegal return value length: %s"), plongest (len)); } static CORE_ADDR @@ -1210,7 +1210,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function, char valbuf[4]; struct value *arg; struct type *arg_type; - int len; + LONGEST len; enum type_code typecode; CORE_ADDR regval; int stack_space; @@ -1328,7 +1328,7 @@ static void frv_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { @@ -1344,7 +1344,8 @@ frv_store_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Don't know how to return a %d-byte value."), len); + _("Don't know how to return a %s-byte value."), + plongest (len)); } static enum return_value_convention diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index e3db1ed..ba8fc1c 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1898,7 +1898,7 @@ allocate_gnat_aux_type (struct type *type) where init_type is called with a NULL value for NAME). */ struct type * -init_type (enum type_code code, int length, int flags, +init_type (enum type_code code, LONGEST length, int flags, char *name, struct objfile *objfile) { struct type *type; @@ -2130,8 +2130,8 @@ is_public_ancestor (struct type *base, struct type *dclass) static int is_unique_ancestor_worker (struct type *base, struct type *dclass, - int *offset, - const gdb_byte *valaddr, int embedded_offset, + LONGEST *offset, + const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct value *val) { int i, count = 0; @@ -2142,7 +2142,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) { struct type *iter; - int this_offset; + LONGEST this_offset; iter = check_typedef (TYPE_BASECLASS (dclass, i)); @@ -2183,7 +2183,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, int is_unique_ancestor (struct type *base, struct value *val) { - int offset = -1; + LONGEST offset = -1; return is_unique_ancestor_worker (base, value_type (val), &offset, value_contents_for_printing (val), @@ -3076,7 +3076,7 @@ recursive_dump_type (struct type *type, int spaces) break; } puts_filtered ("\n"); - printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type)); + printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type))); if (TYPE_OBJFILE_OWNED (type)) { printfi_filtered (spaces, "objfile "); @@ -3196,8 +3196,8 @@ recursive_dump_type (struct type *type, int spaces) idx, plongest (TYPE_FIELD_ENUMVAL (type, idx))); else printfi_filtered (spaces + 2, - "[%d] bitpos %d bitsize %d type ", - idx, TYPE_FIELD_BITPOS (type, idx), + "[%d] bitpos %s bitsize %d type ", + idx, plongest (TYPE_FIELD_BITPOS (type, idx)), TYPE_FIELD_BITSIZE (type, idx)); gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); printf_filtered (" name '%s' (", @@ -3479,7 +3479,7 @@ copy_type (const struct type *type) CODE, LENGTH, and NAME fields. */ struct type * arch_type (struct gdbarch *gdbarch, - enum type_code code, int length, char *name) + enum type_code code, LONGEST length, char *name) { struct type *type; diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 887dfdb..72a7043 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -514,7 +514,7 @@ struct main_type gdbarch_bits_big_endian=0 targets, it is the bit offset to the LSB. */ - int bitpos; + LONGEST bitpos; /* Enum value. */ LONGEST enumval; @@ -684,7 +684,7 @@ struct type HOST_CHAR_BIT. However, this would still fail to address machines based on a ternary or decimal representation. */ - unsigned length; + ULONGEST length; /* Core type, shared by a group of qualified types. */ struct main_type *main_type; @@ -1398,11 +1398,12 @@ extern struct type *alloc_type_copy (const struct type *); extern struct gdbarch *get_type_arch (const struct type *); /* Helper function to construct objfile-owned types. */ -extern struct type *init_type (enum type_code, int, int, char *, +extern struct type *init_type (enum type_code, LONGEST, int, char *, struct objfile *); /* Helper functions to construct architecture-owned types. */ -extern struct type *arch_type (struct gdbarch *, enum type_code, int, char *); +extern struct type *arch_type (struct gdbarch *, enum type_code, LONGEST, + char *); extern struct type *arch_integer_type (struct gdbarch *, int, int, char *); extern struct type *arch_character_type (struct gdbarch *, int, int, char *); extern struct type *arch_boolean_type (struct gdbarch *, int, int, char *); diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index e635e8f..8697c87 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -86,7 +86,7 @@ gnuv2_is_operator_name (const char *name) TYPE is the type in which F is located. */ static struct value * gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, - struct type * type, int offset) + struct type *type, LONGEST offset) { struct value *arg1 = *arg1p; struct type *type1 = check_typedef (value_type (arg1)); @@ -187,7 +187,8 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, static struct type * -gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc) +gnuv2_value_rtti_type (struct value *v, int *full, LONGEST *top, + int *using_enc) { struct type *known_type; struct type *rtti_type; @@ -342,9 +343,9 @@ vb_match (struct type *type, int index, struct type *basetype) target). The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. */ -static int +static LONGEST gnuv2_baseclass_offset (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, + const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { struct type *basetype = TYPE_BASECLASS (type, index); @@ -362,8 +363,8 @@ gnuv2_baseclass_offset (struct type *type, int index, if (vb_match (type, i, basetype)) { struct type *field_type; - int field_offset; - int field_length; + LONGEST field_offset; + LONGEST field_length; CORE_ADDR addr; field_type = check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -387,7 +388,7 @@ gnuv2_baseclass_offset (struct type *type, int index, /* Don't go through baseclass_offset, as that wraps exceptions, thus, inner exceptions would be wrapped more than once. */ - int boffset = + LONGEST boffset = gnuv2_baseclass_offset (type, i, valaddr, embedded_offset, address, val); diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index 3a83e2d..e763f29 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -105,7 +105,7 @@ build_gdb_vtable_type (struct gdbarch *arch) { struct type *t; struct field *field_list, *field; - int offset; + LONGEST offset; struct type *void_ptr_type = builtin_type (arch)->builtin_data_ptr; @@ -181,7 +181,7 @@ vtable_ptrdiff_type (struct gdbarch *gdbarch) /* Return the offset from the start of the imaginary `struct gdb_gnu_v3_abi_vtable' object to the vtable's "address point" (i.e., where objects' virtual table pointers point). */ -static int +static LONGEST vtable_address_point_offset (struct gdbarch *gdbarch) { struct type *vtable_type = gdbarch_data (gdbarch, vtable_type_gdbarch_data); @@ -272,7 +272,7 @@ gnuv3_get_vtable (struct gdbarch *gdbarch, static struct type * gnuv3_rtti_type (struct value *value, - int *full_p, int *top_p, int *using_enc_p) + int *full_p, LONGEST *top_p, int *using_enc_p) { struct gdbarch *gdbarch; struct type *values_type = check_typedef (value_type (value)); @@ -384,7 +384,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, static struct value * gnuv3_virtual_fn_field (struct value **value_p, struct fn_field *f, int j, - struct type *vfn_base, int offset) + struct type *vfn_base, LONGEST offset) { struct type *values_type = check_typedef (value_type (*value_p)); struct gdbarch *gdbarch; @@ -414,16 +414,16 @@ gnuv3_virtual_fn_field (struct value **value_p, -1 is returned on error. */ -static int +static LONGEST gnuv3_baseclass_offset (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, + const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { struct gdbarch *gdbarch; struct type *ptr_type; struct value *vtable; struct value *vbase_array; - long int cur_base_offset, base_offset; + LONGEST cur_base_offset, base_offset; /* Determine architecture. */ gdbarch = get_type_arch (type); @@ -447,7 +447,7 @@ gnuv3_baseclass_offset (struct type *type, int index, cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch); if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0) error (_("Misaligned vbase offset.")); - cur_base_offset = cur_base_offset / ((int) TYPE_LENGTH (ptr_type)); + cur_base_offset = cur_base_offset / ((LONGEST) TYPE_LENGTH (ptr_type)); vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset); gdb_assert (vtable != NULL); @@ -491,7 +491,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, we're out of luck. */ for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) { - int pos; + LONGEST pos; struct type *basetype; if (BASETYPE_VIA_VIRTUAL (domain, i)) diff --git a/gdb/go-lang.h b/gdb/go-lang.h index 67b5d93..51a1f7a 100644 --- a/gdb/go-lang.h +++ b/gdb/go-lang.h @@ -80,7 +80,7 @@ extern void go_print_type (struct type *type, const char *varstring, /* Defined in go-valprint.c. */ extern void go_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c index de52e9b..bae8806 100644 --- a/gdb/go-valprint.c +++ b/gdb/go-valprint.c @@ -86,7 +86,7 @@ print_go_string (struct type *type, const gdb_byte *valaddr, /* Implements the la_val_print routine for language Go. */ void -go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +go_val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 237f4a3..b7d53ba 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -641,7 +641,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int struct_return, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int stack_alloc = 0, stack_offset = 0; + LONGEST stack_alloc = 0, stack_offset = 0; int wordsize = BINWORD (gdbarch); int reg = E_ARG0_REGNUM; int argument; @@ -667,11 +667,11 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argument = 0; argument < nargs; argument++) { struct type *type = value_type (args[argument]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); char *contents = (char *) value_contents (args[argument]); /* Pad the argument appropriately. */ - int padded_len = align_up (len, wordsize); + LONGEST padded_len = align_up (len, wordsize); gdb_byte *padded = alloca (padded_len); memset (padded, 0, padded_len); @@ -699,7 +699,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Heavens to Betsy --- it's really going in registers! Note that on the h8/300s, there are gaps between the registers in the register file. */ - int offset; + LONGEST offset; for (offset = 0; offset < padded_len; offset += wordsize) { diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 581ffc7..e66f17f 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -962,7 +962,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = value_type (arg); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); const bfd_byte *valbuf; bfd_byte fptrbuf[8]; int regnum; @@ -1157,7 +1157,7 @@ hppa64_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regnum, offset; if (len > 16) diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c index c353154..a57fe2b 100644 --- a/gdb/i386-darwin-tdep.c +++ b/gdb/i386-darwin-tdep.c @@ -119,7 +119,7 @@ i386_m128_p (struct type *type) /* Return the alignment for TYPE when passed as an argument. */ -static int +static LONGEST i386_darwin_arg_type_alignment (struct type *type) { type = check_typedef (type); @@ -139,7 +139,7 @@ i386_darwin_arg_type_alignment (struct type *type) || TYPE_CODE (type) == TYPE_CODE_UNION) { int i; - int res = 4; + LONGEST res = 4; for (i = 0; i < TYPE_NFIELDS (type); i++) res = max (res, i386_darwin_arg_type_alignment (TYPE_FIELD_TYPE (type, i))); @@ -166,7 +166,7 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (write_pass = 0; write_pass < 2; write_pass++) { - int args_space = 0; + LONGEST args_space = 0; int num_m128 = 0; if (struct_return) @@ -196,8 +196,8 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else { - int len = TYPE_LENGTH (arg_type); - int align = i386_darwin_arg_type_alignment (arg_type); + LONGEST len = TYPE_LENGTH (arg_type); + LONGEST align = i386_darwin_arg_type_alignment (arg_type); args_space = align_up (args_space, align); if (write_pass) diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c index 753de67..4cf8273 100644 --- a/gdb/i386-nat.c +++ b/gdb/i386-nat.c @@ -293,7 +293,7 @@ static int i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state, valid value, bombs through internal_error. */ static int i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, i386_wp_op_t what, - CORE_ADDR addr, int len, + CORE_ADDR addr, LONGEST len, enum target_hw_bp_type type); /* Implementation. */ @@ -316,17 +316,17 @@ i386_cleanup_dregs (void) static void i386_show_dr (struct i386_debug_reg_state *state, const char *func, CORE_ADDR addr, - int len, enum target_hw_bp_type type) + LONGEST len, enum target_hw_bp_type type) { int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; int i; puts_unfiltered (func); if (addr || len) - printf_unfiltered (" (addr=%lx, len=%d, type=%s)", + printf_unfiltered (" (addr=%lx, len=%s, type=%s)", /* This code is for ia32, so casting CORE_ADDR to unsigned long should be okay. */ - (unsigned long)addr, len, + (unsigned long)addr, plongest (len), type == hw_write ? "data-write" : (type == hw_read ? "data-read" : (type == hw_access ? "data-read/write" @@ -505,8 +505,8 @@ i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state, static int i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, - i386_wp_op_t what, CORE_ADDR addr, int len, - enum target_hw_bp_type type) + i386_wp_op_t what, CORE_ADDR addr, + LONGEST len, enum target_hw_bp_type type) { int retval = 0; int max_wp_len = TARGET_HAS_DR_LEN_8 ? 8 : 4; @@ -592,7 +592,7 @@ i386_update_inferior_debug_regs (struct i386_debug_reg_state *new_state) of the type TYPE. Return 0 on success, -1 on failure. */ static int -i386_insert_watchpoint (CORE_ADDR addr, int len, int type, +i386_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct i386_debug_reg_state *state = i386_debug_reg_state (); @@ -629,7 +629,7 @@ i386_insert_watchpoint (CORE_ADDR addr, int len, int type, address ADDR, whose length is LEN bytes, and for accesses of the type TYPE. Return 0 on success, -1 on failure. */ static int -i386_remove_watchpoint (CORE_ADDR addr, int len, int type, +i386_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct i386_debug_reg_state *state = i386_debug_reg_state (); @@ -663,7 +663,7 @@ i386_remove_watchpoint (CORE_ADDR addr, int len, int type, address ADDR and whose length is LEN bytes. */ static int -i386_region_ok_for_watchpoint (CORE_ADDR addr, int len) +i386_region_ok_for_watchpoint (CORE_ADDR addr, LONGEST len) { struct i386_debug_reg_state *state = i386_debug_reg_state (); int nregs; diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 5b04505..7602ed7 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -2342,7 +2342,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte buf[4]; int i; int write_pass; - int args_space = 0; + LONGEST args_space = 0; /* Determine the total space required for arguments and struct return address in a first pass (allowing for 16-byte-aligned @@ -2350,7 +2350,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (write_pass = 0; write_pass < 2; write_pass++) { - int args_space_used = 0; + LONGEST args_space_used = 0; int have_16_byte_aligned_arg = 0; if (struct_return) @@ -2368,7 +2368,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < nargs; i++) { - int len = TYPE_LENGTH (value_enclosing_type (args[i])); + LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i])); if (write_pass) { @@ -2443,7 +2443,7 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); gdb_byte buf[I386_MAX_REGISTER_SIZE]; if (TYPE_CODE (type) == TYPE_CODE_FLT) @@ -2481,8 +2481,8 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type, } else internal_error (__FILE__, __LINE__, - _("Cannot extract return value of %d bytes long."), - len); + _("Cannot extract return value of %s bytes long."), + plongest (len)); } } @@ -2494,7 +2494,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_FLT) { @@ -2546,7 +2546,8 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type, } else internal_error (__FILE__, __LINE__, - _("Cannot store return value of %d bytes long."), len); + _("Cannot store return value of %s bytes long."), + plongest (len)); } } \f diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index 237f2c7..44f5431 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -542,7 +542,7 @@ is_power_of_2 (int val) } static int -ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +ia64_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { struct lwp_info *lp; @@ -596,7 +596,7 @@ ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, } static int -ia64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type, +ia64_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int idx; diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index a7a802a..5390c12 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -3263,7 +3263,7 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache, int offset = 0; int regnum = IA64_GR8_REGNUM; int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM)); - int n = TYPE_LENGTH (type) / reglen; + LONGEST n = TYPE_LENGTH (type) / reglen; int m = TYPE_LENGTH (type) % reglen; while (n-- > 0) @@ -3313,7 +3313,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache, int offset = 0; int regnum = IA64_GR8_REGNUM; int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM)); - int n = TYPE_LENGTH (type) / reglen; + LONGEST n = TYPE_LENGTH (type) / reglen; int m = TYPE_LENGTH (type) % reglen; while (n-- > 0) @@ -3719,8 +3719,10 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argno; struct value *arg; struct type *type; - int len, argoffset; - int nslots, rseslots, memslots, slotnum, nfuncargs; + LONGEST argoffset; + LONGEST len; + int rseslots, slotnum, nfuncargs; + LONGEST nslots, memslots; int floatreg; ULONGEST bsp; CORE_ADDR funcdescaddr, pc, global_pointer; diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c index f3f9bbd..6a1621d 100644 --- a/gdb/inf-ttrace.c +++ b/gdb/inf-ttrace.c @@ -313,7 +313,7 @@ inf_ttrace_disable_page_protections (pid_t pid) type TYPE. */ static int -inf_ttrace_insert_watchpoint (CORE_ADDR addr, int len, int type, +inf_ttrace_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { const int pagesize = inf_ttrace_page_dict.pagesize; @@ -337,7 +337,7 @@ inf_ttrace_insert_watchpoint (CORE_ADDR addr, int len, int type, type TYPE. */ static int -inf_ttrace_remove_watchpoint (CORE_ADDR addr, int len, int type, +inf_ttrace_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { const int pagesize = inf_ttrace_page_dict.pagesize; @@ -364,7 +364,7 @@ inf_ttrace_can_use_hw_breakpoint (int type, int len, int ot) } static int -inf_ttrace_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +inf_ttrace_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { return 1; } diff --git a/gdb/infcall.c b/gdb/infcall.c index a3496d6..c6a22f6 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -682,7 +682,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) if (struct_return || lang_struct_return) { - int len = TYPE_LENGTH (values_type); + LONGEST len = TYPE_LENGTH (values_type); if (gdbarch_inner_than (gdbarch, 1, 2)) { diff --git a/gdb/infrun.c b/gdb/infrun.c index 45b1fe7..4d5bdca 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -6709,7 +6709,7 @@ save_infcall_suspend_state (void) if (gdbarch_get_siginfo_type_p (gdbarch)) { struct type *type = gdbarch_get_siginfo_type (gdbarch); - size_t len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); struct cleanup *back_to; siginfo_data = xmalloc (len); @@ -6766,11 +6766,10 @@ restore_infcall_suspend_state (struct infcall_suspend_state *inf_state) if (inf_state->siginfo_gdbarch == gdbarch) { struct type *type = gdbarch_get_siginfo_type (gdbarch); - size_t len = TYPE_LENGTH (type); /* Errors ignored. */ target_write (¤t_target, TARGET_OBJECT_SIGNAL_INFO, NULL, - inf_state->siginfo_data, 0, len); + inf_state->siginfo_data, 0, TYPE_LENGTH (type)); } /* The inferior can be gone if the user types "print exit(0)" diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c index 6ecc671..2c646da 100644 --- a/gdb/iq2000-tdep.c +++ b/gdb/iq2000-tdep.c @@ -504,7 +504,7 @@ static void iq2000_store_return_value (struct type *type, struct regcache *regcache, const void *valbuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = E_FN_RETURN_REGNUM; while (len > 0) @@ -550,7 +550,7 @@ iq2000_extract_return_value (struct type *type, struct regcache *regcache, returned in a register, and if larger than 8 bytes, it is returned in a stack location which is pointed to by the same register. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= (2 * 4)) { @@ -655,8 +655,9 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const bfd_byte *val; bfd_byte buf[4]; struct type *type; - int i, argreg, typelen, slacklen; - int stackspace = 0; + int i, argreg, slacklen; + LONGEST typelen; + LONGEST stackspace = 0; /* Used to copy struct arguments into the stack. */ CORE_ADDR struct_ptr; diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index a7cfb76..5ff69ca 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -439,7 +439,7 @@ java_link_class_type (struct gdbarch *gdbarch, for (i = TYPE_N_BASECLASSES (type); i < nfields; i++) { int accflags; - int boffset; + LONGEST boffset; if (fields == NULL) { @@ -888,7 +888,7 @@ java_printchar (int c, struct type *type, struct ui_file *stream) static void java_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, - unsigned int length, const char *encoding, int force_ellipses, + ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { const char *type_encoding = java_get_encoding (type); diff --git a/gdb/jv-lang.h b/gdb/jv-lang.h index 8ea9c3c..bf77ccf 100644 --- a/gdb/jv-lang.h +++ b/gdb/jv-lang.h @@ -42,8 +42,8 @@ struct builtin_java_type extern const struct builtin_java_type *builtin_java_type (struct gdbarch *); -extern void java_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, - struct ui_file *, int, +extern void java_val_print (struct type *, const gdb_byte *, LONGEST, + CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index d1274dd..42b85dc 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -266,7 +266,7 @@ java_value_print (struct value *val, struct ui_file *stream, static void java_print_value_fields (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -484,7 +484,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, void java_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) diff --git a/gdb/language.c b/gdb/language.c index f0a8697..9ae020e 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -831,7 +831,7 @@ unk_lang_printchar (int c, struct type *type, struct ui_file *stream) static void unk_lang_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { @@ -849,7 +849,7 @@ unk_lang_print_type (struct type *type, const char *varstring, static void unk_lang_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) diff --git a/gdb/language.h b/gdb/language.h index d612c70..c571b81 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -200,7 +200,7 @@ struct language_defn struct ui_file * stream); void (*la_printstr) (struct ui_file * stream, struct type *elttype, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *); @@ -242,7 +242,7 @@ struct language_defn void (*la_val_print) (struct type *type, const gdb_byte *contents, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index 57d73b5..a1306a9 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -261,7 +261,7 @@ lm32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); gdb_byte *contents; - int len; + LONGEST len; ULONGEST val; /* Promote small integer types to int. */ @@ -350,7 +350,7 @@ lm32_store_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index 8faa6c1..0c9d394 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -104,7 +104,7 @@ m2_printchar (int c, struct type *type, struct ui_file *stream) static void m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, - unsigned int length, const char *encoding, int force_ellipses, + ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { unsigned int i; diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h index fc6de34..9d65366 100644 --- a/gdb/m2-lang.h +++ b/gdb/m2-lang.h @@ -32,7 +32,7 @@ extern void m2_print_typedef (struct type *, struct symbol *, extern int m2_is_long_set (struct type *type); extern int m2_is_unbounded_array (struct type *type); -extern void m2_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern void m2_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index fb3d49c..09c21af 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -228,9 +228,12 @@ static void m2_array (struct type *type, struct ui_file *stream, m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1); } else - fprintf_filtered (stream, "%d", - (TYPE_LENGTH (type) - / TYPE_LENGTH (TYPE_TARGET_TYPE (type)))); + { + ULONGEST val = (TYPE_LENGTH (type) + / TYPE_LENGTH (TYPE_TARGET_TYPE (type))); + + fprintf_filtered (stream, "%s", pulongest (val)); + } } fprintf_filtered (stream, "] OF "); m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level); @@ -587,7 +590,8 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show, void m2_enum (struct type *type, struct ui_file *stream, int show, int level) { - int lastval, i, len; + LONGEST lastval; + int i, len; if (show < 0) { diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c index e92679f..dae0f0d 100644 --- a/gdb/m2-valprint.c +++ b/gdb/m2-valprint.c @@ -36,7 +36,7 @@ static int print_unpacked_pointer (struct type *type, struct ui_file *stream); static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -68,7 +68,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high) static void m2_print_long_set (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream) { int empty_set = 1; @@ -159,7 +159,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr, static void m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value_print_options *options) { @@ -263,22 +263,20 @@ print_variable_at_address (struct type *type, static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int len) { - int eltlen; CHECK_TYPEDEF (type); if (TYPE_LENGTH (type) > 0) { - eltlen = TYPE_LENGTH (type); if (options->prettyprint_arrays) print_spaces_filtered (2 + 2 * recurse, stream); /* For an array of chars, print with string syntax. */ - if (eltlen == 1 && + if (TYPE_LENGTH (type) == 1 && ((TYPE_CODE (type) == TYPE_CODE_INT) || ((current_language->la_language == language_m2) && (TYPE_CODE (type) == TYPE_CODE_CHAR))) @@ -311,16 +309,16 @@ static const struct generic_val_print_decorations m2_decorations = function; they are identical. */ void -m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, +m2_val_print (struct type *type, const gdb_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) { struct gdbarch *gdbarch = get_type_arch (type); - unsigned int i = 0; /* Number of characters printed. */ - unsigned len; + ULONGEST i = 0; /* Number of characters printed. */ + ULONGEST len; struct type *elttype; - unsigned eltlen; CORE_ADDR addr; CHECK_TYPEDEF (type); @@ -330,12 +328,11 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0) { elttype = check_typedef (TYPE_TARGET_TYPE (type)); - eltlen = TYPE_LENGTH (elttype); - len = TYPE_LENGTH (type) / eltlen; + len = TYPE_LENGTH (type) / TYPE_LENGTH (elttype); if (options->prettyprint_arrays) print_spaces_filtered (2 + 2 * recurse, stream); /* For an array of chars, print with string syntax. */ - if (eltlen == 1 && + if (TYPE_LENGTH (elttype) == 1 && ((TYPE_CODE (elttype) == TYPE_CODE_INT) || ((current_language->la_language == language_m2) && (TYPE_CODE (elttype) == TYPE_CODE_CHAR))) @@ -345,7 +342,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, elements up to it. */ if (options->stop_print_at_null) { - unsigned int temp_len; + ULONGEST temp_len; /* Look for a NULL char. */ for (temp_len = 0; diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 150b9de..4d39534 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -696,7 +696,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, CORE_ADDR regval; gdb_byte *val; gdb_byte valbuf[MAX_REGISTER_SIZE]; - int len; + LONGEST len; /* First force sp to a 4-byte alignment. */ sp = sp & ~3; @@ -790,7 +790,7 @@ m32r_extract_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); ULONGEST tmp; /* By using store_unsigned_integer we avoid having to do diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 79629ef..47600a2 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1174,7 +1174,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int first_stack_argnum; struct type *type; char *val; - int len; + LONGEST len; char buf[2]; first_stack_argnum = 0; @@ -1266,7 +1266,7 @@ static void m68hc11_store_return_value (struct type *type, struct regcache *regcache, const void *valbuf) { - int len; + LONGEST len; len = TYPE_LENGTH (type); diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index cc1df34..f33566d 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -292,7 +292,7 @@ static void m68k_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); gdb_byte buf[M68K_MAX_REGISTER_SIZE]; if (len <= 4) @@ -308,14 +308,14 @@ m68k_extract_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Cannot extract return value of %d bytes long."), len); + _("Cannot extract return value of %s bytes long."), + plongest (len)); } static void m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); gdb_byte buf[M68K_MAX_REGISTER_SIZE]; struct gdbarch *gdbarch = get_regcache_arch (regcache); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -326,7 +326,7 @@ m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache, regcache_raw_read (regcache, M68K_FP0_REGNUM, buf); convert_typed_floating (buf, fpreg_type, valbuf, type); } - else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4) + else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4) regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf); else m68k_extract_return_value (type, regcache, valbuf); @@ -338,7 +338,7 @@ static void m68k_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) regcache_raw_write_part (regcache, M68K_D0_REGNUM, 4 - len, len, valbuf); @@ -350,14 +350,14 @@ m68k_store_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Cannot store return value of %d bytes long."), len); + _("Cannot store return value of %s bytes long."), + plongest (len)); } static void m68k_svr4_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); struct gdbarch *gdbarch = get_regcache_arch (regcache); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -368,7 +368,7 @@ m68k_svr4_store_return_value (struct type *type, struct regcache *regcache, convert_typed_floating (valbuf, type, buf, fpreg_type); regcache_raw_write (regcache, M68K_FP0_REGNUM, buf); } - else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4) + else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4) { regcache_raw_write (regcache, M68K_A0_REGNUM, valbuf); regcache_raw_write (regcache, M68K_D0_REGNUM, valbuf); @@ -515,9 +515,9 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); - int len = TYPE_LENGTH (value_type); - int container_len = (len + 3) & ~3; - int offset; + LONGEST len = TYPE_LENGTH (value_type); + LONGEST container_len = (len + 3) & ~3; + LONGEST offset; /* Non-scalars bigger than 4 bytes are left aligned, others are right aligned. */ diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c index c4c3266..ec27ed7 100644 --- a/gdb/m88k-tdep.c +++ b/gdb/m88k-tdep.c @@ -259,14 +259,14 @@ m88k_store_arguments (struct regcache *regcache, int nargs, struct value **args, CORE_ADDR sp) { struct gdbarch *gdbarch = get_regcache_arch (regcache); - int num_register_words = 0; - int num_stack_words = 0; + LONGEST num_register_words = 0; + LONGEST num_stack_words = 0; int i; for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (m88k_integral_or_pointer_p (type) && len < 4) { @@ -387,7 +387,7 @@ m88k_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); gdb_byte buf[8]; if (!m88k_integral_or_pointer_p (type) && !m88k_floating_p (type)) diff --git a/gdb/memrange.c b/gdb/memrange.c index ed41b9a..a87bc85 100644 --- a/gdb/memrange.c +++ b/gdb/memrange.c @@ -21,8 +21,8 @@ #include "memrange.h" int -mem_ranges_overlap (CORE_ADDR start1, int len1, - CORE_ADDR start2, int len2) +mem_ranges_overlap (CORE_ADDR start1, LONGEST len1, + CORE_ADDR start2, LONGEST len2) { ULONGEST h, l; diff --git a/gdb/memrange.h b/gdb/memrange.h index 926af22..050a56f 100644 --- a/gdb/memrange.h +++ b/gdb/memrange.h @@ -30,7 +30,7 @@ struct mem_range CORE_ADDR start; /* Length of the range. */ - int length; + LONGEST length; }; typedef struct mem_range mem_range_s; @@ -40,8 +40,8 @@ DEF_VEC_O(mem_range_s); /* Returns true if the ranges defined by [start1, start1+len1) and [start2, start2+len2) overlap. */ -extern int mem_ranges_overlap (CORE_ADDR start1, int len1, - CORE_ADDR start2, int len2); +extern int mem_ranges_overlap (CORE_ADDR start1, LONGEST len1, + CORE_ADDR start2, LONGEST len2); /* Sort ranges by start address, then coalesce contiguous or overlapping ranges. */ diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 960500c..e50d8ba 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -2279,7 +2279,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv, for (i = 0; i < argc; i++) { - unsigned arg_len = TYPE_LENGTH (value_type (argv[i])); + ULONGEST arg_len = TYPE_LENGTH (value_type (argv[i])); if (arg_len > MEP_GPR_SIZE) { @@ -2337,7 +2337,7 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < argc; i++) { - unsigned arg_size = TYPE_LENGTH (value_type (argv[i])); + ULONGEST arg_size = TYPE_LENGTH (value_type (argv[i])); ULONGEST value; /* Arguments that fit in a GPR get expanded to fill the GPR. */ diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index ca59213..df5a78a 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -590,7 +590,7 @@ static void microblaze_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); gdb_byte buf[8]; memset (buf, 0, sizeof(buf)); diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c index b9f7f1d..7467d11 100644 --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c @@ -938,7 +938,7 @@ try_one_watch (struct pt_watch_regs *regs, CORE_ADDR addr, the specified region can be covered by the watch registers. */ static int -mips_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +mips_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { struct pt_watch_regs dummy_regs; int i; @@ -1017,7 +1017,7 @@ populate_regs_from_watches (struct pt_watch_regs *regs) watch. Return zero on success. */ static int -mips_linux_insert_watchpoint (CORE_ADDR addr, int len, int type, +mips_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct pt_watch_regs regs; @@ -1067,7 +1067,7 @@ mips_linux_insert_watchpoint (CORE_ADDR addr, int len, int type, Return zero on success. */ static int -mips_linux_remove_watchpoint (CORE_ADDR addr, int len, int type, +mips_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int retval; diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 909a5a6..cffaaac 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -396,7 +396,7 @@ static void mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, int reg_num, int length, enum bfd_endian endian, gdb_byte *in, - const gdb_byte *out, int buf_offset) + const gdb_byte *out, LONGEST buf_offset) { int reg_offset = 0; @@ -419,8 +419,8 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, } if (mips_debug) fprintf_unfiltered (gdb_stderr, - "xfer $%d, reg offset %d, buf offset %d, length %d, ", - reg_num, reg_offset, buf_offset, length); + "xfer $%d, reg offset %d, buf offset %s, length %d, ", + reg_num, reg_offset, plongest (buf_offset), length); if (mips_debug && out != NULL) { int i; @@ -4291,13 +4291,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (arg_type); + LONGEST len = TYPE_LENGTH (arg_type); enum type_code typecode = TYPE_CODE (arg_type); if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_eabi_push_dummy_call: %d len=%d type=%d", - argnum + 1, len, (int) typecode); + "mips_eabi_push_dummy_call: %d len=%s type=%d", + argnum + 1, plongest (len), (int) typecode); /* Function pointer arguments to mips16 code need to be made into mips16 pointers. */ @@ -4582,7 +4582,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct value *function, static int mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, - int offset) + LONGEST offset) { int i; @@ -4597,7 +4597,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, for (i = 0; i < TYPE_NFIELDS (arg_type); i++) { - int pos; + LONGEST pos; struct type *field_type; /* We're only looking at normal fields. */ @@ -4991,11 +4991,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, : MIPS_V0_REGNUM); field < TYPE_NFIELDS (type); field++, regnum += 2) { - int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) - / TARGET_CHAR_BIT); + LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) + / TARGET_CHAR_BIT); if (mips_debug) - fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", - offset); + fprintf_unfiltered (gdb_stderr, "Return float struct+%s\n", + plongest (offset)); if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) { /* A 16-byte long double field goes in two consecutive @@ -5096,7 +5096,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; - int len = 0; + LONGEST len = 0; int stack_offset = 0; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -5123,13 +5123,12 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { struct type *arg_type = check_typedef (value_type (args[argnum])); - int arglen = TYPE_LENGTH (arg_type); /* Align to double-word if necessary. */ if (mips_type_needs_double_align (arg_type)) len = align_up (len, MIPS32_REGSIZE * 2); /* Allocate space on the stack. */ - len += align_up (arglen, MIPS32_REGSIZE); + len += align_up (TYPE_LENGTH (arg_type), MIPS32_REGSIZE); } sp -= align_up (len, 16); @@ -5162,13 +5161,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (arg_type); + LONGEST len = TYPE_LENGTH (arg_type); enum type_code typecode = TYPE_CODE (arg_type); if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o32_push_dummy_call: %d len=%d type=%d", - argnum + 1, len, (int) typecode); + "mips_o32_push_dummy_call: %d len=%s type=%d", + argnum + 1, plongest (len), (int) typecode); val = value_contents (arg); @@ -5626,8 +5625,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; - int len = 0; - int stack_offset = 0; + LONGEST len = 0; + LONGEST stack_offset = 0; struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); @@ -5653,10 +5652,9 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { struct type *arg_type = check_typedef (value_type (args[argnum])); - int arglen = TYPE_LENGTH (arg_type); /* Allocate space on the stack. */ - len += align_up (arglen, MIPS64_REGSIZE); + len += align_up (TYPE_LENGTH (arg_type), MIPS64_REGSIZE); } sp -= align_up (len, 16); @@ -5690,13 +5688,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (arg_type); + LONGEST len = TYPE_LENGTH (arg_type); enum type_code typecode = TYPE_CODE (arg_type); if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o64_push_dummy_call: %d len=%d type=%d", - argnum + 1, len, (int) typecode); + "mips_o64_push_dummy_call: %d len=%s type=%d", + argnum + 1, plongest (len), (int) typecode); val = value_contents (arg); diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index e292613..7de7aac 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -83,10 +83,11 @@ struct mn10300_prologue /* Compute the alignment required by a type. */ -static int +static LONGEST mn10300_type_align (struct type *type) { - int i, align = 1; + int i; + LONGEST align = 1; switch (TYPE_CODE (type)) { @@ -108,7 +109,7 @@ mn10300_type_align (struct type *type) case TYPE_CODE_UNION: for (i = 0; i < TYPE_NFIELDS (type); i++) { - int falign = mn10300_type_align (TYPE_FIELD_TYPE (type, i)); + LONGEST falign = mn10300_type_align (TYPE_FIELD_TYPE (type, i)); while (align < falign) align <<= 1; } @@ -1228,7 +1229,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); const int push_size = register_size (gdbarch, E_PC_REGNUM); int regs_used; - int len, arg_len; + LONGEST len, arg_len; int stack_offset = 0; int argnum; char *val, valbuf[MAX_REGISTER_SIZE]; diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c index 3e08d60..cb2c59b 100644 --- a/gdb/moxie-tdep.c +++ b/gdb/moxie-tdep.c @@ -124,7 +124,7 @@ moxie_store_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR regval; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); /* Things always get returned in RET1_REGNUM, RET2_REGNUM. */ regval = extract_unsigned_integer (valbuf, len > 4 ? 4 : len, byte_order); @@ -321,7 +321,7 @@ moxie_extract_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); ULONGEST tmp; /* By using store_unsigned_integer we avoid having to do diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c index ee4b6eb..e3622aa 100644 --- a/gdb/mt-tdep.c +++ b/gdb/mt-tdep.c @@ -783,9 +783,9 @@ mt_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte buf[MT_MAX_STRUCT_SIZE]; int argreg = MT_1ST_ARGREG; int split_param_len = 0; - int stack_dest = sp; + LONGEST stack_dest = sp; int slacklen; - int typelen; + LONGEST typelen; int i, j; /* First handle however many args we can fit into MT_1ST_ARGREG thru diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index b58f318..f3aaad1 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -69,10 +69,10 @@ static ptid_t do_attach (ptid_t ptid); static int procfs_can_use_hw_breakpoint (int, int, int); -static int procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type, +static int procfs_insert_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond); -static int procfs_remove_hw_watchpoint (CORE_ADDR addr, int len, int type, +static int procfs_remove_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond); static int procfs_stopped_by_watchpoint (void); @@ -1457,7 +1457,7 @@ _initialize_procfs (void) static int -procfs_hw_watchpoint (int addr, int len, int type) +procfs_hw_watchpoint (int addr, LONGEST len, int type) { procfs_break brk; @@ -1493,14 +1493,14 @@ procfs_can_use_hw_breakpoint (int type, int cnt, int othertype) } static int -procfs_remove_hw_watchpoint (CORE_ADDR addr, int len, int type, +procfs_remove_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { return procfs_hw_watchpoint (addr, -1, type); } static int -procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type, +procfs_insert_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { return procfs_hw_watchpoint (addr, len, type); diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 15bf792..f0462f8 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -347,7 +347,7 @@ objc_printchar (int c, struct type *type, struct ui_file *stream) static void objc_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index 54075a4..69833b5 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -80,11 +80,11 @@ builtin_opencl_type (struct gdbarch *gdbarch) static struct type * lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code, - unsigned int el_length, unsigned int flag_unsigned, + ULONGEST el_length, unsigned int flag_unsigned, int n) { int i; - unsigned int length; + ULONGEST length; struct type *type = NULL; struct type **types = builtin_opencl_type (gdbarch); @@ -174,9 +174,9 @@ lval_func_read (struct value *v) struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); struct type *type = check_typedef (value_type (v)); struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); - int offset = value_offset (v); - int elsize = TYPE_LENGTH (eltype); - int n, i, j = 0; + LONGEST offset = value_offset (v); + LONGEST elsize = TYPE_LENGTH (eltype); + LONGEST n, i, j = 0; LONGEST lowb = 0; LONGEST highb = 0; @@ -203,9 +203,9 @@ lval_func_write (struct value *v, struct value *fromval) struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); struct type *type = check_typedef (value_type (v)); struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); - int offset = value_offset (v); - int elsize = TYPE_LENGTH (eltype); - int n, i, j = 0; + LONGEST offset = value_offset (v); + LONGEST elsize = TYPE_LENGTH (eltype); + LONGEST n, i, j = 0; LONGEST lowb = 0; LONGEST highb = 0; @@ -243,17 +243,18 @@ lval_func_write (struct value *v, struct value *fromval) /* Return nonzero if all bits in V within OFFSET and LENGTH are valid. */ static int -lval_func_check_validity (const struct value *v, int offset, int length) +lval_func_check_validity (const struct value *v, LONGEST offset, + LONGEST length) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); /* Size of the target type in bits. */ - int elsize = - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; + LONGEST elsize = + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; int startrest = offset % elsize; - int start = offset / elsize; + LONGEST start = offset / elsize; int endrest = (offset + length) % elsize; - int end = (offset + length) / elsize; - int i; + LONGEST end = (offset + length) / elsize; + LONGEST i; if (endrest) end++; @@ -281,8 +282,8 @@ lval_func_check_any_valid (const struct value *v) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); /* Size of the target type in bits. */ - int elsize = - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; + LONGEST elsize = + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; int i; for (i = 0; i < c->n; i++) @@ -297,17 +298,17 @@ lval_func_check_any_valid (const struct value *v) static int lval_func_check_synthetic_pointer (const struct value *v, - int offset, int length) + LONGEST offset, LONGEST length) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); /* Size of the target type in bits. */ - int elsize = - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; + LONGEST elsize = + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; int startrest = offset % elsize; - int start = offset / elsize; + LONGEST start = offset / elsize; int endrest = (offset + length) % elsize; - int end = (offset + length) / elsize; - int i; + LONGEST end = (offset + length) / elsize; + LONGEST i; if (endrest) end++; diff --git a/gdb/p-lang.c b/gdb/p-lang.c index c59ba0b..b72f5c4 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -96,8 +96,8 @@ pascal_main_name (void) are not multiple of TARGET_CHAR_BIT then the results are wrong but this does not happen for Free Pascal nor for GPC. */ int -is_pascal_string_type (struct type *type,int *length_pos, - int *length_size, int *string_pos, +is_pascal_string_type (struct type *type, LONGEST *length_pos, + LONGEST *length_size, LONGEST *string_pos, struct type **char_type, const char **arrayname) { @@ -217,7 +217,7 @@ pascal_printchar (int c, struct type *type, struct ui_file *stream) void pascal_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { diff --git a/gdb/p-lang.h b/gdb/p-lang.h index b1e218c..b160f53 100644 --- a/gdb/p-lang.h +++ b/gdb/p-lang.h @@ -35,7 +35,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *, extern void pascal_print_typedef (struct type *, struct symbol *, struct ui_file *); -extern void pascal_val_print (struct type *, const gdb_byte *, int, +extern void pascal_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -49,13 +49,13 @@ extern void pascal_type_print_method_args (const char *, const char *, /* These are in p-lang.c: */ extern int - is_pascal_string_type (struct type *, int *, int *, int *, + is_pascal_string_type (struct type *, LONGEST *, LONGEST *, LONGEST *, struct type **, const char **); extern void pascal_printchar (int, struct type *, struct ui_file *); extern void pascal_printstr (struct ui_file *, struct type *, const gdb_byte *, - unsigned int, const char *, int, + ULONGEST, const char *, int, const struct value_print_options *); extern struct type **const (pascal_builtin_types[]); @@ -69,7 +69,7 @@ extern void pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int); extern void pascal_object_print_value_fields (struct type *, const gdb_byte *, - int, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index a00f5b3..828b0ce 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -442,7 +442,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, { int i; int len; - int lastval; + LONGEST lastval; enum { s_none, s_public, s_private, s_protected diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index b8434ed..6974ab4 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -58,7 +58,7 @@ static const struct generic_val_print_decorations p_decorations = void pascal_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -69,8 +69,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, unsigned len; LONGEST low_bound, high_bound; struct type *elttype; - unsigned eltlen; - int length_pos, length_size, string_pos; + ULONGEST eltlen; + LONGEST length_pos, string_pos; + LONGEST length_size; struct type *char_type; CORE_ADDR addr; int want_space = 0; @@ -477,7 +478,7 @@ static void pascal_object_print_static_field (struct value *, const struct value_print_options *); static void pascal_object_print_value (struct type *, const gdb_byte *, - int, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -536,7 +537,7 @@ pascal_object_is_vtbl_member (struct type *type) void pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -731,7 +732,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, static void pascal_object_print_value (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -754,11 +755,11 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr, for (i = 0; i < n_baseclasses; i++) { - int boffset = 0; + LONGEST boffset = 0; struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); const char *basename = type_name_no_tag (baseclass); const gdb_byte *base_valaddr = NULL; - int thisoffset; + LONGEST thisoffset; volatile struct gdb_exception ex; int skip = 0; diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index b9e0c85..19d0bc4 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -1927,7 +1927,7 @@ num_memory_accesses (struct value *v) of the constant. */ static int check_condition (CORE_ADDR watch_addr, struct expression *cond, - CORE_ADDR *data_value, int *len) + CORE_ADDR *data_value, LONGEST *len) { int pc = 1, num_accesses_left, num_accesses_right; struct value *left_val, *right_val, *left_chain, *right_chain; @@ -1994,7 +1994,7 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond, the condition expression, thus only triggering the watchpoint when it is true. */ static int -ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, +ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { CORE_ADDR data_value; @@ -2011,7 +2011,7 @@ ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, static void create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, - int len, int rw, struct expression *cond, + LONGEST len, int rw, struct expression *cond, int insert) { if (len == 1 @@ -2056,7 +2056,7 @@ create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, } static int -ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +ppc_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { struct lwp_info *lp; @@ -2124,7 +2124,7 @@ ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, } static int -ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw, +ppc_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { struct lwp_info *lp; diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index a221b70..bdbcfd3 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -100,9 +100,9 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Next available vector register for vector arguments. */ int vreg = 2; /* Arguments start above the "LR save word" and "Back chain". */ - int argoffset = 2 * tdep->wordsize; + LONGEST argoffset = 2 * tdep->wordsize; /* Structures start after the arguments. */ - int structoffset = argoffset + argspace; + LONGEST structoffset = argoffset + argspace; /* If the function is returning a `struct', then the first word (which will be passed in r3) is used for struct return @@ -121,7 +121,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[argno]; struct type *type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); const bfd_byte *val = value_contents (arg); if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8 @@ -353,7 +353,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* OpenCL vectors shorter than 16 bytes are passed as if a series of independent scalars. */ struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); - int i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); + LONGEST i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); for (i = 0; i < nelt; i++) { @@ -841,11 +841,11 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, && opencl_abi) { struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); - int i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); + LONGEST i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); for (i = 0; i < nelt; i++) { - int offset = i * TYPE_LENGTH (eltype); + LONGEST offset = i * TYPE_LENGTH (eltype); if (TYPE_CODE (eltype) == TYPE_CODE_FLT) { @@ -1592,7 +1592,7 @@ ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, register. Work around this by always writing the value to memory. Fortunately, doing this simplifies the code. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len < tdep->wordsize) write_memory (gparam + tdep->wordsize - len, val, len); else @@ -1842,12 +1842,12 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, && TYPE_LENGTH (valtype) >= 16 && opencl_abi) { - int n_regs = TYPE_LENGTH (valtype) / 16; - int i; + LONGEST n_regs = TYPE_LENGTH (valtype) / 16; + LONGEST i; for (i = 0; i < n_regs; i++) { - int offset = i * 16; + LONGEST offset = i * 16; int regnum = tdep->ppc_vr0_regnum + 2 + i; if (writebuf != NULL) diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 030a4f2..4704777 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -296,7 +296,7 @@ print_formatted (struct value *val, int size, struct ui_file *stream) { struct type *type = check_typedef (value_type (val)); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (VALUE_LVAL (val) == lval_memory) next_address = value_address (val) + len; @@ -352,7 +352,7 @@ float_type_from_length (struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); const struct builtin_type *builtin = builtin_type (gdbarch); - unsigned int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len == TYPE_LENGTH (builtin->builtin_float)) type = builtin->builtin_float; @@ -375,7 +375,7 @@ print_scalar_formatted (const void *valaddr, struct type *type, { struct gdbarch *gdbarch = get_type_arch (type); LONGEST val_long = 0; - unsigned int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* String printing should go through val_print_scalar_formatted. */ diff --git a/gdb/procfs.c b/gdb/procfs.c index 774df2e..3286540 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -4815,7 +4815,7 @@ procfs_pid_to_str (struct target_ops *ops, ptid_t ptid) /* Insert a watchpoint. */ static int -procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag, +procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, LONGEST len, int rwflag, int after) { #ifndef UNIXWARE @@ -4937,7 +4937,7 @@ procfs_stopped_data_address (struct target_ops *targ, CORE_ADDR *addr) } static int -procfs_insert_watchpoint (CORE_ADDR addr, int len, int type, +procfs_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { if (!target_have_steppable_watchpoint @@ -4959,14 +4959,14 @@ procfs_insert_watchpoint (CORE_ADDR addr, int len, int type, } static int -procfs_remove_watchpoint (CORE_ADDR addr, int len, int type, +procfs_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { return procfs_set_watchpoint (inferior_ptid, addr, 0, 0, 0); } static int -procfs_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +procfs_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { /* The man page for proc(4) on Solaris 2.6 and up says that the system can support "thousands" of hardware watchpoints, but gives diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index 86d4f2c..1ceb23b 100644 --- a/gdb/python/py-prettyprint.c +++ b/gdb/python/py-prettyprint.c @@ -676,7 +676,7 @@ print_children (PyObject *printer, const char *hint, int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -824,7 +824,7 @@ gdbpy_default_visualizer (PyObject *self, PyObject *args) int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, diff --git a/gdb/python/python.h b/gdb/python/python.h index dd7066f..2a57409 100644 --- a/gdb/python/python.h +++ b/gdb/python/python.h @@ -31,7 +31,7 @@ void eval_python_from_control_command (struct command_line *); void source_python_script (FILE *file, const char *filename); int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, diff --git a/gdb/regcache.c b/gdb/regcache.c index c716280..12ed8fa 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -902,7 +902,7 @@ typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum, static enum register_status regcache_xfer_part (struct regcache *regcache, int regnum, - int offset, int len, void *in, const void *out, + LONGEST offset, int len, void *in, const void *out, enum register_status (*read) (struct regcache *regcache, int regnum, gdb_byte *buf), @@ -968,7 +968,7 @@ regcache_raw_write_part (struct regcache *regcache, int regnum, enum register_status regcache_cooked_read_part (struct regcache *regcache, int regnum, - int offset, int len, gdb_byte *buf) + LONGEST offset, int len, gdb_byte *buf) { struct regcache_descr *descr = regcache->descr; @@ -979,7 +979,7 @@ regcache_cooked_read_part (struct regcache *regcache, int regnum, void regcache_cooked_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf) + LONGEST offset, int len, const gdb_byte *buf) { struct regcache_descr *descr = regcache->descr; diff --git a/gdb/regcache.h b/gdb/regcache.h index 93b4499..81ccda6 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -129,10 +129,10 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache, write style operations. */ enum register_status regcache_cooked_read_part (struct regcache *regcache, - int regnum, int offset, + int regnum, LONGEST offset, int len, gdb_byte *buf); void regcache_cooked_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf); + LONGEST offset, int len, const gdb_byte *buf); /* Special routines to read/write the PC. */ diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index 47f4405..0209ed8 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -1416,14 +1416,14 @@ m32r_can_use_hw_watchpoint (int type, int cnt, int othertype) watchpoint. */ static int -m32r_insert_watchpoint (CORE_ADDR addr, int len, int type, +m32r_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int i; if (remote_debug) - fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%d,%d)\n", - paddress (target_gdbarch, addr), len, type); + fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%s,%d)\n", + paddress (target_gdbarch, addr), plongest (len), type); for (i = 0; i < MAX_ACCESS_BREAKS; i++) { @@ -1441,14 +1441,14 @@ m32r_insert_watchpoint (CORE_ADDR addr, int len, int type, } static int -m32r_remove_watchpoint (CORE_ADDR addr, int len, int type, +m32r_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int i; if (remote_debug) - fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%d,%d)\n", - paddress (target_gdbarch, addr), len, type); + fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%s,%d)\n", + paddress (target_gdbarch, addr), plongest (len), type); for (i = 0; i < MAX_ACCESS_BREAKS; i++) { diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index babbf19..9dc2c6a 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -133,9 +133,9 @@ static void mips_load (char *file, int from_tty); static int mips_make_srec (char *buffer, int type, CORE_ADDR memaddr, unsigned char *myaddr, int len); -static int mips_set_breakpoint (CORE_ADDR addr, int len, enum break_type type); +static int mips_set_breakpoint (CORE_ADDR addr, LONGEST len, enum break_type type); -static int mips_clear_breakpoint (CORE_ADDR addr, int len, +static int mips_clear_breakpoint (CORE_ADDR addr, LONGEST len, enum break_type type); static int mips_common_breakpoint (int set, CORE_ADDR addr, int len, @@ -402,7 +402,7 @@ struct lsi_breakpoint_info { enum break_type type; /* type of breakpoint */ CORE_ADDR addr; /* address of breakpoint */ - int len; /* length of region being watched */ + LONGEST len; /* length of region being watched */ unsigned long value; /* value to watch */ } lsi_breakpoints[MAX_LSI_BREAKPOINTS]; @@ -2393,7 +2393,7 @@ mips_can_use_watchpoint (int type, int cnt, int othertype) This is used for memory ref breakpoints. */ static unsigned long -calculate_mask (CORE_ADDR addr, int len) +calculate_mask (CORE_ADDR addr, LONGEST len) { unsigned long mask; int i; @@ -2417,7 +2417,7 @@ calculate_mask (CORE_ADDR addr, int len) watchpoint. */ static int -mips_insert_watchpoint (CORE_ADDR addr, int len, int type, +mips_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { if (mips_set_breakpoint (addr, len, type)) @@ -2429,7 +2429,7 @@ mips_insert_watchpoint (CORE_ADDR addr, int len, int type, /* Remove a watchpoint. */ static int -mips_remove_watchpoint (CORE_ADDR addr, int len, int type, +mips_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { if (mips_clear_breakpoint (addr, len, type)) @@ -2451,7 +2451,7 @@ mips_stopped_by_watchpoint (void) /* Insert a breakpoint. */ static int -mips_set_breakpoint (CORE_ADDR addr, int len, enum break_type type) +mips_set_breakpoint (CORE_ADDR addr, LONGEST len, enum break_type type) { return mips_common_breakpoint (1, addr, len, type); } @@ -2460,7 +2460,7 @@ mips_set_breakpoint (CORE_ADDR addr, int len, enum break_type type) /* Clear a breakpoint. */ static int -mips_clear_breakpoint (CORE_ADDR addr, int len, enum break_type type) +mips_clear_breakpoint (CORE_ADDR addr, LONGEST len, enum break_type type) { return mips_common_breakpoint (0, addr, len, type); } diff --git a/gdb/remote.c b/gdb/remote.c index 80e889f..77fa0c1 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -7953,7 +7953,7 @@ watchpoint_to_Z_packet (int type) } static int -remote_insert_watchpoint (CORE_ADDR addr, int len, int type, +remote_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct remote_state *rs = get_remote_state (); @@ -7968,7 +7968,7 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); - xsnprintf (p, endbuf - p, ",%x", len); + xsnprintf (p, endbuf - p, ",%s", int_string (len, 16, 1, 0, 0)); putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); @@ -7997,7 +7997,7 @@ remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, static int -remote_remove_watchpoint (CORE_ADDR addr, int len, int type, +remote_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct remote_state *rs = get_remote_state (); @@ -8012,7 +8012,7 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); - xsnprintf (p, endbuf - p, ",%x", len); + xsnprintf (p, endbuf - p, ",%s", int_string (len, 16, 1, 0, 0)); putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); @@ -8034,7 +8034,7 @@ int remote_hw_watchpoint_length_limit = -1; int remote_hw_breakpoint_limit = -1; static int -remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { if (remote_hw_watchpoint_length_limit == 0) return 0; diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c index acd36c2..97afb36 100644 --- a/gdb/rl78-tdep.c +++ b/gdb/rl78-tdep.c @@ -1019,8 +1019,8 @@ rl78_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); - int len = TYPE_LENGTH (value_type); - int container_len = (len + 1) & ~1; + LONGEST len = TYPE_LENGTH (value_type); + LONGEST container_len = (len + 1) & ~1; sp -= container_len; write_memory (rl78_make_data_address (sp), diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c index 59cfa73..d13bfe6 100644 --- a/gdb/rs6000-aix-tdep.c +++ b/gdb/rs6000-aix-tdep.c @@ -197,7 +197,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int ii; - int len = 0; + LONGEST len = 0; int argno; /* current argument number */ int argbytes; /* current argument byte */ gdb_byte tmp_buffer[50]; @@ -327,7 +327,7 @@ ran_out_of_registers_for_arguments: if ((argno < nargs) || argbytes) { - int space = 0, jj; + LONGEST space = 0, jj; if (argbytes) { diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c index 8637c0c..51a2465 100644 --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -710,10 +710,10 @@ rx_return_value (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST valtype_len = TYPE_LENGTH (valtype); - if (TYPE_LENGTH (valtype) > 16 + if (valtype_len > 16 || ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT || TYPE_CODE (valtype) == TYPE_CODE_UNION) - && TYPE_LENGTH (valtype) % 4 != 0)) + && valtype_len % 4 != 0)) return RETURN_VALUE_STRUCT_CONVENTION; if (readbuf) diff --git a/gdb/s390-nat.c b/gdb/s390-nat.c index bad1b43..3f41519 100644 --- a/gdb/s390-nat.c +++ b/gdb/s390-nat.c @@ -517,7 +517,7 @@ s390_fix_watch_points (struct lwp_info *lp) } static int -s390_insert_watchpoint (CORE_ADDR addr, int len, int type, +s390_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct lwp_info *lp; @@ -538,7 +538,7 @@ s390_insert_watchpoint (CORE_ADDR addr, int len, int type, } static int -s390_remove_watchpoint (CORE_ADDR addr, int len, int type, +s390_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct lwp_info *lp; @@ -572,7 +572,7 @@ s390_can_use_hw_breakpoint (int type, int cnt, int othertype) } static int -s390_region_ok_for_hw_watchpoint (CORE_ADDR addr, int cnt) +s390_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST cnt) { return 1; } diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 620eaea..671921d 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -376,7 +376,7 @@ s390_value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct value *value = default_value_from_register (type, regnum, frame); - int len = TYPE_LENGTH (check_typedef (type)); + LONGEST len = TYPE_LENGTH (check_typedef (type)); if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM && len < 8) set_value_offset (value, 0); @@ -2489,8 +2489,7 @@ is_power_of_two (unsigned int n) static int s390_function_arg_pass_by_reference (struct type *type) { - unsigned length = TYPE_LENGTH (type); - if (length > 8) + if (TYPE_LENGTH (type) > 8) return 1; return (is_struct_like (type) && !is_power_of_two (TYPE_LENGTH (type))) @@ -2503,8 +2502,7 @@ s390_function_arg_pass_by_reference (struct type *type) static int s390_function_arg_float (struct type *type) { - unsigned length = TYPE_LENGTH (type); - if (length > 8) + if (TYPE_LENGTH (type) > 8) return 0; return is_float_like (type); @@ -2616,11 +2614,10 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); - unsigned length = TYPE_LENGTH (type); if (s390_function_arg_pass_by_reference (type)) { - sp -= length; + sp -= TYPE_LENGTH (type); sp = align_down (sp, alignment_of (type)); copy_addr[i] = sp; } @@ -2669,7 +2666,7 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); - unsigned length = TYPE_LENGTH (type); + ULONGEST length = TYPE_LENGTH (type); if (s390_function_arg_pass_by_reference (type)) { @@ -2799,8 +2796,7 @@ s390_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) static enum return_value_convention s390_return_value_convention (struct gdbarch *gdbarch, struct type *type) { - int length = TYPE_LENGTH (type); - if (length > 8) + if (TYPE_LENGTH (type) > 8) return RETURN_VALUE_STRUCT_CONVENTION; switch (TYPE_CODE (type)) @@ -2824,7 +2820,7 @@ s390_return_value (struct gdbarch *gdbarch, struct value *function, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int word_size = gdbarch_ptr_bit (gdbarch) / 8; enum return_value_convention rvc; - int length; + LONGEST length; type = check_typedef (type); rvc = s390_return_value_convention (gdbarch, type); diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c index fb25806..5711d99 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -515,7 +515,7 @@ score_push_dummy_call (struct gdbarch *gdbarch, struct value *function, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argnum; int argreg; - int arglen = 0; + LONGEST arglen = 0; CORE_ADDR stack_offset = 0; CORE_ADDR addr = 0; diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index ec1151b..523bd6e 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -1308,7 +1308,7 @@ sh_extract_return_value_nofpu (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int return_register = R0_REGNUM; int offset; @@ -1362,7 +1362,7 @@ sh_store_return_value_nofpu (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index c8b1c04..685ad83 100644 --- a/gdb/sh64-tdep.c +++ b/gdb/sh64-tdep.c @@ -1058,7 +1058,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int stack_offset, stack_alloc; + LONGEST stack_offset, stack_alloc; int int_argreg; int float_argreg; int double_argreg; @@ -1069,7 +1069,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR regval; char *val; char valbuf[8]; - int len; + LONGEST len; int argreg_size; int fp_args[12]; @@ -1228,7 +1228,7 @@ sh64_extract_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_FLT) { @@ -1290,7 +1290,7 @@ sh64_store_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); char buf[64]; /* more than enough... */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_FLT) { diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 6da2297..0cacfd7 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -470,7 +470,7 @@ sparc32_store_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (sparc_structure_or_union_p (type) || (sparc_floating_p (type) && len == 16) diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index 28c9ca4..e5e5b84 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -639,7 +639,8 @@ sparc64_16_byte_align_p (struct type *type) static void sparc64_store_floating_fields (struct regcache *regcache, struct type *type, - const gdb_byte *valbuf, int element, int bitpos) + const gdb_byte *valbuf, int element, + LONGEST bitpos) { int len = TYPE_LENGTH (type); @@ -681,7 +682,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); sparc64_store_floating_fields (regcache, subtype, valbuf, element, subpos); @@ -713,7 +714,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, static void sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, - gdb_byte *valbuf, int bitpos) + gdb_byte *valbuf, LONGEST bitpos) { if (sparc64_floating_p (type)) { @@ -750,7 +751,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos); } @@ -783,7 +784,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (sparc64_structure_or_union_p (type) || (sparc64_complex_floating_p (type) && len == 32)) diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c index 8d4ef57..2ab3327 100644 --- a/gdb/spu-multiarch.c +++ b/gdb/spu-multiarch.c @@ -118,7 +118,7 @@ spu_thread_architecture (struct target_ops *ops, ptid_t ptid) /* Override the to_region_ok_for_hw_watchpoint routine. */ static int -spu_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +spu_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { struct target_ops *ops_beneath = find_target_beneath (&spu_ops); while (ops_beneath && !ops_beneath->to_region_ok_for_hw_watchpoint) diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index f05a26b..f628d30 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -316,7 +316,7 @@ spu_value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct value *value = default_value_from_register (type, regnum, frame); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (regnum < SPU_NUM_GPRS && len < 16) { diff --git a/gdb/stack.c b/gdb/stack.c index 02e36ca..e71c56b 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -354,7 +354,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame, if (val && entryval && !ui_out_is_mi_like_p (current_uiout)) { - unsigned len = TYPE_LENGTH (value_type (val)); + ULONGEST len = TYPE_LENGTH (value_type (val)); if (!value_optimized_out (val) && value_lazy (val)) value_fetch_lazy (val); @@ -373,7 +373,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame, TRY_CATCH (except, RETURN_MASK_ERROR) { - unsigned len_deref; + ULONGEST len_deref; val_deref = coerce_ref (val); if (value_lazy (val_deref)) @@ -532,8 +532,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame, case LOC_ARG: case LOC_REF_ARG: { - long current_offset = SYMBOL_VALUE (sym); - int arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); + LONGEST current_offset = SYMBOL_VALUE (sym); + LONGEST arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); /* Compute address of next argument by adding the size of this argument and rounding to an int boundary. */ diff --git a/gdb/symmisc.c b/gdb/symmisc.c index d5a737b..cb94cb4 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -517,11 +517,11 @@ print_symbol (void *args) case LOC_CONST_BYTES: { - unsigned i; + ULONGEST i; struct type *type = check_typedef (SYMBOL_TYPE (symbol)); - fprintf_filtered (outfile, "const %u hex bytes:", - TYPE_LENGTH (type)); + fprintf_filtered (outfile, "const %s hex bytes:", + pulongest (TYPE_LENGTH (type))); for (i = 0; i < TYPE_LENGTH (type); i++) fprintf_filtered (outfile, " %02x", (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]); diff --git a/gdb/target.c b/gdb/target.c index a074188..325e3f8 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -51,7 +51,7 @@ static void default_terminal_info (char *, int); static int default_watchpoint_addr_within_range (struct target_ops *, CORE_ADDR, CORE_ADDR, int); -static int default_region_ok_for_hw_watchpoint (CORE_ADDR, int); +static int default_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); static void tcomplain (void) ATTRIBUTE_NORETURN; @@ -114,10 +114,10 @@ static int debug_to_insert_hw_breakpoint (struct gdbarch *, static int debug_to_remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *); -static int debug_to_insert_watchpoint (CORE_ADDR, int, int, +static int debug_to_insert_watchpoint (CORE_ADDR, LONGEST, int, struct expression *); -static int debug_to_remove_watchpoint (CORE_ADDR, int, int, +static int debug_to_remove_watchpoint (CORE_ADDR, LONGEST, int, struct expression *); static int debug_to_stopped_by_watchpoint (void); @@ -127,9 +127,9 @@ static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); static int debug_to_watchpoint_addr_within_range (struct target_ops *, CORE_ADDR, CORE_ADDR, int); -static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, int); +static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); -static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, int, int, +static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, LONGEST, int, struct expression *); static void debug_to_terminal_init (void); @@ -750,10 +750,10 @@ update_current_target (void) (int (*) (struct gdbarch *, struct bp_target_info *)) return_minus_one); de_fault (to_insert_watchpoint, - (int (*) (CORE_ADDR, int, int, struct expression *)) + (int (*) (CORE_ADDR, LONGEST, int, struct expression *)) return_minus_one); de_fault (to_remove_watchpoint, - (int (*) (CORE_ADDR, int, int, struct expression *)) + (int (*) (CORE_ADDR, LONGEST, int, struct expression *)) return_minus_one); de_fault (to_stopped_by_watchpoint, (int (*) (void)) @@ -766,7 +766,7 @@ update_current_target (void) de_fault (to_region_ok_for_hw_watchpoint, default_region_ok_for_hw_watchpoint); de_fault (to_can_accel_watchpoint_condition, - (int (*) (CORE_ADDR, int, int, struct expression *)) + (int (*) (CORE_ADDR, LONGEST, int, struct expression *)) return_zero); de_fault (to_terminal_init, (void (*) (void)) @@ -3542,7 +3542,7 @@ target_fileio_read_stralloc (const char *filename) static int -default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +default_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { return (len <= gdbarch_ptr_bit (target_gdbarch) / TARGET_CHAR_BIT); } @@ -4193,7 +4193,7 @@ debug_to_can_use_hw_breakpoint (int type, int cnt, int from_tty) } static int -debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { CORE_ADDR retval; @@ -4207,7 +4207,7 @@ debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) } static int -debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, +debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { int retval; @@ -4217,8 +4217,8 @@ debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, fprintf_unfiltered (gdb_stdlog, "target_can_accel_watchpoint_condition " - "(%s, %d, %d, %s) = %ld\n", - core_addr_to_string (addr), len, rw, + "(%s, %s, %d, %s) = %ld\n", + core_addr_to_string (addr), plongest (len), rw, host_address_to_string (cond), (unsigned long) retval); return retval; } @@ -4298,7 +4298,7 @@ debug_to_remove_hw_breakpoint (struct gdbarch *gdbarch, } static int -debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type, +debug_to_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int retval; @@ -4306,14 +4306,14 @@ debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type, retval = debug_target.to_insert_watchpoint (addr, len, type, cond); fprintf_unfiltered (gdb_stdlog, - "target_insert_watchpoint (%s, %d, %d, %s) = %ld\n", - core_addr_to_string (addr), len, type, + "target_insert_watchpoint (%s, %s, %d, %s) = %ld\n", + core_addr_to_string (addr), plongest (len), type, host_address_to_string (cond), (unsigned long) retval); return retval; } static int -debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type, +debug_to_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int retval; @@ -4321,8 +4321,8 @@ debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type, retval = debug_target.to_remove_watchpoint (addr, len, type, cond); fprintf_unfiltered (gdb_stdlog, - "target_remove_watchpoint (%s, %d, %d, %s) = %ld\n", - core_addr_to_string (addr), len, type, + "target_remove_watchpoint (%s, %s, %d, %s) = %ld\n", + core_addr_to_string (addr), plongest (len), type, host_address_to_string (cond), (unsigned long) retval); return retval; } diff --git a/gdb/target.h b/gdb/target.h index 99ce3b7..6464bc5 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -462,8 +462,8 @@ struct target_ops /* Documentation of what the two routines below are expected to do is provided with the corresponding target_* macros. */ - int (*to_remove_watchpoint) (CORE_ADDR, int, int, struct expression *); - int (*to_insert_watchpoint) (CORE_ADDR, int, int, struct expression *); + int (*to_remove_watchpoint) (CORE_ADDR, LONGEST, int, struct expression *); + int (*to_insert_watchpoint) (CORE_ADDR, LONGEST, int, struct expression *); int (*to_insert_mask_watchpoint) (struct target_ops *, CORE_ADDR, CORE_ADDR, int); @@ -478,9 +478,9 @@ struct target_ops /* Documentation of this routine is provided with the corresponding target_* macro. */ - int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, int); + int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, LONGEST); - int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int, + int (*to_can_accel_watchpoint_condition) (CORE_ADDR, LONGEST, int, struct expression *); int (*to_masked_watch_num_registers) (struct target_ops *, CORE_ADDR, CORE_ADDR); diff --git a/gdb/testsuite/gdb.base/structs-longest-bitpos.c b/gdb/testsuite/gdb.base/structs-longest-bitpos.c new file mode 100644 index 0000000..1394c08 --- /dev/null +++ b/gdb/testsuite/gdb.base/structs-longest-bitpos.c @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +struct foo +{ + char buf[0xffff000000]; + char buf2[2]; +} *f; + +int +main (void) +{ + return 0; +} diff --git a/gdb/testsuite/gdb.base/structs-longest-bitpos.exp b/gdb/testsuite/gdb.base/structs-longest-bitpos.exp new file mode 100644 index 0000000..fa03f64 --- /dev/null +++ b/gdb/testsuite/gdb.base/structs-longest-bitpos.exp @@ -0,0 +1,30 @@ +# This testcase is part of GDB, the GNU debugger. + +# Copyright 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set testfile "structs-longest-bitpos" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +if { [prepare_for_testing ${testfile}.exp ${testfile}] } { + return -1 +} + +# The array size should not overflow +gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0} + +# The offset should not overflow +gdb_test "print &f->buf2" {= \(char \(\*\)\[2\]\) 0xffff000000} diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 63f66c7..ed636ba 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -967,7 +967,7 @@ collect_symbol (struct collection_list *collect, long frame_regno, long frame_offset, CORE_ADDR scope) { - unsigned long len; + ULONGEST len; unsigned int reg; bfd_signed_vma offset; int treat_as_expr = 0; @@ -991,8 +991,8 @@ collect_symbol (struct collection_list *collect, char tmp[40]; sprintf_vma (tmp, offset); - printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n", - SYMBOL_PRINT_NAME (sym), len, + printf_filtered ("LOC_STATIC %s: collect %s bytes at %s.\n", + SYMBOL_PRINT_NAME (sym), pulongest (len), tmp /* address */); } /* A struct may be a C++ class with static fields, go to general @@ -1024,8 +1024,8 @@ collect_symbol (struct collection_list *collect, offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { - printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset ", - SYMBOL_PRINT_NAME (sym), len); + printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset ", + SYMBOL_PRINT_NAME (sym), pulongest (len)); printf_vma (offset); printf_filtered (" from frame ptr reg %d\n", reg); } @@ -1036,8 +1036,8 @@ collect_symbol (struct collection_list *collect, offset = 0; if (info_verbose) { - printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset ", - SYMBOL_PRINT_NAME (sym), len); + printf_filtered ("LOC_REGPARM_ADDR %s: Collect %s bytes at offset ", + SYMBOL_PRINT_NAME (sym), pulongest (len)); printf_vma (offset); printf_filtered (" from reg %d\n", reg); } @@ -1048,8 +1048,8 @@ collect_symbol (struct collection_list *collect, offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { - printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset ", - SYMBOL_PRINT_NAME (sym), len); + printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset ", + SYMBOL_PRINT_NAME (sym), pulongest (len)); printf_vma (offset); printf_filtered (" from frame ptr reg %d\n", reg); } @@ -1448,7 +1448,8 @@ encode_actions_1 (struct command_line *action, } else { - unsigned long addr, len; + CORE_ADDR addr; + ULONGEST len; struct cleanup *old_chain = NULL; struct cleanup *old_chain1 = NULL; @@ -2613,7 +2614,8 @@ scope_info (char *args, int from_tty) const char *symname; char *save_args = args; struct block_iterator iter; - int j, count = 0; + int count = 0; + LONGEST j; struct gdbarch *gdbarch; int regno; @@ -2743,8 +2745,11 @@ scope_info (char *args, int from_tty) break; } if (SYMBOL_TYPE (sym)) - printf_filtered (", length %d.\n", - TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)))); + { + ULONGEST len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))); + + printf_filtered (", length %s.\n", pulongest (len)); + } } if (BLOCK_FUNCTION (block)) break; diff --git a/gdb/typeprint.c b/gdb/typeprint.c index c25e705..4bbf8a7 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -118,7 +118,7 @@ whatis_exp (char *exp, int show) struct type *real_type = NULL; struct type *type; int full = 0; - int top = -1; + LONGEST top = -1; int using_enc = 0; struct value_print_options opts; diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index e374df8..4775ab6 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -809,7 +809,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argreg; int argnum; - int len = 0; + LONGEST len = 0; int stack_offset; /* The offset onto the stack at which we will start copying parameters @@ -890,7 +890,7 @@ v850_extract_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= v850_reg_size) { @@ -917,7 +917,7 @@ v850_store_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= v850_reg_size) regcache_cooked_write_unsigned diff --git a/gdb/valarith.c b/gdb/valarith.c index 0225339..2c1ec5b 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -196,8 +196,8 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) { struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); - unsigned int elt_size = TYPE_LENGTH (elt_type); - unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound); + ULONGEST elt_size = TYPE_LENGTH (elt_type); + ULONGEST elt_offs = elt_size * (index - lowerbound); struct value *v; if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) @@ -1474,7 +1474,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) int value_logical_not (struct value *arg1) { - int len; + LONGEST len; const gdb_byte *p; struct type *type1; @@ -1505,8 +1505,8 @@ value_logical_not (struct value *arg1) static int value_strcmp (struct value *arg1, struct value *arg2) { - int len1 = TYPE_LENGTH (value_type (arg1)); - int len2 = TYPE_LENGTH (value_type (arg2)); + LONGEST len1 = TYPE_LENGTH (value_type (arg1)); + LONGEST len2 = TYPE_LENGTH (value_type (arg2)); const gdb_byte *s1 = value_contents (arg1); const gdb_byte *s2 = value_contents (arg2); int i, len = len1 < len2 ? len1 : len2; diff --git a/gdb/valops.c b/gdb/valops.c index feb47f5..fbe3f5d 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -53,11 +53,11 @@ static int typecmp (int staticp, int varargs, int nargs, struct field t1[], struct value *t2[]); static struct value *search_struct_field (const char *, struct value *, - int, struct type *, int); + LONGEST, struct type *, int); static struct value *search_struct_method (const char *, struct value **, struct value **, - int, int *, struct type *); + LONGEST, int *, struct type *); static int find_oload_champ_namespace (struct value **, int, const char *, const char *, @@ -85,7 +85,7 @@ oload_classification classify_oload_match (struct badness_vector *, int, int); static struct value *value_struct_elt_for_reference (struct type *, - int, struct type *, + LONGEST, struct type *, char *, struct type *, int, enum noside); @@ -102,8 +102,8 @@ static CORE_ADDR allocate_space_in_inferior (int); static struct value *cast_into_complex (struct type *, struct value *); static struct fn_field *find_method_list (struct value **, const char *, - int, struct type *, int *, - struct type **, int *); + LONGEST, struct type *, int *, + struct type **, LONGEST *); void _initialize_valops (void); @@ -188,7 +188,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) space. */ struct value * -value_allocate_space_in_inferior (int len) +value_allocate_space_in_inferior (LONGEST len) { struct objfile *objf; struct value *val = find_function_in_inferior ("malloc", &objf); @@ -261,7 +261,8 @@ value_cast_structs (struct type *type, struct value *v2) if (TYPE_NAME (t2) != NULL) { /* Try downcasting using the run-time type of the value. */ - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct type *real_type; real_type = value_rtti_type (v2, &full, &top, &using_enc); @@ -400,12 +401,12 @@ value_cast (struct type *type, struct value *arg2) if (code1 == TYPE_CODE_ARRAY) { struct type *element_type = TYPE_TARGET_TYPE (type); - unsigned element_length = TYPE_LENGTH (check_typedef (element_type)); + ULONGEST element_length = TYPE_LENGTH (check_typedef (element_type)); if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) { struct type *range_type = TYPE_INDEX_TYPE (type); - int val_length = TYPE_LENGTH (type2); + LONGEST val_length = TYPE_LENGTH (type2); LONGEST low_bound, high_bound, new_length; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) @@ -655,7 +656,7 @@ value_reinterpret_cast (struct type *type, struct value *arg) static int dynamic_cast_check_1 (struct type *desired_type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct value *val, struct type *search_type, @@ -667,8 +668,8 @@ dynamic_cast_check_1 (struct type *desired_type, for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) { - int offset = baseclass_offset (search_type, i, valaddr, embedded_offset, - address, val); + LONGEST offset = baseclass_offset (search_type, i, valaddr, + embedded_offset, address, val); if (class_types_same_p (desired_type, TYPE_BASECLASS (search_type, i))) { @@ -702,7 +703,7 @@ dynamic_cast_check_1 (struct type *desired_type, static int dynamic_cast_check_2 (struct type *desired_type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct value *val, struct type *search_type, @@ -712,7 +713,7 @@ dynamic_cast_check_2 (struct type *desired_type, for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) { - int offset; + LONGEST offset; if (! BASETYPE_VIA_PUBLIC (search_type, i)) continue; @@ -743,7 +744,8 @@ dynamic_cast_check_2 (struct type *desired_type, struct value * value_dynamic_cast (struct type *type, struct value *arg) { - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct type *resolved_type = check_typedef (type); struct type *arg_type = check_typedef (value_type (arg)); struct type *class_type, *rtti_type; @@ -994,7 +996,7 @@ value_fetch_lazy (struct value *val) struct value *parent = value_parent (val); LONGEST offset = value_offset (val); LONGEST num; - int length = TYPE_LENGTH (type); + LONGEST length = TYPE_LENGTH (type); if (!value_bits_valid (val, TARGET_CHAR_BIT * offset + value_bitpos (val), @@ -1016,7 +1018,8 @@ value_fetch_lazy (struct value *val) else if (VALUE_LVAL (val) == lval_memory) { CORE_ADDR addr = value_address (val); - int length = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); + struct type *enclosing_type = value_enclosing_type (val); + LONGEST length = TYPE_LENGTH (check_typedef (enclosing_type)); if (length) read_value_memory (val, 0, value_stack (val), @@ -1260,7 +1263,7 @@ value_assign (struct value *toval, struct value *fromval) { const gdb_byte *dest_buffer; CORE_ADDR changed_addr; - int changed_len; + LONGEST changed_len; gdb_byte buffer[sizeof (LONGEST)]; if (value_bitsize (toval)) @@ -1333,7 +1336,7 @@ value_assign (struct value *toval, struct value *fromval) if (value_bitsize (toval)) { struct value *parent = value_parent (toval); - int offset = value_offset (parent) + value_offset (toval); + LONGEST offset = value_offset (parent) + value_offset (toval); int changed_len; gdb_byte buffer[sizeof (LONGEST)]; int optim, unavail; @@ -1798,7 +1801,7 @@ value_array (int lowbound, int highbound, struct value **elemvec) { int nelem; int idx; - unsigned int typelength; + ULONGEST typelength; struct value *val; struct type *arraytype; @@ -2010,7 +2013,7 @@ update_search_result (struct value **result_ptr, struct value *v, lookup is ambiguous. */ static void -do_search_struct_field (const char *name, struct value *arg1, int offset, +do_search_struct_field (const char *name, struct value *arg1, LONGEST offset, struct type *type, int looking_for_baseclass, struct value **result_ptr, int *last_boffset, @@ -2068,7 +2071,7 @@ do_search_struct_field (const char *name, struct value *arg1, int offset, <variant field>. */ struct value *v = NULL; - int new_offset = offset; + LONGEST new_offset = offset; /* This is pretty gross. In G++, the offset in an anonymous union is relative to the beginning of the @@ -2107,7 +2110,7 @@ do_search_struct_field (const char *name, struct value *arg1, int offset, && (strcmp_iw (name, TYPE_BASECLASS_NAME (type, i)) == 0)); - int boffset = value_embedded_offset (arg1) + offset; + LONGEST boffset = value_embedded_offset (arg1) + offset; if (BASETYPE_VIA_VIRTUAL (type, i)) { @@ -2182,7 +2185,7 @@ do_search_struct_field (const char *name, struct value *arg1, int offset, fields, look for a baseclass named NAME. */ static struct value * -search_struct_field (const char *name, struct value *arg1, int offset, +search_struct_field (const char *name, struct value *arg1, LONGEST offset, struct type *type, int looking_for_baseclass) { struct value *result = NULL; @@ -2203,7 +2206,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, static struct value * search_struct_method (const char *name, struct value **arg1p, - struct value **args, int offset, + struct value **args, LONGEST offset, int *static_memfuncp, struct type *type) { int i; @@ -2267,9 +2270,9 @@ search_struct_method (const char *name, struct value **arg1p, for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { - int base_offset; + LONGEST base_offset; int skip = 0; - int this_offset; + LONGEST this_offset; if (BASETYPE_VIA_VIRTUAL (type, i)) { @@ -2445,8 +2448,8 @@ value_struct_elt (struct value **argp, struct value **args, static struct fn_field * find_method_list (struct value **argp, const char *method, - int offset, struct type *type, int *num_fns, - struct type **basetype, int *boffset) + LONGEST offset, struct type *type, int *num_fns, + struct type **basetype, LONGEST *boffset) { int i; struct fn_field *f; @@ -2479,7 +2482,7 @@ find_method_list (struct value **argp, const char *method, /* Not found in object, check in base subobjects. */ for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { - int base_offset; + LONGEST base_offset; if (BASETYPE_VIA_VIRTUAL (type, i)) { @@ -2515,7 +2518,7 @@ find_method_list (struct value **argp, const char *method, struct fn_field * value_find_oload_method_list (struct value **argp, const char *method, int offset, int *num_fns, - struct type **basetype, int *boffset) + struct type **basetype, LONGEST *boffset) { struct type *t; @@ -2607,7 +2610,7 @@ find_overload_match (struct value **args, int nargs, /* Number of overloaded instances being considered. */ int num_fns = 0; struct type *basetype = NULL; - int boffset; + LONGEST boffset; struct cleanup *all_cleanups = make_cleanup (null_cleanup, NULL); @@ -3314,7 +3317,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) the form "DOMAIN::NAME". */ static struct value * -value_struct_elt_for_reference (struct type *domain, int offset, +value_struct_elt_for_reference (struct type *domain, LONGEST offset, struct type *curtype, char *name, struct type *intype, int want_address, @@ -3351,7 +3354,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, if (want_address) return value_from_longest (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), - offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3)); + offset + (TYPE_FIELD_BITPOS (t, i) >> 3)); else if (noside == EVAL_AVOID_SIDE_EFFECTS) return allocate_value (TYPE_FIELD_TYPE (t, i)); else @@ -3494,7 +3497,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; - int base_offset; + LONGEST base_offset; if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; @@ -3584,7 +3587,7 @@ value_maybe_namespace_elt (const struct type *curtype, struct type * value_rtti_indirect_type (struct value *v, int *full, - int *top, int *using_enc) + LONGEST *top, int *using_enc) { struct value *target; struct type *type, *real_type, *target_type; @@ -3634,12 +3637,12 @@ value_rtti_indirect_type (struct value *v, int *full, struct value * value_full_object (struct value *argp, struct type *rtype, - int xfull, int xtop, + int xfull, LONGEST xtop, int xusing_enc) { struct type *real_type; int full = 0; - int top = -1; + LONGEST top = -1; int using_enc = 0; struct value *new_val; diff --git a/gdb/valprint.c b/gdb/valprint.c index fc5942d..17b1316 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -264,7 +264,7 @@ scalar_type_p (struct type *type) int valprint_check_validity (struct ui_file *stream, struct type *type, - int embedded_offset, + LONGEST embedded_offset, const struct value *val) { CHECK_TYPEDEF (type); @@ -328,7 +328,7 @@ val_print_invalid_address (struct ui_file *stream) void generic_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, @@ -691,7 +691,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr, RECURSE. */ void -val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -903,7 +903,7 @@ val_print_type_code_flags (struct type *type, const gdb_byte *valaddr, void val_print_scalar_formatted (struct type *type, - const gdb_byte *valaddr, int embedded_offset, + const gdb_byte *valaddr, LONGEST embedded_offset, const struct value *val, const struct value_print_options *options, int size, @@ -1444,7 +1444,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr, void print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr, - unsigned len, enum bfd_endian byte_order) + ULONGEST len, enum bfd_endian byte_order) { const gdb_byte *p; @@ -1561,7 +1561,7 @@ maybe_print_array_index (struct type *index_type, LONGEST index, void val_print_array_elements (struct type *type, - const gdb_byte *valaddr, int embedded_offset, + const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -1569,9 +1569,9 @@ val_print_array_elements (struct type *type, unsigned int i) { unsigned int things_printed = 0; - unsigned len; + ULONGEST len; struct type *elttype, *index_type; - unsigned eltlen; + ULONGEST eltlen; /* Position of the array element we are examining to see whether it is repeated. */ unsigned int rep1; @@ -2058,7 +2058,7 @@ generic_emit_char (int c, struct type *type, struct ui_file *stream, void generic_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options) diff --git a/gdb/valprint.h b/gdb/valprint.h index b853b1a..dc5d329 100644 --- a/gdb/valprint.h +++ b/gdb/valprint.h @@ -117,7 +117,7 @@ extern void maybe_print_array_index (struct type *index_type, LONGEST index, struct ui_file *stream, const struct value_print_options *); -extern void val_print_array_elements (struct type *, const gdb_byte *, int, +extern void val_print_array_elements (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -131,7 +131,7 @@ extern void val_print_type_code_flags (struct type *type, struct ui_file *stream); extern void val_print_scalar_formatted (struct type *, - const gdb_byte *, int, + const gdb_byte *, LONGEST, const struct value *, const struct value_print_options *, int, @@ -147,7 +147,7 @@ extern void print_decimal_chars (struct ui_file *, const gdb_byte *, unsigned int, enum bfd_endian); extern void print_hex_chars (struct ui_file *, const gdb_byte *, - unsigned int, enum bfd_endian); + ULONGEST, enum bfd_endian); extern void print_char_chars (struct ui_file *, struct type *, const gdb_byte *, unsigned int, enum bfd_endian); @@ -191,7 +191,7 @@ struct generic_val_print_decorations extern void generic_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, @@ -201,7 +201,7 @@ extern void generic_emit_char (int c, struct type *type, struct ui_file *stream, int quoter, const char *encoding); extern void generic_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options); diff --git a/gdb/value.c b/gdb/value.c index c64e55b..7634325 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -67,10 +67,10 @@ struct internal_function struct range { /* Lowest offset in the range. */ - int offset; + LONGEST offset; /* Length of the range. */ - int length; + LONGEST length; }; typedef struct range range_s; @@ -81,8 +81,8 @@ DEF_VEC_O(range_s); [offset2, offset2+len2) overlap. */ static int -ranges_overlap (int offset1, int len1, - int offset2, int len2) +ranges_overlap (LONGEST offset1, LONGEST len1, + LONGEST offset2, LONGEST len2) { ULONGEST h, l; @@ -106,7 +106,7 @@ range_lessthan (const range_s *r1, const range_s *r2) OFFSET+LENGTH). */ static int -ranges_contain (VEC(range_s) *ranges, int offset, int length) +ranges_contain (VEC(range_s) *ranges, LONGEST offset, LONGEST length) { range_s what; int i; @@ -239,7 +239,7 @@ struct value lval == lval_register, this is a further offset from location.address within the registers structure. Note also the member embedded_offset below. */ - int offset; + LONGEST offset; /* Only used for bitfields; number of bits contained in them. */ int bitsize; @@ -309,8 +309,8 @@ struct value `type', and `embedded_offset' is zero, so everything works normally. */ struct type *enclosing_type; - int embedded_offset; - int pointed_to_offset; + LONGEST embedded_offset; + LONGEST pointed_to_offset; /* Values are stored in a chain, so that they can be deleted easily over calls to the inferior. Values assigned to internal @@ -332,7 +332,8 @@ struct value }; int -value_bytes_available (const struct value *value, int offset, int length) +value_bytes_available (const struct value *value, LONGEST offset, + LONGEST length) { gdb_assert (!value->lazy); @@ -353,7 +354,8 @@ value_entirely_available (struct value *value) } void -mark_value_bytes_unavailable (struct value *value, int offset, int length) +mark_value_bytes_unavailable (struct value *value, LONGEST offset, + LONGEST length) { range_s newr; int i; @@ -524,7 +526,7 @@ mark_value_bytes_unavailable (struct value *value, int offset, int length) static int find_first_range_overlap (VEC(range_s) *ranges, int pos, - int offset, int length) + LONGEST offset, LONGEST length) { range_s *r; int i; @@ -537,9 +539,9 @@ find_first_range_overlap (VEC(range_s) *ranges, int pos, } int -value_available_contents_eq (const struct value *val1, int offset1, - const struct value *val2, int offset2, - int length) +value_available_contents_eq (const struct value *val1, LONGEST offset1, + const struct value *val2, LONGEST offset2, + LONGEST length) { int idx1 = 0, idx2 = 0; @@ -767,13 +769,13 @@ deprecated_set_value_type (struct value *value, struct type *type) value->type = type; } -int +LONGEST value_offset (const struct value *value) { return value->offset; } void -set_value_offset (struct value *value, int offset) +set_value_offset (struct value *value, LONGEST offset) { value->offset = offset; } @@ -923,8 +925,9 @@ value_contents_all (struct value *value) DST_OFFSET+LENGTH) range are wholly available. */ void -value_contents_copy_raw (struct value *dst, int dst_offset, - struct value *src, int src_offset, int length) +value_contents_copy_raw (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, + LONGEST length) { range_s *r; int i; @@ -972,8 +975,8 @@ value_contents_copy_raw (struct value *dst, int dst_offset, DST_OFFSET+LENGTH) range are wholly available. */ void -value_contents_copy (struct value *dst, int dst_offset, - struct value *src, int src_offset, int length) +value_contents_copy (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, LONGEST length) { require_not_optimized_out (src); @@ -1033,7 +1036,7 @@ value_contents_equal (struct value *val1, struct value *val2) { struct type *type1; struct type *type2; - int len; + LONGEST len; type1 = check_typedef (value_type (val1)); type2 = check_typedef (value_type (val2)); @@ -1068,7 +1071,7 @@ value_entirely_optimized_out (const struct value *value) } int -value_bits_valid (const struct value *value, int offset, int length) +value_bits_valid (const struct value *value, LONGEST offset, LONGEST length) { if (!value->optimized_out) return 1; @@ -1081,7 +1084,7 @@ value_bits_valid (const struct value *value, int offset, int length) int value_bits_synthetic_pointer (const struct value *value, - int offset, int length) + LONGEST offset, LONGEST length) { if (value->lval != lval_computed || !value->location.computed.funcs->check_synthetic_pointer) @@ -1091,26 +1094,26 @@ value_bits_synthetic_pointer (const struct value *value, length); } -int +LONGEST value_embedded_offset (struct value *value) { return value->embedded_offset; } void -set_value_embedded_offset (struct value *value, int val) +set_value_embedded_offset (struct value *value, LONGEST val) { value->embedded_offset = val; } -int +LONGEST value_pointed_to_offset (struct value *value) { return value->pointed_to_offset; } void -set_value_pointed_to_offset (struct value *value, int val) +set_value_pointed_to_offset (struct value *value, LONGEST val) { value->pointed_to_offset = val; } @@ -1913,7 +1916,7 @@ get_internalvar_function (struct internalvar *var, } void -set_internalvar_component (struct internalvar *var, int offset, int bitpos, +set_internalvar_component (struct internalvar *var, LONGEST offset, int bitpos, int bitsize, struct value *newval) { gdb_byte *addr; @@ -2582,7 +2585,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type) FIELDNO says which field. */ struct value * -value_primitive_field (struct value *arg1, int offset, +value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type) { struct value *v; @@ -2612,8 +2615,8 @@ value_primitive_field (struct value *arg1, int offset, bit. Assume that the address, offset, and embedded offset are sufficiently aligned. */ - int bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); - int container_bitsize = TYPE_LENGTH (type) * 8; + LONGEST bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); + LONGEST container_bitsize = TYPE_LENGTH (type) * 8; v = allocate_value_lazy (type); v->bitsize = TYPE_FIELD_BITSIZE (arg_type, fieldno); @@ -2635,7 +2638,7 @@ value_primitive_field (struct value *arg1, int offset, /* This field is actually a base subobject, so preserve the entire object's contents for later references to virtual bases, etc. */ - int boffset; + LONGEST boffset; /* Lazy register values with offsets are not supported. */ if (VALUE_LVAL (arg1) == lval_register && value_lazy (arg1)) @@ -2712,7 +2715,7 @@ value_field (struct value *arg1, int fieldno) struct value * value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *type, - int offset) + LONGEST offset) { struct value *v; struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); @@ -2772,8 +2775,8 @@ value_fn_field (struct value **arg1p, struct fn_field *f, static int unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, int bitsize, - const struct value *original_value, + LONGEST embedded_offset, LONGEST bitpos, + int bitsize, const struct value *original_value, LONGEST *result) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (field_type)); @@ -2781,7 +2784,7 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, ULONGEST valmask; int lsbcount; int bytes_read; - int read_offset; + LONGEST read_offset; /* Read the minimum number of bytes required; there may not be enough bytes to read an entire ULONGEST. */ @@ -2851,7 +2854,7 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, int bitsize, + LONGEST embedded_offset, int bitpos, int bitsize, const struct value *original_value, LONGEST *result) { @@ -2869,10 +2872,10 @@ unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, static int unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result) { - int bitpos = TYPE_FIELD_BITPOS (type, fieldno); + LONGEST bitpos = TYPE_FIELD_BITPOS (type, fieldno); int bitsize = TYPE_FIELD_BITSIZE (type, fieldno); struct type *field_type = TYPE_FIELD_TYPE (type, fieldno); @@ -2888,7 +2891,7 @@ unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result) { gdb_assert (val != NULL); @@ -2920,7 +2923,7 @@ unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno) struct value * value_field_bitfield (struct type *type, int fieldno, const gdb_byte *valaddr, - int embedded_offset, const struct value *val) + LONGEST embedded_offset, const struct value *val) { LONGEST l; @@ -2947,12 +2950,12 @@ value_field_bitfield (struct type *type, int fieldno, void modify_field (struct type *type, gdb_byte *addr, - LONGEST fieldval, int bitpos, int bitsize) + LONGEST fieldval, LONGEST bitpos, int bitsize) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); ULONGEST oword; ULONGEST mask = (ULONGEST) -1 >> (8 * sizeof (ULONGEST) - bitsize); - int bytesize; + LONGEST bytesize; /* Normalize BITPOS. */ addr += bitpos / 8; diff --git a/gdb/value.h b/gdb/value.h index b630fc7..17a5626 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -82,8 +82,8 @@ extern void set_value_parent (struct value *value, struct value *parent); within the registers structure. Note also the member embedded_offset below. */ -extern int value_offset (const struct value *); -extern void set_value_offset (struct value *, int offset); +extern LONGEST value_offset (const struct value *); +extern void set_value_offset (struct value *, LONGEST offset); /* The comment from "struct value" reads: ``Is it modifiable? Only relevant if lval != not_lval.''. Shouldn't the value instead be @@ -154,10 +154,10 @@ extern struct type *value_actual_type (struct value *value, int resolve_simple_types, int *real_type_found); -extern int value_pointed_to_offset (struct value *value); -extern void set_value_pointed_to_offset (struct value *value, int val); -extern int value_embedded_offset (struct value *value); -extern void set_value_embedded_offset (struct value *value, int val); +extern LONGEST value_pointed_to_offset (struct value *value); +extern void set_value_pointed_to_offset (struct value *value, LONGEST val); +extern LONGEST value_embedded_offset (struct value *value); +extern void set_value_embedded_offset (struct value *value, LONGEST val); /* For lval_computed values, this structure holds functions used to retrieve and set the value (or portions of the value). @@ -185,7 +185,8 @@ struct lval_funcs /* Check the validity of some bits in VALUE. This should return 1 if all the bits starting at OFFSET and extending for LENGTH bits are valid, or 0 if any bit is invalid. */ - int (*check_validity) (const struct value *value, int offset, int length); + int (*check_validity) (const struct value *value, LONGEST offset, + LONGEST length); /* Return 1 if any bit in VALUE is valid, 0 if they are all invalid. */ int (*check_any_valid) (const struct value *value); @@ -203,7 +204,7 @@ struct lval_funcs /* If non-NULL, this is used to determine whether the indicated bits of VALUE are a synthetic pointer. */ int (*check_synthetic_pointer) (const struct value *value, - int offset, int length); + LONGEST offset, LONGEST length); /* Return a duplicate of VALUE's closure, for use in a new value. This may simply return the same closure, if VALUE's is @@ -240,7 +241,7 @@ extern struct value *allocate_computed_value (struct type *type, Otherwise, return 1. */ extern int valprint_check_validity (struct ui_file *stream, struct type *type, - int embedded_offset, + LONGEST embedded_offset, const struct value *val); extern struct value *allocate_optimized_out_value (struct type *type); @@ -411,13 +412,13 @@ extern struct value *coerce_array (struct value *value); bits in the given range are valid, zero if any bit is invalid. */ extern int value_bits_valid (const struct value *value, - int offset, int length); + LONGEST offset, LONGEST length); /* Given a value, determine whether the bits starting at OFFSET and extending for LENGTH bits are a synthetic pointer. */ extern int value_bits_synthetic_pointer (const struct value *value, - int offset, int length); + LONGEST offset, LONGEST length); /* Given a value, determine whether the contents bytes starting at OFFSET and extending for LENGTH bytes are available. This returns @@ -425,7 +426,7 @@ extern int value_bits_synthetic_pointer (const struct value *value, byte is unavailable. */ extern int value_bytes_available (const struct value *value, - int offset, int length); + LONGEST offset, LONGEST length); /* Like value_bytes_available, but return false if any byte in the whole object is unavailable. */ @@ -435,7 +436,7 @@ extern int value_entirely_available (struct value *value); LENGTH bytes as unavailable. */ extern void mark_value_bytes_unavailable (struct value *value, - int offset, int length); + LONGEST offset, LONGEST length); /* Compare LENGTH bytes of VAL1's contents starting at OFFSET1 with LENGTH bytes of VAL2's contents starting at OFFSET2. @@ -445,7 +446,7 @@ extern void mark_value_bytes_unavailable (struct value *value, example, to compare a complete object value with itself, including its enclosing type chunk, you'd do: - int len = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); + ULONGEST len = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); value_available_contents (val, 0, val, 0, len); Returns true iff the set of available contents match. Unavailable @@ -467,9 +468,10 @@ extern void mark_value_bytes_unavailable (struct value *value, value_available_contents_eq(val, 3, val, 4, 4) => 0 */ -extern int value_available_contents_eq (const struct value *val1, int offset1, - const struct value *val2, int offset2, - int length); +extern int value_available_contents_eq (const struct value *val1, + LONGEST offset1, + const struct value *val2, + LONGEST offset2, LONGEST length); /* Read LENGTH bytes of memory starting at MEMADDR into BUFFER, which is (or will be copied to) VAL's contents buffer offset by @@ -506,7 +508,7 @@ extern CORE_ADDR unpack_pointer (struct type *type, const gdb_byte *valaddr); extern int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, + LONGEST embedded_offset, int bitpos, int bitsize, const struct value *original_value, LONGEST *result); @@ -515,12 +517,12 @@ extern LONGEST unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno); extern int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result); extern struct value *value_field_bitfield (struct type *type, int fieldno, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, const struct value *val); extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); @@ -574,12 +576,12 @@ extern struct value *default_read_var_value (struct symbol *var, extern struct value *allocate_value (struct type *type); extern struct value *allocate_value_lazy (struct type *type); extern void allocate_value_contents (struct value *value); -extern void value_contents_copy (struct value *dst, int dst_offset, - struct value *src, int src_offset, - int length); -extern void value_contents_copy_raw (struct value *dst, int dst_offset, - struct value *src, int src_offset, - int length); +extern void value_contents_copy (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, + LONGEST length); +extern void value_contents_copy_raw (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, + LONGEST length); extern struct value *allocate_repeat_value (struct type *type, int count); @@ -645,7 +647,8 @@ extern struct value *value_static_field (struct type *type, int fieldno); extern struct fn_field *value_find_oload_method_list (struct value **, const char *, int, int *, - struct type **, int *); + struct type **, + LONGEST *); enum oload_search_type { NON_METHOD, METHOD, BOTH }; @@ -658,16 +661,16 @@ extern int find_overload_match (struct value **args, int nargs, extern struct value *value_field (struct value *arg1, int fieldno); -extern struct value *value_primitive_field (struct value *arg1, int offset, +extern struct value *value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type); -extern struct type *value_rtti_indirect_type (struct value *, int *, int *, +extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *, int *); extern struct value *value_full_object (struct value *, struct type *, int, - int, int); + LONGEST, int); extern struct value *value_cast_pointers (struct type *, struct value *, int); @@ -757,7 +760,7 @@ extern void set_internalvar_string (struct internalvar *var, extern void clear_internalvar (struct internalvar *var); extern void set_internalvar_component (struct internalvar *var, - int offset, + LONGEST offset, int bitpos, int bitsize, struct value *newvalue); @@ -837,7 +840,7 @@ extern struct value *value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside); extern struct value *value_fn_field (struct value **arg1p, struct fn_field *f, - int j, struct type *type, int offset); + int j, struct type *type, LONGEST offset); extern int binop_types_user_defined_p (enum exp_opcode op, struct type *type1, @@ -865,7 +868,8 @@ extern void release_value_or_incref (struct value *val); extern int record_latest_value (struct value *val); extern void modify_field (struct type *type, gdb_byte *addr, - LONGEST fieldval, int bitpos, int bitsize); + LONGEST fieldval, LONGEST bitpos, + int bitsize); extern void type_print (struct type *type, const char *varstring, struct ui_file *stream, int show); @@ -895,7 +899,7 @@ extern void value_print_array_elements (struct value *val, extern struct value *value_release_to_mark (struct value *mark); extern void val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -946,7 +950,7 @@ extern struct value *value_literal_complex (struct value *, struct value *, extern struct value *find_function_in_inferior (const char *, struct objfile **); -extern struct value *value_allocate_space_in_inferior (int); +extern struct value *value_allocate_space_in_inferior (LONGEST); extern struct value *value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound); diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 550b56b..f3870c9 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -116,7 +116,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); gdb_byte buf[4]; - int count = 0; + LONGEST count = 0; int i; /* We create an argument list on the stack, and make the argument @@ -125,7 +125,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, /* Push arguments in reverse order. */ for (i = nargs - 1; i >= 0; i--) { - int len = TYPE_LENGTH (value_enclosing_type (args[i])); + LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i])); sp -= (len + 3) & ~3; count += (len + 3) / 4; @@ -208,7 +208,7 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); gdb_byte buf[8]; if (TYPE_CODE (type) == TYPE_CODE_STRUCT diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 47fc86b..d73e2d6 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -162,8 +162,9 @@ static void xstormy16_extract_return_value (struct type *type, struct regcache *regcache, void *valbuf) { - int len = TYPE_LENGTH (type); - int i, regnum = E_1ST_ARG_REGNUM; + LONGEST len = TYPE_LENGTH (type); + LONGEST i; + int regnum = E_1ST_ARG_REGNUM; for (i = 0; i < len; i += xstormy16_reg_size) regcache_raw_read (regcache, regnum++, (char *) valbuf + i); @@ -188,8 +189,9 @@ xstormy16_store_return_value (struct type *type, struct regcache *regcache, } else { - int len = TYPE_LENGTH (type); - int i, regnum = E_1ST_ARG_REGNUM; + LONGEST len = TYPE_LENGTH (type); + LONGEST i; + int regnum = E_1ST_ARG_REGNUM; for (i = 0; i < len; i += xstormy16_reg_size) regcache_raw_write (regcache, regnum++, (char *) valbuf + i); @@ -235,8 +237,9 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR stack_dest = sp; int argreg = E_1ST_ARG_REGNUM; - int i, j; - int typelen, slacklen; + int i, slacklen; + LONGEST j; + LONGEST typelen; const gdb_byte *val; char buf[xstormy16_pc_size]; diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index b2a0617..55030c2 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -1580,7 +1580,7 @@ xtensa_extract_return_value (struct type *type, { struct gdbarch *gdbarch = get_regcache_arch (regcache); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); ULONGEST pc, wb; int callsize, areg; int offset = 0; @@ -1598,8 +1598,8 @@ xtensa_extract_return_value (struct type *type, /* On Xtensa, we can return up to 4 words (or 2 for call12). */ if (len > (callsize > 8 ? 8 : 16)) internal_error (__FILE__, __LINE__, - _("cannot extract return value of %d bytes long"), - len); + _("cannot extract return value of %s bytes long"), + plongest (len)); /* Get the register offset of the return register (A2) in the caller window. */ @@ -1614,7 +1614,8 @@ xtensa_extract_return_value (struct type *type, areg = gdbarch_tdep (gdbarch)->a0_base + C0_ARGS; } - DEBUGINFO ("[xtensa_extract_return_value] areg %d len %d\n", areg, len); + DEBUGINFO ("[xtensa_extract_return_value] areg %d len %s\n", areg, + plongest (len)); if (len < 4 && gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) offset = 4 - len; @@ -1639,7 +1640,7 @@ xtensa_store_return_value (struct type *type, unsigned int areg; ULONGEST pc, wb; int callsize; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int offset = 0; DEBUGTRACE ("xtensa_store_return_value (...)\n"); @@ -1653,8 +1654,8 @@ xtensa_store_return_value (struct type *type, if (len > (callsize > 8 ? 8 : 16)) internal_error (__FILE__, __LINE__, - _("unimplemented for this length: %d"), - TYPE_LENGTH (type)); + _("unimplemented for this length: %s"), + pulongest (TYPE_LENGTH (type))); areg = arreg_number (gdbarch, gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb); @@ -1728,18 +1729,18 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int i; - int size, onstack_size; + LONGEST size, onstack_size; gdb_byte *buf = (gdb_byte *) alloca (16); CORE_ADDR ra, ps; struct argument_info { const bfd_byte *contents; - int length; + LONGEST length; int onstack; /* onstack == 0 => in reg */ int align; /* alignment */ union { - int offset; /* stack offset if on stack. */ + LONGEST offset; /* stack offset if on stack. */ int regno; /* regno if in register. */ } u; }; @@ -1763,9 +1764,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); - fprintf_unfiltered (gdb_stdlog, "%2d: %s %3d ", i, + fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i, host_address_to_string (arg), - TYPE_LENGTH (arg_type)); + int_string (TYPE_LENGTH (arg_type), 10, 0, 3, + 0)); switch (TYPE_CODE (arg_type)) { case TYPE_CODE_INT: ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-31 18:15 ` [PATCH v3] " Siddhesh Poyarekar @ 2012-06-05 22:27 ` Jan Kratochvil 2012-06-06 18:23 ` Siddhesh Poyarekar 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-06-05 22:27 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey On Thu, 31 May 2012 20:14:22 +0200, Siddhesh Poyarekar wrote: > Here's a new draft of the patch I have been working on to expand bitpos > and type. There are some lines where the '-' line is <= 80 characters but the '+' line is > 80 characters. There is used %zd for size_t (not %zu?), %z is not compatible enough, cast it to ULONGEST, use pulongest. (I have not yet finished the review.) Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-05 22:27 ` Jan Kratochvil @ 2012-06-06 18:23 ` Siddhesh Poyarekar 2012-06-06 21:34 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-06-06 18:23 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey On Wed, 6 Jun 2012 00:26:51 +0200, Jan wrote: > On Thu, 31 May 2012 20:14:22 +0200, Siddhesh Poyarekar wrote: > > Here's a new draft of the patch I have been working on to expand > > bitpos and type. > > There are some lines where the '-' line is <= 80 characters but the > '+' line is > 80 characters. > > There is used %zd for size_t (not %zu?), %z is not compatible enough, > cast it to ULONGEST, use pulongest. > > (I have not yet finished the review.) > Thanks, I've updated my stash to fix the above until then. -- Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-06 18:23 ` Siddhesh Poyarekar @ 2012-06-06 21:34 ` Jan Kratochvil 2012-06-08 14:16 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-06-06 21:34 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey @@ -7968,7 +7968,7 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type, [...] - xsnprintf (p, endbuf - p, ",%x", len); + xsnprintf (p, endbuf - p, ",%s", int_string (len, 16, 1, 0, 0)); [...] @@ -8012,7 +8012,7 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type, [...] - xsnprintf (p, endbuf - p, ",%x", len); + xsnprintf (p, endbuf - p, ",%s", int_string (len, 16, 1, 0, 0)); int_string does not support IS_SIGNED (1) for RADIX 16 anyway. So I would simplify it just by using: + xsnprintf (p, endbuf - p, ",%s", phex_nz (len, 8)); --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -710,10 +710,10 @@ rx_return_value (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST valtype_len = TYPE_LENGTH (valtype); - if (TYPE_LENGTH (valtype) > 16 + if (valtype_len > 16 || ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT || TYPE_CODE (valtype) == TYPE_CODE_UNION) - && TYPE_LENGTH (valtype) % 4 != 0)) + && valtype_len % 4 != 0)) return RETURN_VALUE_STRUCT_CONVENTION; This seems to be an unrelated cleanup, just drop it. @@ -1763,9 +1764,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); - fprintf_unfiltered (gdb_stdlog, "%2d: %s %3d ", i, + fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i, host_address_to_string (arg), - TYPE_LENGTH (arg_type)); + int_string (TYPE_LENGTH (arg_type), 10, 0, 3, + 0)); It is sure just for debugging but this is an output change due to zeroes padding. What about putting there instead: const char *arg_type_len_s = pulongest (TYPE_LENGTH (arg_type)); + fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i, [...] arg_type_len_s); Used: rm -rf splint/;mkdir -p splint/bits;touch splint/bits/confname.h;for i in `cat files`;do mkdir -p splint/`dirname $i`;splint +posixlib +gnuextensions -Isplint -exportlocal -DTUI -I. -Icommon -I../include -I../bfd -I../libdecnumber -I../opcodes -I.. -I/usr/include/python2.7 $i &>splint/$i.out;done find splint-bitpos/ -type f|sort|xargs cat|perl -lpe 's/^\s*(\S*?\.[ch]:\d+:\d+):/LOC $1\n/' >splint-bitpos.out diff -I"^LOC " splint-clean.out splint-bitpos.out|vim - and got for example: -LOC ada-lang.c:669:33 +LOC ada-lang.c:670:33 Function umax_of_size expects arg 1 to be int gets unsigned - int: (t)->length + long int: (t)->length It has 26000 lines this way, I will try to reduce the diff size somehow. Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-06 21:34 ` Jan Kratochvil @ 2012-06-08 14:16 ` Jan Kratochvil 2012-06-08 15:27 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-06-08 14:16 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey [-- Attachment #1: Type: text/plain, Size: 725 bytes --] On Wed, 06 Jun 2012 23:34:20 +0200, Jan Kratochvil wrote: > Used: > rm -rf splint/;mkdir -p splint/bits;touch splint/bits/confname.h;for i in `cat files`;do mkdir -p splint/`dirname $i`;splint +posixlib +gnuextensions -Isplint -exportlocal -DTUI -I. -Icommon -I../include -I../bfd -I../libdecnumber -I../opcodes -I.. -I/usr/include/python2.7 $i &>splint/$i.out;done > find splint-bitpos/ -type f|sort|xargs cat|perl -lpe 's/^\s*(\S*?\.[ch]:\d+:\d+):/LOC $1\n/' >splint-bitpos.out > diff -I"^LOC " splint-clean.out splint-bitpos.out|vim - [...] > It has 26000 lines this way, I will try to reduce the diff size somehow. Wrote the attached script and the "diff" has now "just" 7375 lines. This seems to be reviewable. Jan [-- Attachment #2: locdiff --] [-- Type: text/plain, Size: 1009 bytes --] #! /usr/bin/perl use strict; use warnings; @ARGV==2 or die; sub readfile($) { my($fname)=@_; local *F; open F,$fname or die $fname; my $F=do { local $/; <F>; }; defined $F or die $fname; close F or die $fname; return $F; } sub writefile($$) { my($fname,$content)=@_; local *F; open F,">$fname" or die $fname; print F $content or die $fname; close F or die $fname; } sub strip($$$) { my($dst,$src,$locref)=@_; my $f=readfile $src; $f=~s{^LOC (.*)$}{push @$locref,$1;"LOC";}egm; writefile $dst,$f; } my $t="/tmp/locdiff.$$"; my($a,$b)=("$t.a","$t.b"); my(@a,@b); strip $a,$ARGV[0],\@a; strip $b,$ARGV[1],\@b; my $f=readfile "diff -U-1 $a $b||true|"; die if 2!=unlink "$a","$b"; $f=~s{^([-+ ])LOC$}{ my $l; if ($1 eq "-") { $l=shift @a; } elsif ($1 eq "+") { $l=shift @b; } else { die if $1 ne " "; $l=shift @a; my $r=shift @b; $l="$r ($l)" if $l ne $r; } "$1LOC $l"; }egm; 1 while $f=~s{^ LOC .*\n(?: .*?\n)*?(.LOC )}{$1}gm; print $f; ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-08 14:16 ` Jan Kratochvil @ 2012-06-08 15:27 ` Jan Kratochvil 2012-06-11 12:53 ` Siddhesh Poyarekar 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-06-08 15:27 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey [-- Attachment #1: Type: text/plain, Size: 911 bytes --] On Fri, 08 Jun 2012 16:16:36 +0200, Jan Kratochvil wrote: > Wrote the attached script and the "diff" has now "just" 7375 lines. This > seems to be reviewable. Fixed there some whitespacing issues, therefore: rm -rf splint/;mkdir -p splint/bits;touch splint/bits/confname.h;for i in `cat files`;do mkdir -p splint/`dirname $i`;splint +posixlib +gnuextensions -Isplint -exportlocal -DTUI -I. -Icommon -I../include -I../bfd -I../libdecnumber -I../opcodes -I.. -I/usr/include/python2.7 $i &>splint/$i.out;done appropriately mv splint splint-clean and mv splint splint-bitpos find splint-clean/ -type f|sort|xargs cat|perl -lpe 's/^(\s*)(\S*?\.[ch]:\d+:\d+):/$1LOC $2\n/' >splint-clean.out find splint-bitpos/ -type f|sort|xargs cat|perl -lpe 's/^(\s*)(\S*?\.[ch]:\d+:\d+):/$1LOC $2\n/' >splint-bitpos.out locdiff splint-clean.out splint-bitpos.out http://people.redhat.com/jkratoch/locdiff.out Regards, Jan [-- Attachment #2: locdiff --] [-- Type: text/plain, Size: 1023 bytes --] #! /usr/bin/perl use strict; use warnings; @ARGV==2 or die; sub readfile($) { my($fname)=@_; local *F; open F,$fname or die $fname; my $F=do { local $/; <F>; }; defined $F or die $fname; close F or die $fname; return $F; } sub writefile($$) { my($fname,$content)=@_; local *F; open F,">$fname" or die $fname; print F $content or die $fname; close F or die $fname; } sub strip($$$) { my($dst,$src,$locref)=@_; my $f=readfile $src; $f=~s{^(\s*)LOC (.*)$}{push @$locref,$2;"$1LOC";}egm; writefile $dst,$f; } my $t="/tmp/locdiff.$$"; my($a,$b)=("$t.a","$t.b"); my(@a,@b); strip $a,$ARGV[0],\@a; strip $b,$ARGV[1],\@b; my $f=readfile "diff -U-1 $a $b||true|"; die if 2!=unlink "$a","$b"; $f=~s{^([-+ ])(\s*)LOC$}{ my $l; if ($1 eq "-") { $l=shift @a; } elsif ($1 eq "+") { $l=shift @b; } else { die if $1 ne " "; $l=shift @a; my $r=shift @b; $l="$r ($l)" if $l ne $r; } "$1$2LOC $l"; }egm; 1 while $f=~s{^ LOC .*\n(?: .*?\n)*?(.LOC )}{$1}gm; print $f; ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-08 15:27 ` Jan Kratochvil @ 2012-06-11 12:53 ` Siddhesh Poyarekar 2012-06-11 13:00 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-06-11 12:53 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey On Fri, 8 Jun 2012 17:27:35 +0200, Jan wrote: > On Fri, 08 Jun 2012 16:16:36 +0200, Jan Kratochvil wrote: > > Wrote the attached script and the "diff" has now "just" 7375 > > lines. This seems to be reviewable. > > Fixed there some whitespacing issues, therefore: > > rm -rf splint/;mkdir -p splint/bits;touch splint/bits/confname.h;for > i in `cat files`;do mkdir -p splint/`dirname $i`;splint +posixlib > +gnuextensions -Isplint -exportlocal -DTUI -I. -Icommon -I../include > -I../bfd -I../libdecnumber -I../opcodes -I.. -I/usr/include/python2.7 > $i &>splint/$i.out;done appropriately mv splint splint-clean and mv > splint splint-bitpos find splint-clean/ -type f|sort|xargs cat|perl > -lpe 's/^(\s*)(\S*?\.[ch]:\d+:\d+):/$1LOC $2\n/' >splint-clean.out > find splint-bitpos/ -type f|sort|xargs cat|perl -lpe > 's/^(\s*)(\S*?\.[ch]:\d+:\d+):/$1LOC $2\n/' >splint-bitpos.out > locdiff splint-clean.out splint-bitpos.out > > http://people.redhat.com/jkratoch/locdiff.out > Thanks, I'm building on your idea to make the list even smaller. So far, adding '-hints -showcolumn -linelen 999' to the splint commandline and then adjusting the above regex to remove the additional \d+: has forced all outputs to be cleaner and in one-line per warning, so we can expect output of the type: LOC <location> - <old> - <new> in a lot of cases. This has reduced the output to about 4.2k, mostly due to the reduced wrapping. I am now working on using this to eliminate the following warnings: * Warnings about the argument 2 of extract_unsigned_integer having to be int. This is the size of a primitive and is hence always safe. * Earlier warning was assignment from int to unsigned int (or vice-versa) and that has now changed from LONGEST to ULONGEST. These form a fairly large part of the outputs, so I hope to make the final list to review much smaller than what we currently have. Please let me know if any of the above assumptions or wrong or if there are any other cases I can eliminate. Thanks, Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-11 12:53 ` Siddhesh Poyarekar @ 2012-06-11 13:00 ` Jan Kratochvil 2012-06-11 18:33 ` Siddhesh Poyarekar 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-06-11 13:00 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey On Mon, 11 Jun 2012 14:53:46 +0200, Siddhesh Poyarekar wrote: > LOC <location> > - <old> > - <new> nitpick: + at the <new> line. > * Warnings about the argument 2 of extract_unsigned_integer having to > be int. This is the size of a primitive and is hence always safe. > * Earlier warning was assignment from int to unsigned int (or > vice-versa) and that has now changed from LONGEST to ULONGEST. [...] > Please let me know if any of the above assumptions or wrong or if there are > any other cases I can eliminate. I agree with these assumptions. Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-11 13:00 ` Jan Kratochvil @ 2012-06-11 18:33 ` Siddhesh Poyarekar 2012-06-12 9:56 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-06-11 18:33 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey [-- Attachment #1: Type: text/plain, Size: 2359 bytes --] On Mon, 11 Jun 2012 14:59:33 +0200, Jan wrote: > > Please let me know if any of the above assumptions or wrong or if > > there are any other cases I can eliminate. > > I agree with these assumptions. > > Here's where I'm at right now. I modified the splint command to look like the following: rm -rf splint/ mkdir -p splint/bits touch splint/bits/confname.h for i in `cat files`; do mkdir -p splint/`dirname $i` splint +posixlib +gnuextensions -linelen 999 -hints -showcolumn \ -Isplint -exportlocal -DTUI -I. \ -Icommon -I../include -I../bfd -I../libdecnumber -I../opcodes \ -I.. -I/usr/include/python2.7 $i &>splint/$i.out done and used the rest of the commands as is: find splint-clean/ -type f|sort|xargs cat|perl -lpe 's/^(\s*)(\S*?\.[ch]:\d+):/$1LOC $2\n/' >splint-clean.out find splint-bitpos/ -type f|sort|xargs cat|perl -lpe 's/^(\s*)(\S*?\.[ch]:\d+):/$1LOC $2\n/' >splint-bitpos.out ./locdiff splint-clean.out splint-bitpos.out Once I got the locdiff.out, the major improvement was that each warning has a specific pattern as I mentioned above, which meant that I could do some further processing to eliminate some of the more obvious spurious warnings. It also had the effect of reducing the output size to about 4200 lines. Then I wrote a script (attached) to reduce this further based on the following rules: 1) The store_unsigned_integer, extract_unsigned_integer and other related functions can always safely accept int as argument 2 since the type length to be passed in it must be a primitive integral type. So we can ignore all entries that look like: LOC - Function store_unsigned_integer expects arg 2 to be int... + Function store_unsigned_integer expects arg 2 to be int... 1) Lines of the following format: LOC <details> -<old> +<new> for type incompatibilities are processed to get the old warning and new warning and then deduce if we have caused a regression due to the change. The deducion is based on the type assignment warnings before and after. The basic rule to deduce safety of the change is to ensure that the target of the assignment is large enough for the source after the change. After running this script the changes to review have come to approx 2500 lines (also attached). Does this look OK? If it does, then I can do a step-by-step review of these changes and post them. Regards, Siddhesh [-- Attachment #2: process-locdiff --] [-- Type: application/octet-stream, Size: 5883 bytes --] #! /usr/bin/perl use strict; use warnings; @ARGV==1 or die; sub readfile($) { my($fname)=@_; local *F; open F,$fname or die $fname; my $F=do { local $/; <F>; }; defined $F or die $fname; close F or die $fname; return $F; } # Figure out which changes are safe based on the warnings before and after the # change. sub safe_change($$) { my($ref_from, $ref_to) = @_; my @f = @{$ref_from}; my @t = @{$ref_to}; # It is OK if the warnings before and after were only for the sign of # the assignment or comparison. if ($f[0] eq "int" && $f[1] eq "LONGEST" && $t[0] eq "UINT" && $t[1] eq "ULONGEST") { return 1; } # Likewise for reverse sign. if ($f[0] eq "UINT" && $f[1] eq "ULONGEST" && $t[0] eq "int" && $t[1] eq "LONGEST") { return 1; } # If the earlier the target was larger but with a different sign and # now we have the same size but different sign, then we're still OK. if ($f[0] eq "int" && $f[1] eq "LONGEST" && $t[0] eq "ULONGEST" && $t[1] eq "ULONGEST") { return 1; } # Likewise for reverse sign. if ($f[0] eq "UINT" && $f[1] eq "ULONGEST" && $t[0] eq "LONGEST" && $t[1] eq "LONGEST") { return 1; } # If the earlier the target was smaller but with a different sign and # now we have the same size but different sign then we have actually # fixed something. if ($f[0] eq "LONGEST" && $f[1] eq "LONGEST" && $t[0] eq "UINT" && $t[1] eq "ULONGEST") { return 1; } # Likewise for reverse sign. if ($f[0] eq "ULONGEST" && $f[1] eq "ULONGEST" && $t[0] eq "int" && $t[1] eq "LONGEST") { return 1; } # If we simply grew the target type without changing the sign, we're # fine there too. if ($f[0] eq "UINT" && $f[1] eq "UINT" && $t[0] eq "int" && $t[1] eq "LONGEST") { return 1; } # Likewise for reverse sign. if ($f[0] eq "int" && $f[1] eq "int" && $t[0] eq "UINT" && $t[1] eq "ULONGEST") { return 1; } # Similar logic for (s)size_t. size_t will always be smaller than or # equal to LONGEST/ULONGEST, so treat it as if it were smaller and use # the same logic as above. if ($f[0] eq "size_t" && $f[1] eq "size_t" && $t[0] eq "int" && $t[1] eq "LONGEST") { return 1; } if ($f[0] eq "size_t" && $f[1] eq "ULONGEST" && $t[0] eq "LONGEST" && $t[1] eq "LONGEST") { return 1; } if ($f[0] eq "ssize_t" && $f[1] eq "ssize_t" && $t[0] eq "UINT" && $t[1] eq "ULONGEST") { return 1; } if ($f[0] eq "ssize_t" && $f[1] eq "LONGEST" && $t[0] eq "ULONGEST" && $t[1] eq "ULONGEST") { return 1; } return 0; } # Read in the file and prepare it so that we can run our future regexes easily. my $f = readfile $ARGV[0]; $f=~s{unsigned long int}{"ULONGEST";}egm; $f=~s{long int}{"LONGEST";}egm; $f=~s{unsigned int}{"UINT";}egm; # 0 = Assignment of... # 1 = Function <func> expects arg <num>... # 2 = Function *signed_integer expects arg 2... # 3 = Variable <var> initialized to type ... my $match = -1; my $look = -1; my @savelines; my @from; my @to; my @expr; my @var; my @argnum; # Walk through the file. LINE: for(split /^/, $f) { my $line = $_; # Skip blank lines next LINE if /^\s*$/; # Skip summary lines next LINE if /^[-+]Finished checking/; # Skip command warnings. next LINE if /^ Command Line: Setting/; next LINE if /^ Splint 3\.1\.2 ---/; # Found a LOC. We look at the next lines. if (/^ LOC/) { push @savelines, $_; $look = 0; next LINE; } # We're looking at the next lines. elsif ($look >= 0) { my $l = $_; # Make sure that the type promotions are safe. See safe_change # for details if (($look == 0 || $match == 0) && /Assignment of (\w+) to (\w+):(.*)$/) { push @from, $1; push @to, $2; push @expr, $3; push @savelines, $l; $line = ""; $look += 1; $match = 0; next LINE if $look == 1; # only if we're talking about the same expression if (($expr[0] eq $expr[1]) && safe_change (\@from, \@to)) { # Skip the changeset. $#savelines = -1; } goto done; } # The (store|extract)_(un)?signed_integer functions always have # a primitive size in arg 2 and hence this warning is moot for # this change.. if (($look == 0 || $match == 2) && /Function ((extract)|(store))?_(long_)?(un)?signed_integer expects arg 2 to be int/) { $line = ""; push @savelines, $l; $look += 1; $match = 2; next LINE if $look == 1; $#savelines = -1; goto done; } # Analogous change to the Assignment change above. Again, see # safe_change function for details. if (($look == 0 || $match == 1) && /Function (\w+) expects arg (\d) to be (\w+) gets (\w+): (.*)$/) { push @var, $1; push @argnum, $2; push @to, $3; push @from, $4; push @expr, $5; push @savelines, $l; $line = ""; $look += 1; $match = 1; next LINE if $look == 1; # only if we're talking about the same expression if (($expr[0] eq $expr[1]) && ($var[0] eq $var[1]) && ($argnum[0] eq $argnum[1]) && (safe_change (\@from, \@to))) { # Skip the changeset. $#savelines = -1; } goto done; } # Analogous change to the Function change above. if (($look == 0 || $match == 3) && /Variable (\w+) initialized to type (\w+), expects (\w+): (.*)$/) { push @var, $1; push @to, $2; push @from, $3; push @expr, $4; push @savelines, $l; $line = ""; $look += 1; $match = 3; next LINE if $look == 1; # only if we're talking about the same expression if (($expr[0] eq $expr[1]) && ($var[0] eq $var[1]) && (safe_change (\@from, \@to))) { # Skip the changeset. $#savelines = -1; } goto done; } } # The next lines didn't work out as expected, so clear and print # everything out as if nothing happened. done: $look = -1; foreach(@savelines) { print $_; } print $line; $#savelines = -1; $#var = -1; $#argnum = -1; $#from = -1; $#to = -1; $#expr = -1; } [-- Attachment #3: differ --] [-- Type: application/octet-stream, Size: 146394 bytes --] --- /tmp/locdiff.17367.a 2012-06-11 15:25:43.804318482 +0530 +++ /tmp/locdiff.17367.b 2012-06-11 15:25:44.240318492 +0530 @@ -1,367304 +1,367623 @@ LOC ada-lang.c:579 (ada-lang.c:578) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC ada-lang.c:670 (ada-lang.c:669) - Function umax_of_size expects arg 1 to be int gets UINT: (t)->length + Function umax_of_size expects arg 1 to be int gets ULONGEST: (t)->length LOC ada-lang.c:672 (ada-lang.c:671) - Function max_of_size expects arg 1 to be int gets UINT: (t)->length + Function max_of_size expects arg 1 to be int gets ULONGEST: (t)->length ada-lang.c: (in function min_of_type) LOC ada-lang.c:682 (ada-lang.c:681) - Function min_of_size expects arg 1 to be int gets UINT: (t)->length + Function min_of_size expects arg 1 to be int gets ULONGEST: (t)->length ada-lang.c: (in function ada_discrete_type_high_bound) LOC ada-lang.c:1622 (ada-lang.c:1621) - Return value type UINT does not match declared type int: 8 * (ada_check_typedef((((type)->main_type->flds_bnds.fields[1]).type)))->length + Return value type ULONGEST does not match declared type int: 8 * (ada_check_typedef((((type)->main_type->flds_bnds.fields[1]).type)))->length LOC ada-lang.c:1688 (ada-lang.c:1687) - Return value type UINT does not match declared type int: 8 * ((((type)->main_type->flds_bnds.fields[0]).type))->length + Return value type ULONGEST does not match declared type int: 8 * ((((type)->main_type->flds_bnds.fields[0]).type))->length LOC ada-lang.c:1724 (ada-lang.c:1723) - Return value type UINT does not match declared type int: 8 * ((((type)->main_type->flds_bnds.fields[2 * i + which - 2]).type))->length + Return value type ULONGEST does not match declared type int: 8 * ((((type)->main_type->flds_bnds.fields[2 * i + which - 2]).type))->length LOC ada-lang.c:1899 (ada-lang.c:1896) - Variable array_bitsize initialized to type LONGEST, expects int: (hi - lo + 1) * (((elt_type)->main_type->flds_bnds.fields[0]).bitsize) -LOC ada-lang.c:1898 - Assignment of int to UINT: (array_type)->length = (array_bitsize + 7) / 8 + Assignment of LONGEST to ULONGEST: (array_type)->length = (array_bitsize + 7) / 8 +LOC ada-lang.c:2185 + Function ada_value_primitive_packed_val expects arg 4 to be int gets LONGEST: bit_pos % 8 LOC ada-lang.c:2338 (ada-lang.c:2322) - Function set_value_offset expects arg 2 to be int gets LONGEST: new_offset -LOC ada-lang.c:2335 - Assignment of UINT to int: ntarg = (type)->length + Assignment of ULONGEST to LONGEST: ntarg = (type)->length LOC ada-lang.c:2342 (ada-lang.c:2339) - Function memset expects arg 3 to be size_t gets UINT: (type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (type)->length +LOC ada-lang.c:2379 + Assignment of LONGEST to int: src = targ = 0 LOC ada-lang.c:2445 (ada-lang.c:2448) + Assignment of LONGEST to int: accum_bits = 8 - src_offset +LOC ada-lang.c:2451 Incompatible types for + (UINT, unsigned char): (accum << 8) + (unsigned char)*source LOC ada-lang.c:2455 + Operands of > have incompatible types (int, LONGEST): chunk_size > n +LOC ada-lang.c:2456 + Assignment of LONGEST to int: chunk_size = n +LOC ada-lang.c:2458 Right operand of << may be negative (int): 1 << chunk_size LOC ada-lang.c:2470 (ada-lang.c:2467) - Right operand of >> may be negative (int): (unsigned char)*source >> src_offset + Right operand of >> may be negative (LONGEST): (unsigned char)*source >> src_offset LOC ada-lang.c:2470 (ada-lang.c:2467) - Assignment of unsigned char to UINT: accum = (unsigned char)*source >> src_offset + Assignment of LONGEST to UINT: accum = (unsigned char)*source >> src_offset +LOC ada-lang.c:2472 + Assignment of LONGEST to int: accum_bits = 8 - src_offset LOC ada-lang.c:2480 (ada-lang.c:2479) + Operands of > have incompatible types (int, LONGEST): chunk_size > n +LOC ada-lang.c:2481 + Assignment of LONGEST to int: chunk_size = n +LOC ada-lang.c:2482 Right operand of << may be negative (int): 1 << chunk_size LOC ada-lang.c:2545 (ada-lang.c:2542) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC ada-lang.c:4094 (ada-lang.c:4091) - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ada-lang.c:4138 (ada-lang.c:4135) - Function memcpy expects arg 3 to be size_t gets UINT: (actual_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (actual_type)->length LOC ada-lang.c:4163 (ada-lang.c:4160) - Function C_alloca expects arg 1 to be size_t gets UINT: len + Function C_alloca expects arg 1 to be size_t gets ULONGEST: len LOC ada-lang.c:6449 (ada-lang.c:6444) + Function ada_value_primitive_packed_val expects arg 4 to be int gets LONGEST: bit_pos % 8 +LOC ada-lang.c:6447 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents(arg1) LOC ada-lang.c:6507 + Assignment of LONGEST to int: *bit_offset_p = bit_pos % 8 +LOC ada-lang.c:6510 Fresh storage type not released before return LOC ada-lang.c:6478 (ada-lang.c:6475) Fresh storage type created LOC ada-lang.c:7448 (ada-lang.c:7445) - Assignment of UINT to LONGEST: off = align_value(off, field_alignment(type, f)) + ((((type)->main_type->flds_bnds.fields[f]).loc.bitpos) + 0) -LOC ada-lang.c:7447 - Assignment of LONGEST to int: (((rtype)->main_type->flds_bnds.fields[f]).loc.bitpos) = (off) + Assignment of ULONGEST to LONGEST: off = align_value(off, field_alignment(type, f)) + ((((type)->main_type->flds_bnds.fields[f]).loc.bitpos) + 0) LOC ada-lang.c:7542 (ada-lang.c:7539) - Assignment of UINT to int: fld_bit_len = (((rtype)->main_type->flds_bnds.fields[f]).bitsize) = (((type)->main_type->flds_bnds.fields[f]).bitsize) -LOC ada-lang.c:7542 - Assignment of UINT to int: fld_bit_len = (ada_check_typedef(field_type))->length * 8 + Assignment of UINT to LONGEST: fld_bit_len = (((rtype)->main_type->flds_bnds.fields[f]).bitsize) = (((type)->main_type->flds_bnds.fields[f]).bitsize) LOC ada-lang.c:7545 (ada-lang.c:7546) - Assignment of LONGEST to int: bit_len = off + fld_bit_len + Assignment of ULONGEST to LONGEST: fld_bit_len = (ada_check_typedef(field_type))->length * 8 LOC ada-lang.c:7585 (ada-lang.c:7582) - Assignment of UINT to int: fld_bit_len = ((((rtype)->main_type->flds_bnds.fields[variant_field]).type))->length * 8 -LOC ada-lang.c:7586 - Assignment of LONGEST to int: bit_len = off + fld_bit_len + Assignment of ULONGEST to LONGEST: fld_bit_len = ((((rtype)->main_type->flds_bnds.fields[variant_field]).type))->length * 8 LOC ada-lang.c:7604 (ada-lang.c:7601) - New fresh storage (type char *) passed as implicitly temp (not released): gettext("Invalid type size for `%s' detected: %d.") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("Invalid type size for `%s' detected: %s.") LOC ada-lang.c:7607 (ada-lang.c:7604) - New fresh storage (type char *) passed as implicitly temp (not released): gettext("Invalid type size for <unnamed> detected: %d.") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("Invalid type size for <unnamed> detected: %s.") LOC ada-lang.c:7945 (ada-lang.c:7942) - Variable len initialized to type UINT, expects int: (result)->length / ((result)->main_type->target_type)->length + Variable len initialized to type ULONGEST, expects LONGEST: ((result)->length / ((result)->main_type->target_type)->length) LOC ada-lang.c:7951 (ada-lang.c:7947) - Operands of < have incompatible types (UINT, int): (result)->length * 8 < len * elt_bitsize + Operands of < have incompatible types (ULONGEST, LONGEST): (result)->length * 8 < len * elt_bitsize LOC ada-lang.c:8017 (ada-lang.c:8013) - Operands of != have incompatible types (UINT, LONGEST): (fixed_record_type)->length != size + Operands of != have incompatible types (ULONGEST, LONGEST): (fixed_record_type)->length != size LOC ada-lang.c:8757 (ada-lang.c:8753) - Function memcmp expects arg 3 to be size_t gets UINT: (value_type(arg1))->length + Function memcmp expects arg 3 to be size_t gets ULONGEST: (value_type(arg1))->length LOC ada-lang.c:8812 (ada-lang.c:8808) - Function ada_index_struct_field expects arg 1 to be int gets LONGEST: index -LOC ada-lang.c:8808 New fresh storage (type struct type *) passed as implicitly temp (not released): value_type(lhs) LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC ada-typeprint.c:818 - New fresh storage (type char *) passed as implicitly temp (not released): gettext("<%d-byte integer>") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("<%s-byte integer>") LOC ada-typeprint.c:840 - New fresh storage (type char *) passed as implicitly temp (not released): gettext("<%d-byte float>") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("<%s-byte float>") LOC ada-valprint.c:376 - Function ada_emit_char expects arg 5 to be int gets UINT: (type)->length + Function ada_emit_char expects arg 5 to be int gets ULONGEST: (type)->length ada-valprint.c: (in function ada_print_scalar) LOC ada-valprint.c:483 (ada-valprint.c:491) + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC ada-valprint.c:491 Test expression for if not boolean, type int: quit_flag LOC ada-valprint.c:501 (ada-valprint.c:502) - Function char_at expects arg 2 to be int gets UINT: rep1 + Operands of < have incompatible types (UINT, ULONGEST): rep1 < length +LOC ada-valprint.c:502 + Function char_at expects arg 2 to be LONGEST gets UINT: rep1 LOC ada-valprint.c:553 + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC ada-valprint.c:553 Left operand of || is non-boolean (int): force_ellipses || i < length ada-valprint.c: (in function ada_printstr) LOC ada-valprint.c:563 - Function printstr expects arg 6 to be int gets UINT: (type)->length + Function printstr expects arg 6 to be int gets ULONGEST: (type)->length LOC ada-valprint.c:628 - Operands of < have incompatible types (int, UINT): temp_len < len + Operands of < have incompatible types (LONGEST, ULONGEST): temp_len < len LOC ada-valprint.c:629 - Operands of < have incompatible types (int, UINT): temp_len < options->print_max + Operands of < have incompatible types (LONGEST, UINT): temp_len < options->print_max LOC ada-valprint.c:631 - Function char_at expects arg 3 to be int gets UINT: eltlen + Function char_at expects arg 3 to be int gets ULONGEST: eltlen LOC ada-valprint.c:636 - Function printstr expects arg 6 to be int gets UINT: eltlen + Function printstr expects arg 6 to be int gets ULONGEST: eltlen LOC ada-valprint.c:964 - Operands of != have incompatible types (UINT, size_t): ((type)->main_type->target_type)->length != sizeof(char) + Operands of != have incompatible types (ULONGEST, size_t): ((type)->main_type->target_type)->length != sizeof(char) LOC ada-valprint.c:1132 (ada-valprint.c:1130) + Function ada_value_primitive_packed_val expects arg 4 to be int gets LONGEST: bit_pos % 8 +LOC ada-valprint.c:1130 Null storage passed as non-null param: ada_value_primitive_packed_val (NULL, ...) LOC progspace.h:37 File static function VEC_so_list_ptr_safe_insert declared but not used LOC progspace.h:37 Definition of VEC_so_list_ptr_safe_insert +LOC alpha-tdep.c:402 + Assignment of LONGEST to int: accumulate_size = (accumulate_size + m_arg->len + 7) & ~7 LOC alpha-tdep.c:432 - Operands of <= have incompatible types (int, size_t): offset + len <= sizeof((arg_reg_buffer)) + Operands of <= have incompatible types (LONGEST, size_t): offset + len <= sizeof((arg_reg_buffer)) LOC alpha-tdep.c:434 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC alpha-tdep.c:448 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC alpha-tdep.c:534 (alpha-tdep.c:537) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: length +LOC alpha-tdep.c:537 Fresh storage gdbarch not released before return LOC alpha-tdep.c:476 Fresh storage gdbarch created alpha-tdep.c: (in function alpha_store_return_value) LOC alpha-tdep.c:630 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC linespec.h:54 File static function VEC_linespec_sals_safe_insert declared but not used LOC linespec.h:54 Definition of VEC_linespec_sals_safe_insert LOC amd64-tdep.c:489 - Variable bitsize initialized to type UINT, expects int: (((type)->main_type->flds_bnds.fields[i]).bitsize) + Variable bitsize initialized to type UINT, expects LONGEST: (((type)->main_type->flds_bnds.fields[i]).bitsize) amd64-tdep.c: (in function amd64_return_value) LOC amd64-tdep.c:634 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC amd64-tdep.c:697 + Function regcache_raw_read_part expects arg 4 to be int gets LONGEST: ((len) < (8) ? (len) : (8)) +LOC amd64-tdep.c:697 Return value (type enum register_status) ignored: regcache_raw_rea... LOC amd64-tdep.c:700 (amd64-tdep.c:704) + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: ((len) < (8) ? (len) : (8)) +LOC amd64-tdep.c:704 Fresh storage tdep not released before return LOC amd64-tdep.c:601 Fresh storage tdep created LOC amd64-tdep.c:823 - Function memcpy expects arg 3 to be size_t gets int: ((len) < (8) ? (len) : (8)) + Function memcpy expects arg 3 to be size_t gets LONGEST: ((len) < (8) ? (len) : (8)) LOC amd64-tdep.c:844 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC amd64-tdep.c:2591 - Function target_read_memory expects arg 3 to be ssize_t gets int: len + Function target_read_memory expects arg 3 to be ssize_t gets LONGEST: len LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC amd64-windows-tdep.c:111 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length +LOC amd64-windows-tdep.c:119 + Function regcache_raw_read_part expects arg 4 to be int gets LONGEST: len LOC amd64-windows-tdep.c:121 (amd64-windows-tdep.c:77) + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len +LOC amd64-windows-tdep.c:77 Parameter gdbarch not used LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC arm-linux-nat.c:932 - Right operand of << may be negative (int): 1 << len + Right operand of << may be negative (LONGEST): 1 << len LOC arm-linux-nat.c:932 - Assignment of int to UINT: mask = (1 << len) - 1 + Assignment of LONGEST to UINT: mask = (1 << len) - 1 LOC arm-tdep.c:3289 - Return value type UINT does not match declared type int: (t)->length + Return value type ULONGEST does not match declared type int: (t)->length LOC arm-tdep.c:3422 - Return value type UINT does not match declared type int: (t)->length / unitlen + Return value type ULONGEST does not match declared type int: (t)->length / unitlen LOC arm-tdep.c:3689 (arm-tdep.c:3690) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC arm-tdep.c:3690 Test expression for if not boolean, type int: arm_pc_is_thumb(gdbarch, regval) LOC arm-tdep.c:3692 - Function C_alloca expects arg 1 to be size_t gets int: len + Function C_alloca expects arg 1 to be size_t gets LONGEST: len +LOC arm-tdep.c:3693 + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len LOC arm-tdep.c:3704 (arm-tdep.c:3706) + Variable partial_len initialized to type LONGEST, expects int: len < 4 ? len : 4 +LOC arm-tdep.c:3706 Left operand of && is non-boolean (int): may_use_core_reg && argreg <= ARM_LAST_ARG_REGNUM LOC arm-tdep.c:2144 File static function VEC_arm_exidx_entry_s_safe_insert declared but not used LOC arm-tdep.c:2144 Definition of VEC_arm_exidx_entry_s_safe_insert avr-tdep.c: (in function avr_pointer_to_address) LOC avr-tdep.c:931 - Operands of < have incompatible types (int, UINT): i < (valtype)->length + Operands of < have incompatible types (LONGEST, ULONGEST): i < (valtype)->length LOC avr-tdep.c:932 (avr-tdep.c:937) - Operands of < have incompatible types (int, UINT): i < (valtype)->length + Function regcache_cooked_write expects arg 2 to be int gets LONGEST: lsb_reg + i +LOC avr-tdep.c:937 + Operands of < have incompatible types (LONGEST, ULONGEST): i < (valtype)->length LOC avr-tdep.c:938 + Function regcache_cooked_read expects arg 2 to be int gets LONGEST: lsb_reg + i +LOC avr-tdep.c:938 Return value (type enum register_status) ignored: regcache_cooked_... LOC avr-tdep.c:1184 (avr-tdep.c:1183) - Function xmalloc expects arg 1 to be size_t gets int: len + Function xmalloc expects arg 1 to be size_t gets LONGEST: len LOC avr-tdep.c:1185 + Assignment of LONGEST to int: si->len = len +LOC avr-tdep.c:1186 Implicitly only storage si->prev (type struct stack_item *) not released before assignment: si->prev = prev LOC avr-tdep.c:1187 (avr-tdep.c:1186) - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len avr-tdep.c: (in function avr_push_dummy_call) +LOC avr-tdep.c:1286 + Test expression for if not boolean, type LONGEST: len & 1 LOC avr-tdep.c:1289 (avr-tdep.c:1285) - Test expression for if not boolean, type int: len & 1 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len LOC avr-tdep.c:1290 (avr-tdep.c:1291) - Right operand of >> may be negative (int): val >> (8 * (len - j - 1)) + Operands of < have incompatible types (int, LONGEST): j < len +LOC avr-tdep.c:1292 + Right operand of >> may be negative (LONGEST): val >> (8 * (len - j - 1)) LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC ax-gdb.c:486 (ax-gdb.c:485) - Function ax_ext expects arg 2 to be int gets UINT: (type)->length * 8 + Function ax_ext expects arg 2 to be int gets ULONGEST: (type)->length * 8 ax-gdb.c: (in function gen_extend) LOC ax-gdb.c:512 (ax-gdb.c:511) - Function ax_trace_quick expects arg 2 to be int gets UINT: (type)->length + Function ax_trace_quick expects arg 2 to be int gets ULONGEST: (type)->length -LOC ax-gdb.c:597 - Function gen_offset expects arg 2 to be int gets LONGEST: frame_offset ax-gdb.c: (in function gen_frame_locals_address) -LOC ax-gdb.c:612 - Function gen_offset expects arg 2 to be int gets LONGEST: frame_offset -ax-gdb.c: (in function gen_sym_offset) -LOC ax-gdb.c:646 - Function gen_offset expects arg 2 to be int gets LONGEST: (var)->ginfo.value.ivalue ax-gdb.c: (in function gen_var_ref) ax-gdb.c: (in function gen_ptradd) LOC ax-gdb.c:1424 (ax-gdb.c:1427) + Function expects arg 2 to be int gets LONGEST: end - start +LOC ax-gdb.c:1428 Implicitly only storage value->type (type struct type *) not released before assignment: value->type = type ax-gdb.c: (in function gen_primitive_field) LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC bfin-tdep.c:538 - Function write_memory expects arg 3 to be ssize_t gets int: container_len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: container_len LOC breakpoint.c:2113 (breakpoint.c:2119) + Assignment of LONGEST to int: bl->target_info.length = bl->length +LOC breakpoint.c:2120 Test expression for if not boolean, type int: is_breakpoint(bl->owner) LOC breakpoint.c:4334 (breakpoint.c:4331) + Function expects arg 4 to be int gets LONGEST: loc->length +LOC breakpoint.c:4332 Test expression for if not boolean, type int: (*¤t_target.to_watchpoint_addr_within_range)(¤t_target, addr, loc->address, loc->length) LOC breakpoint.c:6309 (breakpoint.c:6306) - Operands of && are non-boolean (int): bl->length && breakpoint_address_match_range(bl->pspace->aspace, bl->address, bl->length, aspace, addr) + Function breakpoint_address_match_range expects arg 3 to be int gets LONGEST: bl->length +LOC breakpoint.c:6307 + Operands of && are non-booleans (LONGEST, int): bl->length && breakpoint_address_match_range(bl->pspace->aspace, bl->address, bl->length, aspace, addr) LOC breakpoint.c:9423 (breakpoint.c:9422) Return value (type int) ignored: create_breakpoin... +breakpoint.c: (in function breakpoint_hit_ranged_breakpoint) +LOC breakpoint.c:9450 + Function breakpoint_address_match_range expects arg 3 to be int gets LONGEST: bl->length breakpoint.c: (in function resources_needed_ranged_breakpoint) LOC breakpoint.c:15496 (breakpoint.c:15495) - Function observer_attach_memory_changed expects arg 1 to be observer_memory_changed_ftype * gets [function (CORE_ADDR, int, bfd_byte *) returns void]: invalidate_bp_value_on_memory_change + Function observer_attach_memory_changed expects arg 1 to be observer_memory_changed_ftype * gets [function (CORE_ADDR, LONGEST, bfd_byte *) returns void]: invalidate_bp_value_on_memory_change LOC breakpoint.c:7511 (breakpoint.c:7510) File static function VEC_int_safe_insert declared but not used LOC breakpoint.c:7511 (breakpoint.c:7510) Definition of VEC_int_safe_insert LOC c-lang.c:292 - Assignment of UINT to int: width = (element_type)->length + Assignment of ULONGEST to int: width = (element_type)->length LOC c-lang.c:418 - Function C_alloca expects arg 1 to be size_t gets UINT: (type)->length + Function C_alloca expects arg 1 to be size_t gets ULONGEST: (type)->length LOC c-lang.c:674 (c-lang.c:675) + Operands of != have incompatible types (UINT, ULONGEST): (UINT)((&output)->next_free - (&output)->object_base) != (type)->length +LOC c-lang.c:675 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Could not convert character " "constant to target character set") LOC c-lang.c:685 - Operands of < have incompatible types (int, UINT): i < (type)->length + Operands of < have incompatible types (LONGEST, ULONGEST): i < (type)->length LOC c-lang.c:697 - Assignment of UINT to LONGEST: high_bound = ((expect_type)->length / element_size) - 1 -LOC c-lang.c:699 - Operands of > have incompatible types (UINT, LONGEST): (UINT)((&output)->next_free - (&output)->object_base) / element_size > (high_bound - low_bound + 1) + Assignment of ULONGEST to LONGEST: high_bound = ((expect_type)->length / element_size) - 1 LOC cp-abi.c:96 - Path with no return in function declared to return int + Path with no return in function declared to return LONGEST LOC cp-valprint.c:363 (cp-valprint.c:366) + Variable i_offset initialized to type LONGEST, expects int: offset + ((((type)->main_type->flds_bnds.fields[i]).loc.bitpos) + 0) / 8 +LOC cp-valprint.c:366 Test expression for if not boolean, type int: valprint_check_validity(stream, i_type, i_offset, val) LOC cp-valprint.c:556 (cp-valprint.c:555) - Operands of >= have incompatible types (int, UINT): (boffset + offset) >= (real_type)->length + Operands of >= have incompatible types (LONGEST, ULONGEST): (boffset + offset) >= (real_type)->length LOC cp-valprint.c:560 (cp-valprint.c:559) - Function C_alloca expects arg 1 to be size_t gets UINT: (baseclass)->length + Function C_alloca expects arg 1 to be size_t gets ULONGEST: (baseclass)->length LOC cp-valprint.c:563 (cp-valprint.c:562) - Function target_read_memory expects arg 3 to be ssize_t gets UINT: (baseclass)->length + Function target_read_memory expects arg 3 to be ssize_t gets ULONGEST: (baseclass)->length LOC gdb_vecs.h:45 File static function VEC_probe_p_safe_insert declared but not used LOC gdb_vecs.h:45 Definition of VEC_probe_p_safe_insert LOC cris-tdep.c:683 - Function xmalloc expects arg 1 to be size_t gets int: len + Function xmalloc expects arg 1 to be size_t gets LONGEST: len LOC cris-tdep.c:684 (cris-tdep.c:685) + Assignment of LONGEST to int: si->len = len +LOC cris-tdep.c:685 Implicitly only storage si->prev (type struct stack_item *) not released before assignment: si->prev = prev LOC cris-tdep.c:686 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len cris-tdep.c: (in function cris_frame_unwind_cache) LOC cris-tdep.c:899 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len +LOC cris-tdep.c:1670 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len LOC cris-tdep.c:1678 (cris-tdep.c:1682) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len - 4 +LOC cris-tdep.c:1682 New fresh storage (type char *) passed as implicitly temp (not released): gettext("cris_store_return_value: type length too large.") LOC cris-tdep.c:1842 (cris-tdep.c:1847) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC cris-tdep.c:1847 Passed storage &val not completely defined: regcache_cooked_read_unsigned (..., &val) LOC cris-tdep.c:1850 (cris-tdep.c:1853) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len - 4 +LOC cris-tdep.c:1853 New fresh storage (type char *) passed as implicitly temp (not released): gettext("cris_extract_return_value: type length too large") LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC doublest.c:794 - Operands of == have incompatible types (int, UINT): len * 8 == gdbarch_long_double_format(gdbarch)[0]->totalsize + Operands of == have incompatible types (LONGEST, UINT): len * 8 == gdbarch_long_double_format(gdbarch)[0]->totalsize LOC doublest.c:801 - New fresh storage (type char *) passed as implicitly temp (not released): gettext("Unrecognized %d-bit floating-point type.") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("Unrecognized %s-bit floating-point type.") LOC doublest.c:857 - Function memset expects arg 3 to be size_t gets UINT: (type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (type)->length LOC doublest.c:883 - Function memset expects arg 3 to be size_t gets UINT: (to_type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (to_type)->length LOC doublest.c:893 - Function memset expects arg 3 to be size_t gets UINT: (to_type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (to_type)->length LOC doublest.c:894 - Function memcpy expects arg 3 to be size_t gets UINT: (((from_type)->length) < ((to_type)->length) ? ((from_type)->length) : ((to_type)->length)) + Function memcpy expects arg 3 to be size_t gets ULONGEST: (((from_type)->length) < ((to_type)->length) ? ((from_type)->length) : ((to_type)->length)) LOC dwarf2loc.c:1245 - Function memcpy expects arg 3 to be size_t gets UINT: (checked_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (checked_type)->length LOC dwarf2loc.c:1461 (dwarf2loc.c:1468) + Assignment of ULONGEST to UINT: source_offset_bits = source_offset % 8 +LOC dwarf2loc.c:1463 + Assignment of ULONGEST to UINT: dest_avail = 8 - dest_offset_bits % 8 +LOC dwarf2loc.c:1466 + Operands of < have incompatible types (UINT, ULONGEST): dest_avail < bit_count +LOC dwarf2loc.c:1468 Function extract_bits expects arg 3 to be int gets UINT: dest_avail LOC dwarf2loc.c:1470 + Function insert_bits expects arg 3 to be UINT gets ULONGEST: dest_offset_bits +LOC dwarf2loc.c:1470 Function insert_bits expects arg 4 to be int gets UINT: dest_avail LOC dwarf2loc.c:1489 - Function extract_bits expects arg 3 to be int gets UINT: bit_count + Function extract_bits expects arg 3 to be int gets ULONGEST: bit_count LOC dwarf2loc.c:1491 - Function insert_bits expects arg 4 to be int gets UINT: bit_count + Function insert_bits expects arg 3 to be UINT gets ULONGEST: dest_offset_bits +LOC dwarf2loc.c:1491 + Function insert_bits expects arg 4 to be int gets ULONGEST: bit_count dwarf2loc.c: (in function read_pieced_value) LOC dwarf2loc.c:1524 - Assignment of int to size_t: type_len = value_bitsize(v) + Assignment of int to ULONGEST: type_len = value_bitsize(v) LOC dwarf2loc.c:1529 (dwarf2loc.c:1527) - Assignment of UINT to size_t: type_len = 8 * (value_type(v))->length + Operands of < have incompatible types (LONGEST, ULONGEST): offset < type_len LOC dwarf2loc.c:1549 (dwarf2loc.c:1529) - Operands of < have incompatible types (LONGEST, size_t): offset < type_len + Assignment of ULONGEST to LONGEST: source_offset_bits = bits_to_skip LOC dwarf2loc.c:1561 (dwarf2loc.c:1538) - Assignment of ULONGEST to size_t: this_size_bits = p->size + Operands of < have incompatible types (size_t, ULONGEST): buffer_size < this_size LOC dwarf2loc.c:1563 (dwarf2loc.c:1539) - Operands of >= have incompatible types (ULONGEST, size_t): bits_to_skip >= this_size_bits -LOC dwarf2loc.c:1549 - Assignment of ULONGEST to LONGEST: source_offset_bits = bits_to_skip + Assignment of ULONGEST to size_t: buffer_size = this_size LOC dwarf2loc.c:1578 - Operands of < have incompatible types (size_t, int): this_size < register_size(arch, gdb_regnum) + Operands of < have incompatible types (ULONGEST, int): this_size < register_size(arch, gdb_regnum) LOC dwarf2loc.c:1581 - Assignment of arbitrary UINTegral type to int: reg_offset = register_size(arch, gdb_regnum) - this_size + Assignment of ULONGEST to int: reg_offset = register_size(arch, gdb_regnum) - this_size LOC dwarf2loc.c:1592 - Function get_frame_register_bytes expects arg 4 to be int gets size_t: this_size + Function get_frame_register_bytes expects arg 4 to be int gets ULONGEST: this_size LOC dwarf2loc.c:1596 (dwarf2loc.c:1598) + Function memset expects arg 3 to be size_t gets ULONGEST: this_size +LOC dwarf2loc.c:1598 Test expression for if not boolean, type int: optim LOC dwarf2loc.c:1601 - Function mark_value_bytes_unavailable expects arg 2 to be int gets LONGEST: offset -LOC dwarf2loc.c:1601 - Function mark_value_bytes_unavailable expects arg 3 to be int gets size_t: this_size + Function mark_value_bytes_unavailable expects arg 3 to be LONGEST gets ULONGEST: this_size LOC dwarf2loc.c:1616 + Function read_value_memory expects arg 6 to be size_t gets ULONGEST: this_size +LOC dwarf2loc.c:1616 Null storage buffer passed as non-null param: read_value_memory (..., buffer, ...) LOC dwarf2loc.c:1507 Storage buffer becomes null LOC dwarf2loc.c:1621 (dwarf2loc.c:1623) + Variable n initialized to type ULONGEST, expects size_t: this_size +LOC dwarf2loc.c:1623 Operands of > have incompatible types (size_t, LONGEST): n > c->addr_size - source_offset LOC dwarf2loc.c:1642 (dwarf2loc.c:1644) + Variable n initialized to type ULONGEST, expects size_t: this_size +LOC dwarf2loc.c:1644 Operands of > have incompatible types (size_t, ULONGEST): n > p->v.literal.length - source_offset LOC dwarf2loc.c:1669 - Function copy_bitwise expects arg 4 to be UINT gets LONGEST: source_offset_bits % 8 -LOC dwarf2loc.c:1670 - Function copy_bitwise expects arg 5 to be UINT gets size_t: this_size_bits + Function copy_bitwise expects arg 4 to be ULONGEST gets LONGEST: source_offset_bits % 8 LOC dwarf2loc.c:1708 - Assignment of int to size_t: type_len = value_bitsize(to) -LOC dwarf2loc.c:1711 - Assignment of UINT to size_t: type_len = 8 * (value_type(to))->length + Assignment of int to ULONGEST: type_len = value_bitsize(to) LOC dwarf2loc.c:1713 - Operands of < have incompatible types (LONGEST, size_t): offset < type_len + Operands of < have incompatible types (LONGEST, ULONGEST): offset < type_len LOC dwarf2loc.c:1731 (dwarf2loc.c:1721) - Assignment of ULONGEST to size_t: this_size_bits = p->size + Assignment of ULONGEST to LONGEST: dest_offset_bits = bits_to_skip LOC dwarf2loc.c:1752 (dwarf2loc.c:1722) - Operands of >= have incompatible types (ULONGEST, size_t): bits_to_skip >= this_size_bits + Operands of < have incompatible types (size_t, ULONGEST): buffer_size < this_size LOC dwarf2loc.c:1754 (dwarf2loc.c:1731) - Assignment of ULONGEST to LONGEST: dest_offset_bits = bits_to_skip + Assignment of ULONGEST to size_t: buffer_size = this_size LOC dwarf2loc.c:1770 - Operands of <= have incompatible types (size_t, int): this_size <= register_size(arch, gdb_regnum) + Operands of <= have incompatible types (ULONGEST, int): this_size <= register_size(arch, gdb_regnum) LOC dwarf2loc.c:1772 - Assignment of arbitrary UINTegral type to int: reg_offset = register_size(arch, gdb_regnum) - this_size + Assignment of ULONGEST to int: reg_offset = register_size(arch, gdb_regnum) - this_size LOC dwarf2loc.c:1781 - Function get_frame_register_bytes expects arg 4 to be int gets size_t: this_size + Function get_frame_register_bytes expects arg 4 to be int gets ULONGEST: this_size LOC dwarf2loc.c:1794 - Function copy_bitwise expects arg 2 to be UINT gets LONGEST: dest_offset_bits -LOC dwarf2loc.c:1795 - Function copy_bitwise expects arg 4 to be UINT gets LONGEST: source_offset_bits + Function copy_bitwise expects arg 2 to be ULONGEST gets LONGEST: dest_offset_bits LOC dwarf2loc.c:1795 (dwarf2loc.c:1796) - Function copy_bitwise expects arg 5 to be UINT gets size_t: this_size_bits + Function copy_bitwise expects arg 4 to be ULONGEST gets LONGEST: source_offset_bits LOC dwarf2loc.c:1801 - Function put_frame_register_bytes expects arg 4 to be int gets size_t: this_size + Function put_frame_register_bytes expects arg 4 to be int gets ULONGEST: this_size LOC dwarf2loc.c:1818 - Function copy_bitwise expects arg 2 to be UINT gets LONGEST: dest_offset_bits -LOC dwarf2loc.c:1819 - Function copy_bitwise expects arg 4 to be UINT gets LONGEST: source_offset_bits + Function copy_bitwise expects arg 2 to be ULONGEST gets LONGEST: dest_offset_bits LOC dwarf2loc.c:1819 (dwarf2loc.c:1820) - Function copy_bitwise expects arg 5 to be UINT gets size_t: this_size_bits + Function copy_bitwise expects arg 4 to be ULONGEST gets LONGEST: source_offset_bits LOC dwarf2loc.c:1825 - Function write_memory expects arg 3 to be ssize_t gets size_t: this_size + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: this_size LOC dwarf2loc.c:1867 - Operands of >= have incompatible types (int, size_t): bit_offset >= this_size_bits + Operands of >= have incompatible types (LONGEST, size_t): bit_offset >= this_size_bits dwarf2loc.c: (in function indirect_pieced_value) LOC dwarf2loc.c:1967 (dwarf2loc.c:1966) - Operands of >= have incompatible types (int, size_t): bit_offset >= this_size_bits + Operands of >= have incompatible types (LONGEST, size_t): bit_offset >= this_size_bits LOC dwarf2loc.c:2155 (dwarf2loc.c:2153) - Function set_value_offset expects arg 2 to be int gets LONGEST: byte_offset -LOC dwarf2loc.c:2154 Fresh storage c not released before scope exit LOC dwarf2loc.c:2147 (dwarf2loc.c:2146) Fresh storage c created LOC dwarf2loc.c:2198 (dwarf2loc.c:2195) - Variable n initialized to type UINT, expects size_t: (value_type(value))->length -LOC dwarf2loc.c:2197 - Operands of > have incompatible types (LONGEST, size_t): byte_offset + (type)->length > n + Operands of > have incompatible types (LONGEST, ULONGEST): byte_offset + (type)->length > n LOC dwarf2loc.c:2221 (dwarf2loc.c:2213) - Operands of > have incompatible types (size_t, UINT): n > (type)->length -LOC dwarf2loc.c:2219 - Assignment of UINT to size_t: n = (type)->length -LOC dwarf2loc.c:2220 Fresh storage objfile_gdbarch not released before scope exit LOC dwarf2loc.c:2216 (dwarf2loc.c:2215) Fresh storage objfile_gdbarch created LOC dwarf2loc.c:2222 + Function memcpy expects arg 3 to be size_t gets ULONGEST: n +LOC dwarf2loc.c:2223 Fresh storage value not released before scope exit LOC dwarf2loc.c:2193 (dwarf2loc.c:2192) Fresh storage value created LOC dwarf2loc.c:2242 (dwarf2loc.c:2241) - Operands of > have incompatible types (size_t, UINT): n > (type)->length + Operands of > have incompatible types (size_t, ULONGEST): n > (type)->length LOC dwarf2loc.c:2248 (dwarf2loc.c:2247) - Assignment of UINT to size_t: n = (type)->length + Assignment of ULONGEST to size_t: n = (type)->length LOC dwarf2read.c:978 - New fresh storage (type char *) passed as implicitly temp (not released): gettext("const value length mismatch for '%s', got %d, expected %d") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("const value length mismatch for '%s', got %s, expected %s") dwarf2read.c: (in function dwarf2_section_buffer_overflow_complaint) LOC dwarf2read.c:6086 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC dwarf2read.c:7732 (dwarf2read.c:7733) + Assignment of size_t to ULONGEST: dlbaton->size = ((attr)->u.blk)->size +LOC dwarf2read.c:7733 Implicitly only storage dlbaton->per_cu (type struct dwarf2_per_cu_data *) not released before assignment: dlbaton->per_cu = cu->per_cu LOC dwarf2read.c:7834 (dwarf2read.c:7831) - Assignment of UINT to size_t: parameter->value_size = ((attr)->u.blk)->size -LOC dwarf2read.c:7834 Implicitly only storage parameter->data_value (type gdb_byte *) not released before assignment: parameter->data_value = NULL LOC dwarf2read.c:7853 (dwarf2read.c:7849) - Assignment of UINT to size_t: parameter->data_value_size = ((attr)->u.blk)->size -LOC dwarf2read.c:7853 Fresh storage gdbarch not released before return LOC dwarf2read.c:7611 Fresh storage gdbarch created LOC dwarf2read.c:8474 (dwarf2read.c:8473) - Assignment of LONGEST to int: ((*fp).loc.bitpos) = (offset * bits_per_byte) -LOC dwarf2read.c:8474 Fresh storage attr (type struct attribute *) not released before assignment: attr = dwarf2_attr(die, DW_AT_bit_offset, cu) LOC dwarf2read.c:8461 Fresh storage attr created LOC dwarf2read.c:8495 (dwarf2read.c:8484) - Assignment of ULONGEST to int: ((*fp).loc.bitpos) = ((((*fp).loc.bitpos) + 0) + ((attr)->u.unsnd)) -LOC dwarf2read.c:8495 Variable bit_offset initialized to type ULONGEST, expects int: ((attr)->u.unsnd) LOC dwarf2read.c:8584 (dwarf2read.c:8582) - Assignment of LONGEST to int: ((*fp).loc.bitpos) = (offset * bits_per_byte) -LOC dwarf2read.c:8584 Implicitly only storage fp->type (type struct type *) not released before assignment: ((*fp).type) = die_type(die, cu) LOC dwarf2read.c:9133 (dwarf2read.c:9126) - Assignment of ULONGEST to UINT: (type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:9133 Test expression for if not boolean, type int: producer_is_icc(cu) LOC dwarf2read.c:9421 (dwarf2read.c:9409) - Assignment of ULONGEST to UINT: (type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:9421 Test expression for if not boolean, type int: die_is_declaration(die, cu) LOC dwarf2read.c:9634 (dwarf2read.c:9631) - Assignment of ULONGEST to UINT: (type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:9634 New fresh storage (type char *) passed as implicitly temp (not released): gettext("DW_AT_byte_size for array type smaller " "than the total size of elements") LOC dwarf2read.c:9707 (dwarf2read.c:9705) - Assignment of ULONGEST to UINT: (set_type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:9707 Fresh storage domain_type not released before return LOC dwarf2read.c:9694 Fresh storage domain_type created LOC dwarf2read.c:9946 - Operands of != have incompatible types (UINT, int): (type)->length != byte_size + Operands of != have incompatible types (ULONGEST, int): (type)->length != byte_size LOC dwarf2read.c:9958 - Operands of != have incompatible types (UINT, int): (type)->length != byte_size + Operands of != have incompatible types (ULONGEST, int): (type)->length != byte_size LOC dwarf2read.c:10024 (dwarf2read.c:10020) - Assignment of ULONGEST to UINT: (type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:10024 - Assignment of unsigned char to UINT: (type)->length = cu_header->addr_size + Assignment of unsigned char to ULONGEST: (type)->length = cu_header->addr_size LOC dwarf2read.c:10536 - Operands of >= have incompatible types (UINT, int): (int_type)->length >= addr_size + Operands of >= have incompatible types (ULONGEST, int): (int_type)->length >= addr_size LOC dwarf2read.c:10541 - Operands of >= have incompatible types (UINT, int): (int_type)->length >= addr_size + Operands of >= have incompatible types (ULONGEST, int): (int_type)->length >= addr_size LOC dwarf2read.c:10546 - Operands of >= have incompatible types (UINT, int): (int_type)->length >= addr_size + Operands of >= have incompatible types (ULONGEST, int): (int_type)->length >= addr_size LOC dwarf2read.c:10579 (dwarf2read.c:10577) - Assignment of ULONGEST to UINT: (range_type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:10579 Return value (type struct type *) ignored: set_die_type(die... LOC dwarf2read.c:11635 (dwarf2read.c:11637) + Assignment of UINT to size_t: blk->size = read_2_bytes(abfd, info_ptr) +LOC dwarf2read.c:11637 + Function read_n_bytes expects arg 3 to be UINT gets size_t: blk->size +LOC dwarf2read.c:11637 Implicitly only storage blk->data (type gdb_byte *) not released before assignment: blk->data = read_n_bytes(abfd, info_ptr, blk->size) LOC dwarf2read.c:11643 (dwarf2read.c:11645) + Assignment of UINT to size_t: blk->size = read_4_bytes(abfd, info_ptr) +LOC dwarf2read.c:11645 + Function read_n_bytes expects arg 3 to be UINT gets size_t: blk->size +LOC dwarf2read.c:11645 Implicitly only storage blk->data (type gdb_byte *) not released before assignment: blk->data = read_n_bytes(abfd, info_ptr, blk->size) LOC dwarf2read.c:11679 - Assignment of ULONGEST to UINT: blk->size = read_unsigned_leb128(abfd, info_ptr, &bytes_read) + Assignment of ULONGEST to size_t: blk->size = read_unsigned_leb128(abfd, info_ptr, &bytes_read) +LOC dwarf2read.c:11681 + Function read_n_bytes expects arg 3 to be UINT gets size_t: blk->size LOC dwarf2read.c:11687 (dwarf2read.c:11689) + Assignment of UINT to size_t: blk->size = read_1_byte(abfd, info_ptr) +LOC dwarf2read.c:11689 + Function read_n_bytes expects arg 3 to be UINT gets size_t: blk->size +LOC dwarf2read.c:11689 Implicitly only storage blk->data (type gdb_byte *) not released before assignment: blk->data = read_n_bytes(abfd, info_ptr, blk->size) LOC dwarf2read.c:13244 - Operands of == have incompatible types (UINT, int): ((attr)->u.blk)->size == 1 + leb128_size(&((attr)->u.blk)->data[1]) + Operands of == have incompatible types (size_t, int): ((attr)->u.blk)->size == 1 + leb128_size(&((attr)->u.blk)->data[1]) LOC dwarf2read.c:13709 - Operands of != have incompatible types (UINT, unsigned char): (type)->length != cu_header->addr_size + Operands of != have incompatible types (ULONGEST, unsigned char): (type)->length != cu_header->addr_size LOC dwarf2read.c:13711 - Function dwarf2_const_value_length_mismatch_complaint expects arg 2 to be int gets unsigned char: cu_header->addr_size + Function dwarf2_const_value_length_mismatch_complaint expects arg 2 to be LONGEST gets unsigned char: cu_header->addr_size LOC dwarf2read.c:13744 (dwarf2read.c:13745) - Function dwarf2_const_value_length_mismatch_complaint expects arg 2 to be int gets UINT: blk->size + Operands of != have incompatible types (ULONGEST, size_t): (type)->length != blk->size LOC dwarf2read.c:13745 (dwarf2read.c:13746) - Function dwarf2_const_value_length_mismatch_complaint expects arg 3 to be int gets UINT: (type)->length + Function dwarf2_const_value_length_mismatch_complaint expects arg 2 to be LONGEST gets size_t: blk->size +LOC dwarf2read.c:13746 + Function dwarf2_const_value_length_mismatch_complaint expects arg 3 to be LONGEST gets ULONGEST: (type)->length LOC dwarf2read.c:14683 (dwarf2read.c:14691) + Function pulongest expects arg 1 to be ULONGEST gets size_t: ((&die->attrs[i])->u.blk)->size +LOC dwarf2read.c:14687 + Function pulongest expects arg 1 to be ULONGEST gets size_t: ((&die->attrs[i])->u.blk)->size +LOC dwarf2read.c:14691 Function hex_string expects arg 1 to be LONGEST gets ULONGEST: ((&die->attrs[i])->u.unsnd) LOC dwarf2read.c:15064 (dwarf2read.c:15070) + Assignment of size_t to ULONGEST: retval.size = ((attr)->u.blk)->size +LOC dwarf2read.c:15070 Null storage retval.data returned as non-null: retval LOC dwarf2read.c:15041 Storage retval.data becomes null LOC dwarf2read.c:15267 - Variable size initialized to type UINT, expects int: blk->size + Variable size initialized to type size_t, expects int: blk->size LOC dwarf2read.c:16526 (dwarf2read.c:16527) + Assignment of size_t to ULONGEST: baton->size = ((attr)->u.blk)->size +LOC dwarf2read.c:16527 Implicitly only storage baton->data (type gdb_byte *) not released before assignment: baton->data = ((attr)->u.blk)->data LOC dwarf2read.c:333 File static function VEC_delayed_method_info_safe_insert declared but not used LOC dwarf2read.c:333 Definition of VEC_delayed_method_info_safe_insert LOC eval.c:446 (eval.c:445) - Function memcpy expects arg 3 to be size_t gets UINT: (value_type(val))->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (value_type(val))->length LOC eval.c:489 (eval.c:488) - Function memcpy expects arg 3 to be size_t gets int: element_size + Function memcpy expects arg 3 to be size_t gets LONGEST: element_size LOC eval.c:498 (eval.c:497) - Function memcpy expects arg 3 to be size_t gets int: element_size + Function memcpy expects arg 3 to be size_t gets LONGEST: element_size LOC eval.c:611 (eval.c:610) - Operands of > have incompatible types (UINT, int): (type1)->length * 8 > gdbarch_double_bit(gdbarch) + Operands of > have incompatible types (ULONGEST, int): (type1)->length * 8 > gdbarch_double_bit(gdbarch) LOC eval.c:612 (eval.c:611) - Operands of > have incompatible types (UINT, int): (type2)->length * 8 > gdbarch_double_bit(gdbarch) + Operands of > have incompatible types (ULONGEST, int): (type2)->length * 8 > gdbarch_double_bit(gdbarch) LOC eval.c:715 (eval.c:714) - Operands of > have incompatible types (UINT, int): result_len > gdbarch_long_bit(gdbarch) / 8 + Operands of > have incompatible types (ULONGEST, int): result_len > gdbarch_long_bit(gdbarch) / 8 LOC eval.c:722 (eval.c:721) - Operands of > have incompatible types (UINT, int): result_len > gdbarch_long_bit(gdbarch) / 8 + Operands of > have incompatible types (ULONGEST, int): result_len > gdbarch_long_bit(gdbarch) / 8 LOC eval.c:979 (eval.c:978) - Function memset expects arg 3 to be size_t gets UINT: (type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (type)->length LOC eval.c:998 (eval.c:997) - Function memset expects arg 3 to be size_t gets UINT: (expect_type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (expect_type)->length LOC eval.c:1029 (eval.c:1028) - Function memcpy expects arg 3 to be size_t gets int: element_size + Function memcpy expects arg 3 to be size_t gets LONGEST: element_size LOC eval.c:1052 (eval.c:1051) - Function memset expects arg 3 to be size_t gets UINT: (type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (type)->length LOC findcmd.c:182 - Operands of > have incompatible types (int, size_t): (val_bytes) > (sizeof(int64_t)) + Operands of > have incompatible types (LONGEST, size_t): (val_bytes) > (sizeof(int64_t)) LOC findcmd.c:182 - Conditional clauses are not of same type: (val_bytes) (int), (sizeof(int64_t)) (size_t) + Conditional clauses are not of same type: (val_bytes) (LONGEST), (sizeof(int64_t)) (size_t) LOC findcmd.c:216 - Function memcpy expects arg 3 to be size_t gets int: val_bytes + Function memcpy expects arg 3 to be size_t gets LONGEST: val_bytes findvar.c: (in function signed_pointer_to_address) findvar.c: (in function address_to_signed_pointer) LOC findvar.c:468 + Function store_signed_integer expects arg 2 to be int gets LONGEST: len +LOC findvar.c:468 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents_raw(v) LOC findvar.c:493 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC frv-tdep.c:1129 (frv-tdep.c:1135) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC frv-tdep.c:1135 Passed storage ®val not completely defined: regcache_cooked_read_unsigned (..., ®val) LOC frv-tdep.c:1142 - New fresh storage (type char *) passed as implicitly temp (not released): gettext("Illegal return value length: %d") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("Illegal return value length: %s") LOC frv-tdep.c:1282 (frv-tdep.c:1286) + Variable partial_len initialized to type LONGEST, expects int: (len < 4 ? len : 4) +LOC frv-tdep.c:1286 Function extract_unsigned_integer expects arg 1 to be gdb_byte * gets char *: val LOC frv-tdep.c:1337 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC frv-tdep.c:1347 - New fresh storage (type char *) passed as implicitly temp (not released): gettext("Don't know how to return a %d-byte value.") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("Don't know how to return a %s-byte value.") frv-tdep.c: (in function frv_return_value) LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC f-valprint.c:85 Return value type LONGEST does not match declared type int: ((((((type))->main_type->flds_bnds.fields[0]).type))->main_type->flds_bnds.bounds->high) -f-valprint.c: (in function f77_get_dynamic_length_of_aggregate) -LOC f-valprint.c:115 - Assignment of int to UINT: (type)->length = (upper_bound - lower_bound + 1) * (check_typedef((type)->main_type->target_type))->length f-valprint.c: (in function f77_create_arrayprint_offset_tbl) LOC f-valprint.c:178 + Operands of < have incompatible types (int, LONGEST): i < (f77_array_offset_tbl[nss][1]) +LOC f-valprint.c:178 Operands of < have incompatible types (int, UINT): (*elts) < options->print_max LOC f-valprint.c:189 (f-valprint.c:194) + Operands of < have incompatible types (int, LONGEST): i < (f77_array_offset_tbl[nss][1]) +LOC f-valprint.c:194 + Operands of < have incompatible types (int, LONGEST): i < (f77_array_offset_tbl[nss][1]) +LOC f-valprint.c:194 Operands of < have incompatible types (int, UINT): (*elts) < options->print_max LOC f-valprint.c:203 (f-valprint.c:206) + Operands of != have incompatible types (int, LONGEST): i != ((f77_array_offset_tbl[nss][1]) - 1) +LOC f-valprint.c:206 Operands of == have incompatible types (int, UINT): *elts == options->print_max - 1 +LOC f-valprint.c:207 + Operands of != have incompatible types (int, LONGEST): i != ((f77_array_offset_tbl[nss][1]) - 1) f-valprint.c: (in function f77_print_array) LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC gdbtypes.c:804 - Operands of > have incompatible types (UINT, size_t): (type)->length > sizeof(LONGEST) + Operands of > have incompatible types (ULONGEST, size_t): (type)->length > sizeof(LONGEST) LOC gdbtypes.c:906 (gdbtypes.c:902) - Assignment of LONGEST to UINT: (result_type)->length = (element_type)->length * (high_bound - low_bound + 1) -LOC gdbtypes.c:906 Test expression for conditional not boolean, type UINT: ((result_type)->main_type->flag_objfile_owned) gdbtypes.c: (in function smash_to_methodptr_type) LOC gdbtypes.c:1653 (gdbtypes.c:1645) - Assignment of ULONGEST to UINT: (type)->length = len -LOC gdbtypes.c:1653 Fresh storage target_type not released before scope exit LOC gdbtypes.c:1603 Fresh storage target_type created LOC gnu-v2-abi.c:168 (gnu-v2-abi.c:165) - Function set_value_offset expects arg 2 to be int gets LONGEST: value_offset(arg1) + value_as_long(value_field(entry, 0)) -LOC gnu-v2-abi.c:168 Operand of ! is non-boolean (int): !value_lazy(arg1) LOC gnu-v2-abi.c:272 (gnu-v2-abi.c:271) - Left operand of && is non-boolean (int *): top && ((*top) > 0) + Left operand of && is non-boolean (LONGEST *): top && ((*top) > 0) LOC gnu-v2-abi.c:382 (gnu-v2-abi.c:381) - Return value type ULONGEST does not match declared type int: addr - (LONGEST)address + embedded_offset + Return value type ULONGEST does not match declared type LONGEST: addr - (LONGEST)address + embedded_offset LOC gnu-v2-abi.c:395 (gnu-v2-abi.c:394) - Test expression for if not boolean, type int: boffset + Test expression for if not boolean, type LONGEST: boffset LOC gdb_vecs.h:45 File static function VEC_probe_p_safe_insert declared but not used LOC gdb_vecs.h:45 Definition of VEC_probe_p_safe_insert LOC gnu-v3-abi.c:346 (gnu-v3-abi.c:345) - Assignment of LONGEST to int: *top_p = -offset_to_top -LOC gnu-v3-abi.c:346 Fresh storage gdbarch not released before return LOC gnu-v3-abi.c:295 Fresh storage gdbarch created LOC gnu-v3-abi.c:456 - Return value type LONGEST does not match declared type int: base_offset -LOC gnu-v3-abi.c:456 Fresh storage gdbarch not released before return LOC gnu-v3-abi.c:429 Fresh storage gdbarch created LOC gnu-v3-abi.c:645 - Return value type UINT does not match declared type int: 2 * (builtin_type(gdbarch)->builtin_data_ptr)->length + Return value type ULONGEST does not match declared type int: 2 * (builtin_type(gdbarch)->builtin_data_ptr)->length LOC gnu-v3-abi.c:749 File static function VEC_value_and_voffset_p_safe_insert declared but not used LOC gnu-v3-abi.c:749 Definition of VEC_value_and_voffset_p_safe_insert LOC go-valprint.c:107 (go-valprint.c:109) + Function print_go_string expects arg 3 to be int gets LONGEST: embedded_offset +LOC go-valprint.c:109 Fresh storage type not released before return LOC go-valprint.c:94 Fresh storage type created LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC h8300-tdep.c:675 - Function C_alloca expects arg 1 to be size_t gets int: padded_len + Function C_alloca expects arg 1 to be size_t gets LONGEST: padded_len LOC h8300-tdep.c:677 - Function memset expects arg 3 to be size_t gets int: padded_len + Function memset expects arg 3 to be size_t gets LONGEST: padded_len LOC h8300-tdep.c:679 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC h8300-tdep.c:686 - Right operand of && is non-boolean (int): len > wordsize && len % wordsize + Right operand of && is non-boolean (LONGEST): len > wordsize && len % wordsize LOC h8300-tdep.c:689 - Function write_memory expects arg 3 to be ssize_t gets int: padded_len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: padded_len LOC h8300-tdep.c:716 - Function write_memory expects arg 3 to be ssize_t gets int: padded_len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: padded_len LOC h8300-tdep.c:928 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC hppa-tdep.c:740 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC hppa-tdep.c:766 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC hppa-tdep.c:1026 + Function regcache_cooked_write_part expects arg 4 to be int gets LONGEST: len +LOC hppa-tdep.c:1026 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents(arg) LOC hppa-tdep.c:1062 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len +LOC hppa-tdep.c:1068 + Function regcache_cooked_write_part expects arg 4 to be int gets LONGEST: ((len) < (8) ? (len) : (8)) LOC hppa-tdep.c:1141 - Operands of < have incompatible types (int, UINT): b < (type)->length + Operands of < have incompatible types (int, ULONGEST): b < (type)->length LOC hppa-tdep.c:1181 (hppa-tdep.c:1183) + Assignment of LONGEST to int: offset = 8 - len +LOC hppa-tdep.c:1183 Test expression for if not boolean, type int: hppa64_floating_p(type) LOC hppa-tdep.c:1203 (hppa-tdep.c:1224) + Assignment of LONGEST to int: offset = 8 - len +LOC hppa-tdep.c:1225 + Function regcache_cooked_read_part expects arg 4 to be int gets LONGEST: ((len) < (8) ? (len) : (8)) +LOC hppa-tdep.c:1224 Return value (type enum register_status) ignored: regcache_cooked_... LOC hppa-tdep.c:1237 (hppa-tdep.c:1156) + Function regcache_cooked_write_part expects arg 4 to be int gets LONGEST: ((len) < (8) ? (len) : (8)) +LOC hppa-tdep.c:1156 Parameter gdbarch not used LOC hppa-tdep.c:2779 File static variable hppa_sigtramp declared but not used LOC i386-darwin-tdep.c:132 - Return value type UINT does not match declared type int: (type)->length + Return value type ULONGEST does not match declared type LONGEST: (type)->length +LOC i386-darwin-tdep.c:202 + Function align_up expects arg 1 to be ULONGEST gets LONGEST: args_space LOC i386-darwin-tdep.c:202 - Function align_up expects arg 1 to be ULONGEST gets int: args_space + Function align_up expects arg 2 to be int gets LONGEST: align LOC i386-darwin-tdep.c:205 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ../bfd/libbfd.h:768 *** Internal Bug at usymtab.c:930: usymtab_supEntryAux: inconsistent state (lexlevel = 0, modFunction = true) adding: ? __PRETTY_FUNCTION__ [errno: 25] *** Please report bug to splint-bug@splint.org *** (attempting to continue, results may be incorrect) 1 internal bugs reported LOC i386-nat.c:325 - Operands of || are non-booleans (CORE_ADDR, int): addr || len + Operands of || are non-booleans (CORE_ADDR, LONGEST): addr || len i386-nat.c: (in function i386_length_and_rw_bits) LOC i386-nat.c:531 (i386-nat.c:553) + Conditional clauses are not of same type: (max_wp_len - 1) (int), len - 1 (LONGEST) +LOC i386-nat.c:553 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n") LOC i386-nat.c:613 (i386-nat.c:622) + Function i386_length_and_rw_bits expects arg 1 to be int gets LONGEST: len +LOC i386-nat.c:622 Test expression for if not boolean, type int: maint_show_dr LOC i386-nat.c:647 (i386-nat.c:656) + Function i386_length_and_rw_bits expects arg 1 to be int gets LONGEST: len +LOC i386-nat.c:656 Test expression for if not boolean, type int: maint_show_dr LOC progspace.h:37 File static function VEC_so_list_ptr_safe_insert declared but not used LOC progspace.h:37 Definition of VEC_so_list_ptr_safe_insert LOC i386-tdep.c:2379 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC i386-tdep.c:2454 - Function memset expects arg 3 to be size_t gets int: len + Function memset expects arg 3 to be size_t gets LONGEST: len LOC i386-tdep.c:2473 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC i386-tdep.c:2480 - Function memcpy expects arg 3 to be size_t gets int: len - low_size + Function memcpy expects arg 3 to be size_t gets LONGEST: len - low_size LOC i386-tdep.c:2484 - New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot extract return value of %d bytes long.") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot extract return value of %s bytes long.") LOC i386-tdep.c:2540 (i386-tdep.c:2549) - New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot store return value of %d bytes long.") + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len +LOC i386-tdep.c:2545 + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len - low_size +LOC i386-tdep.c:2549 + New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot store return value of %s bytes long.") LOC i386-tdep.c:2643 (i386-tdep.c:2642) - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length i386-tdep.c: (in function i386_register_to_value) LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC ia64-tdep.c:3740 (ia64-tdep.c:3738) - Operands of && are non-boolean (int): (nslots & 1) && slot_alignment_is_next_even(type) + Operands of && are non-booleans (LONGEST, int): (nslots & 1) && slot_alignment_is_next_even(type) LOC ia64-tdep.c:3822 (ia64-tdep.c:3820) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC ia64-tdep.c:3822 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents(arg) LOC ia64-tdep.c:131 File static variable lr_regnum declared but not used LOC infcall.c:1018 - Function read_value_memory expects arg 6 to be size_t gets UINT: (values_type)->length + Function read_value_memory expects arg 6 to be size_t gets ULONGEST: (values_type)->length LOC infcall.c:1035 - Function read_value_memory expects arg 6 to be size_t gets UINT: (values_type)->length + Function read_value_memory expects arg 6 to be size_t gets ULONGEST: (values_type)->length LOC infrun.c:6588 - Operands of != have incompatible types (LONGEST, UINT): transferred != (value_type(v))->length + Operands of != have incompatible types (LONGEST, ULONGEST): transferred != (value_type(v))->length LOC infrun.c:6609 - Operands of != have incompatible types (LONGEST, UINT): transferred != (value_type(fromval))->length + Operands of != have incompatible types (LONGEST, ULONGEST): transferred != (value_type(fromval))->length LOC infrun.c:6680 (infrun.c:6677) - Variable len initialized to type UINT, expects size_t: (type)->length + Function xmalloc expects arg 1 to be size_t gets ULONGEST: len LOC infrun.c:6683 - Operands of == have incompatible types (LONGEST, size_t): target_read(¤t_target, TARGET_OBJECT_SIGNAL_INFO, NULL, siginfo_data, 0, len) == len + Operands of == have incompatible types (LONGEST, ULONGEST): target_read(¤t_target, TARGET_OBJECT_SIGNAL_INFO, NULL, siginfo_data, 0, len) == len LOC infrun.c:6737 (infrun.c:6734) - Variable len initialized to type UINT, expects size_t: (type)->length -LOC infrun.c:6738 - Function target_write expects arg 6 to be LONGEST gets size_t: len + Function target_write expects arg 6 to be LONGEST gets ULONGEST: (type)->length LOC probe.h:128 File static function VEC_probe_ops_cp_safe_insert declared but not used LOC probe.h:128 Definition of VEC_probe_ops_cp_safe_insert iq2000-tdep.c: (in function iq2000_register_name) +LOC iq2000-tdep.c:513 + Test expression for conditional not boolean, type LONGEST: len % 4 LOC iq2000-tdep.c:513 - Test expression for conditional not boolean, type int: len % 4 + Variable size initialized to type LONGEST, expects int: len % 4 ? : 4 +LOC iq2000-tdep.c:564 + Test expression for conditional not boolean, type LONGEST: len % 4 LOC iq2000-tdep.c:564 - Test expression for conditional not boolean, type int: len % 4 + Variable size initialized to type LONGEST, expects int: len % 4 ? : 4 LOC iq2000-tdep.c:581 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC iq2000-tdep.c:739 (iq2000-tdep.c:740) - Function memcpy expects arg 3 to be size_t gets int: typelen + Assignment of LONGEST to int: slacklen = (4 - (typelen % 4)) % 4 +LOC iq2000-tdep.c:741 + Function memcpy expects arg 3 to be size_t gets LONGEST: typelen LOC iq2000-tdep.c:772 (iq2000-tdep.c:771) - Function write_memory expects arg 3 to be ssize_t gets int: typelen + Function write_memory expects arg 3 to be ssize_t gets LONGEST: typelen LOC iq2000-tdep.c:782 (iq2000-tdep.c:781) - Function write_memory expects arg 3 to be ssize_t gets int: typelen + Function write_memory expects arg 3 to be ssize_t gets LONGEST: typelen LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC jv-lang.c:469 (jv-lang.c:467) - Assignment of LONGEST to int: boffset = value_as_long(value_struct_elt(&temp, NULL, "boffset", NULL, "structure")) -LOC jv-lang.c:469 Test expression for if not boolean, type int: accflags & 0x0001 LOC jv-lang.c:482 - Assignment of int to CORE_ADDR: (((type)->main_type->flds_bnds.fields[i]).loc.physaddr) = (boffset) + Assignment of LONGEST to CORE_ADDR: (((type)->main_type->flds_bnds.fields[i]).loc.physaddr) = (boffset) LOC jv-lang.c:611 - Return value type UINT does not match declared type int: (objtype)->length + Return value type ULONGEST does not match declared type int: (objtype)->length LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC lm32-tdep.c:287 (lm32-tdep.c:295) - Function write_memory expects arg 3 to be ssize_t gets int: len + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC lm32-tdep.c:295 + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC lm32-tdep.c:340 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length +LOC lm32-tdep.c:357 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC lm32-tdep.c:364 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len - 4 LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC m2-lang.c:121 (m2-lang.c:129) + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC m2-lang.c:129 Test expression for if not boolean, type int: quit_flag LOC m2-lang.c:139 (m2-lang.c:147) + Operands of < have incompatible types (UINT, ULONGEST): rep1 < length +LOC m2-lang.c:147 Test expression for if not boolean, type int: in_quotes LOC m2-lang.c:185 + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC m2-lang.c:185 Left operand of || is non-boolean (int): force_ellipses || i < length LOC symtab.h:1267 File static function VEC_CORE_ADDR_safe_insert declared but not used LOC symtab.h:1267 Definition of VEC_CORE_ADDR_safe_insert LOC m2-typeprint.c:377 (m2-typeprint.c:374) - Operands of < have incompatible types (UINT, size_t): (type)->length < sizeof(LONGEST) + Operands of < have incompatible types (ULONGEST, size_t): (type)->length < sizeof(LONGEST) LOC m2-typeprint.c:591 (m2-typeprint.c:610) - Operands of != have incompatible types (int, LONGEST): lastval != ((((type)->main_type->flds_bnds.fields[i]).loc.enumval) + 0) -LOC m2-typeprint.c:614 - Assignment of LONGEST to int: lastval = ((((type)->main_type->flds_bnds.fields[i]).loc.enumval) + 0) -LOC m2-typeprint.c:588 Parameter level not used LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC m2-valprint.c:276 (m2-valprint.c:277) - Assignment of UINT to int: eltlen = (type)->length -LOC m2-valprint.c:278 Test expression for if not boolean, type int: options->prettyprint_arrays LOC m2-valprint.c:423 (m2-valprint.c:426) Variable i shadows outer declaration LOC m2-valprint.c:319 (m2-valprint.c:320) - Previous definition of i: UINT + Previous definition of i: ULONGEST LOC target.h:1034 File static function VEC_memory_write_request_s_safe_insert declared but not used LOC target.h:1034 Definition of VEC_memory_write_request_s_safe_insert LOC m32r-tdep.c:744 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC m32r-tdep.c:799 (m32r-tdep.c:805) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: (len > 4 ? len - 4 : len) +LOC m32r-tdep.c:805 Return value (type enum register_status) ignored: regcache_cooked_... LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert +LOC m68hc11-tdep.c:1196 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len LOC m68hc11-tdep.c:1213 - Test expression for if not boolean, type int: len & 1 + Test expression for if not boolean, type LONGEST: len & 1 LOC m68hc11-tdep.c:1222 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len +LOC m68hc11-tdep.c:1275 + Function regcache_raw_write_part expects arg 3 to be int gets LONGEST: 2 - len +LOC m68hc11-tdep.c:1275 + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len +LOC m68hc11-tdep.c:1278 + Function regcache_raw_write_part expects arg 3 to be int gets LONGEST: 4 - len +LOC m68hc11-tdep.c:1279 + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len - 2 LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC m68k-tdep.c:225 - Function get_frame_register_bytes expects arg 4 to be int gets UINT: (type)->length + Function get_frame_register_bytes expects arg 4 to be int gets ULONGEST: (type)->length LOC m68k-tdep.c:301 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC m68k-tdep.c:306 - Function memcpy expects arg 3 to be size_t gets int: len - 4 + Function memcpy expects arg 3 to be size_t gets LONGEST: len - 4 LOC m68k-tdep.c:311 - New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot extract return value of %d bytes long.") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot extract return value of %s bytes long.") m68k-tdep.c: (in function m68k_svr4_extract_return_value) LOC m68k-tdep.c:323 (m68k-tdep.c:318) - Variable len initialized to type UINT, expects int: (type)->length -LOC m68k-tdep.c:323 Left operand of && is non-boolean (int): tdep->float_return && (type)->main_type->code == TYPE_CODE_FLT LOC m68k-tdep.c:344 (m68k-tdep.c:353) - New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot store return value of %d bytes long.") -m68k-tdep.c: (in function m68k_svr4_store_return_value) + Function regcache_raw_write_part expects arg 3 to be int gets LONGEST: 4 - len +LOC m68k-tdep.c:344 + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len LOC m68k-tdep.c:347 (m68k-tdep.c:360) - Variable len initialized to type UINT, expects int: (type)->length + Function regcache_raw_write_part expects arg 3 to be int gets LONGEST: 8 - len +LOC m68k-tdep.c:348 + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len - 4 +LOC m68k-tdep.c:353 + New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot store return value of %s bytes long.") +m68k-tdep.c: (in function m68k_svr4_store_return_value) LOC m68k-tdep.c:426 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC m68k-tdep.c:465 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC m68k-tdep.c:532 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert +LOC m88k-tdep.c:312 + Variable stack_word initialized to type LONGEST, expects int: num_stack_words LOC m88k-tdep.c:316 (m88k-tdep.c:318) + Variable register_word initialized to type LONGEST, expects int: num_register_words +LOC m88k-tdep.c:318 Right operand of && is non-boolean (int): register_word % 2 == 1 && m88k_8_byte_align_p(type) LOC m88k-tdep.c:404 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC m88k-tdep.c:410 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC m88k-tdep.c:426 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC memrange.c:76 - Operands of > have incompatible types (int, ULONGEST): (ra->length) > ((rb->start - ra->start) + rb->length) + Operands of > have incompatible types (LONGEST, ULONGEST): (ra->length) > ((rb->start - ra->start) + rb->length) LOC memrange.c:77 - Conditional clauses are not of same type: (ra->length) (int), ((rb->start - ra->start) + rb->length) (ULONGEST) + Conditional clauses are not of same type: (ra->length) (LONGEST), ((rb->start - ra->start) + rb->length) (ULONGEST) LOC mep-tdep.c:1148 - Operands of == have incompatible types (UINT, size_t): (register_type(gdbarch, rawnum))->length == sizeof((buf64)) + Operands of == have incompatible types (ULONGEST, size_t): (register_type(gdbarch, rawnum))->length == sizeof((buf64)) LOC mep-tdep.c:1234 - Operands of == have incompatible types (UINT, size_t): (register_type(gdbarch, rawnum))->length == sizeof((buf64)) + Operands of == have incompatible types (ULONGEST, size_t): (register_type(gdbarch, rawnum))->length == sizeof((buf64)) LOC mep-tdep.c:2149 - Assignment of UINT to int: offset = (4) - (type)->length + Assignment of ULONGEST to int: offset = (4) - (type)->length LOC mep-tdep.c:2155 - Function regcache_cooked_read_part expects arg 4 to be int gets UINT: (type)->length + Function regcache_cooked_read_part expects arg 4 to be int gets ULONGEST: (type)->length LOC mep-tdep.c:2177 - Assignment of UINT to int: offset = (4) - (type)->length + Assignment of ULONGEST to int: offset = (4) - (type)->length LOC mep-tdep.c:2182 - Function regcache_cooked_write_part expects arg 4 to be int gets UINT: (type)->length + Function regcache_cooked_write_part expects arg 4 to be int gets ULONGEST: (type)->length LOC mep-tdep.c:2210 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC mep-tdep.c:2289 - Function write_memory expects arg 3 to be ssize_t gets UINT: arg_len + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: arg_len LOC microblaze-tdep.c:571 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC microblaze-tdep.c:608 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len microblaze-tdep.c: (in function microblaze_return_value) LOC mips-tdep.c:1024 (mips-tdep.c:1029) + Operands of == have incompatible types (UINT, ULONGEST): mips_abi_regsize(gdbarch) == (builtin_type(gdbarch)->builtin_data_ptr)->length +LOC mips-tdep.c:1029 Fresh storage rawtype not released before return LOC mips-tdep.c:1013 Fresh storage rawtype created LOC mips-tdep.c:4305 (mips-tdep.c:4304) + Function extract_signed_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:4304 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents(arg) LOC mips-tdep.c:4310 (mips-tdep.c:4311) + Function store_signed_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:4311 Function store_signed_integer expects arg 4 to be LONGEST gets CORE_ADDR: make_compact_addr(addr) LOC mips-tdep.c:4390 (mips-tdep.c:4391) + Function extract_signed_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:4391 Test expression for if not boolean, type int: mips_debug LOC mips-tdep.c:4393 (mips-tdep.c:4407) + Function phex expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:4407 Variable odd_sized_struct initialized to type boolean, expects int: (len > regsize && len % regsize != 0) LOC mips-tdep.c:4415 (mips-tdep.c:4417) + Variable partial_len initialized to type LONGEST, expects int: (len < regsize ? len : regsize) +LOC mips-tdep.c:4417 Test expression for if not boolean, type int: mips_debug LOC mips-tdep.c:4437 (mips-tdep.c:4440) - Operands of < have incompatible types (UINT, int): (arg_type)->length < regsize + Assignment of LONGEST to int: longword_offset = regsize - len +LOC mips-tdep.c:4440 + Operands of < have incompatible types (ULONGEST, int): (arg_type)->length < regsize +LOC mips-tdep.c:4441 + Assignment of LONGEST to int: longword_offset = regsize - len LOC mips-tdep.c:4558 - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC mips-tdep.c:4562 - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC mips-tdep.c:4563 - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC mips-tdep.c:4592 - Operands of < have incompatible types (UINT, int): (arg_type)->length < offset + MIPS64_REGSIZE + Operands of < have incompatible types (ULONGEST, LONGEST): (arg_type)->length < offset + MIPS64_REGSIZE LOC mips-tdep.c:4930 - Operands of > have incompatible types (UINT, int): (type)->length > 2 * MIPS64_REGSIZE + Operands of > have incompatible types (ULONGEST, int): (type)->length > 2 * MIPS64_REGSIZE LOC mips-tdep.c:4963 - Function mips_xfer_register expects arg 4 to be int gets UINT: (type)->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: (type)->length LOC mips-tdep.c:5013 - Function mips_xfer_register expects arg 4 to be int gets UINT: ((((type)->main_type->flds_bnds.fields[field]).type))->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: ((((type)->main_type->flds_bnds.fields[field]).type))->length LOC mips-tdep.c:5029 - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC mips-tdep.c:5033 - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC mips-tdep.c:5034 - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC mips-tdep.c:5052 - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC mips-tdep.c:5056 - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC mips-tdep.c:5057 - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC mips-tdep.c:5123 (mips-tdep.c:5121) - Variable arglen initialized to type UINT, expects int: (arg_type)->length -LOC mips-tdep.c:5124 Test expression for if not boolean, type int: mips_type_needs_double_align(arg_type) LOC mips-tdep.c:5124 (mips-tdep.c:5125) - Function align_up expects arg 1 to be ULONGEST gets int: len -LOC mips-tdep.c:5125 - Assignment of ULONGEST to int: len = align_up(len, MIPS32_REGSIZE * 2) + Function align_up expects arg 1 to be ULONGEST gets LONGEST: len LOC mips-tdep.c:5124 (mips-tdep.c:5127) - Function align_up expects arg 1 to be ULONGEST gets int: arglen + Assignment of ULONGEST to LONGEST: len = align_up(len, MIPS32_REGSIZE * 2) LOC mips-tdep.c:5159 (mips-tdep.c:5160) Variable len shadows outer declaration LOC mips-tdep.c:5095 - Previous definition of len: int + Previous definition of len: LONGEST LOC mips-tdep.c:5234 (mips-tdep.c:5235) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5234 Variable regval initialized to type ULONGEST, expects LONGEST: extract_unsigned_integer(val, len, byte_order) LOC mips-tdep.c:5237 (mips-tdep.c:5240) + Function phex expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5239 Function regcache_cooked_write_unsigned expects arg 3 to be ULONGEST gets LONGEST: regval LOC mips-tdep.c:5245 (mips-tdep.c:5247) + Function phex expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5246 Function regcache_cooked_write_unsigned expects arg 3 to be ULONGEST gets LONGEST: regval LOC mips-tdep.c:5277 (mips-tdep.c:5280) + Variable partial_len initialized to type LONGEST, expects int: (len < MIPS32_REGSIZE ? len : MIPS32_REGSIZE) +LOC mips-tdep.c:5279 Test expression for if not boolean, type int: mips_debug LOC mips-tdep.c:5437 (mips-tdep.c:5438) - Function mips_xfer_register expects arg 4 to be int gets UINT: (type)->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: (type)->length LOC mips-tdep.c:5443 (mips-tdep.c:5444) - Function mips_xfer_register expects arg 4 to be int gets UINT: (type)->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: (type)->length LOC mips-tdep.c:5592 (mips-tdep.c:5593) - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC mips-tdep.c:5596 (mips-tdep.c:5597) - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC mips-tdep.c:5597 (mips-tdep.c:5598) - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC mips-tdep.c:5652 (mips-tdep.c:5650) - Variable arglen initialized to type UINT, expects int: (arg_type)->length -LOC mips-tdep.c:5653 - Function align_up expects arg 1 to be ULONGEST gets int: arglen -LOC mips-tdep.c:5654 Fresh storage arg_type not released before scope exit LOC mips-tdep.c:5648 (mips-tdep.c:5649) Fresh storage arg_type created LOC mips-tdep.c:5685 (mips-tdep.c:5687) Variable len shadows outer declaration LOC mips-tdep.c:5623 (mips-tdep.c:5624) - Previous definition of len: int + Previous definition of len: LONGEST LOC mips-tdep.c:5701 (mips-tdep.c:5702) + Function extract_signed_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5700 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents(arg) LOC mips-tdep.c:5704 (mips-tdep.c:5707) + Function store_signed_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5705 Function store_signed_integer expects arg 4 to be LONGEST gets CORE_ADDR: make_compact_addr(addr) LOC mips-tdep.c:5723 (mips-tdep.c:5725) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5723 Variable regval initialized to type ULONGEST, expects LONGEST: extract_unsigned_integer(val, len, byte_order) LOC mips-tdep.c:5726 (mips-tdep.c:5729) + Function phex expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5727 Function regcache_cooked_write_unsigned expects arg 3 to be ULONGEST gets LONGEST: regval LOC mips-tdep.c:5730 (mips-tdep.c:5733) + Function phex expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5731 Function regcache_cooked_write_unsigned expects arg 3 to be ULONGEST gets LONGEST: regval LOC mips-tdep.c:5751 (mips-tdep.c:5755) + Variable partial_len initialized to type LONGEST, expects int: (len < MIPS64_REGSIZE ? len : MIPS64_REGSIZE) +LOC mips-tdep.c:5753 Test expression for if not boolean, type int: mips_debug LOC mips-tdep.c:5772 (mips-tdep.c:5777) + Assignment of LONGEST to int: longword_offset = MIPS64_REGSIZE - len +LOC mips-tdep.c:5775 Test expression for if not boolean, type int: mips_debug LOC mips-tdep.c:5778 (mips-tdep.c:5780) - Function paddress expects arg 2 to be CORE_ADDR gets int: stack_offset + Function paddress expects arg 2 to be CORE_ADDR gets LONGEST: stack_offset LOC mips-tdep.c:5902 (mips-tdep.c:5904) - Function mips_xfer_register expects arg 4 to be int gets UINT: (type)->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: (type)->length LOC mips-tdep.c:5908 (mips-tdep.c:5910) - Function mips_xfer_register expects arg 4 to be int gets UINT: (type)->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: (type)->length LOC mips-tdep.c:5920 (mips-tdep.c:5922) - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC mips-tdep.c:5924 (mips-tdep.c:5926) - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC mips-tdep.c:5925 (mips-tdep.c:5927) - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC ../include/opcode/mips.h:711 File static variable mips_isa_table declared but not used LOC mn10300-tdep.c:103 (mn10300-tdep.c:102) - Return value type UINT does not match declared type int: (type)->length + Return value type ULONGEST does not match declared type LONGEST: (type)->length LOC mn10300-tdep.c:106 (mn10300-tdep.c:105) - Return value type UINT does not match declared type int: (type)->length / 2 + Return value type ULONGEST does not match declared type LONGEST: (type)->length / 2 LOC mn10300-tdep.c:114 (mn10300-tdep.c:113) - Left operand of <<= may be negative (int): align <<= 1 + Left operand of <<= may be negative (LONGEST): align <<= 1 LOC mn10300-tdep.c:129 (mn10300-tdep.c:128) - Path with no return in function declared to return int + Path with no return in function declared to return LONGEST mn10300-tdep.c: (in function mn10300_use_struct_convention) +LOC moxie-tdep.c:135 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len - 4 LOC moxie-tdep.c:330 (moxie-tdep.c:336) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: (len > 4 ? len - 4 : len) +LOC moxie-tdep.c:336 Return value (type enum register_status) ignored: regcache_cooked_... LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC mt-tdep.c:353 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC mt-tdep.c:361 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC mt-tdep.c:386 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC mt-tdep.c:786 - Variable stack_dest initialized to type CORE_ADDR, expects int: sp + Variable stack_dest initialized to type CORE_ADDR, expects LONGEST: sp LOC mt-tdep.c:827 (mt-tdep.c:828) - Function memcpy expects arg 3 to be size_t gets int: typelen + Assignment of LONGEST to int: split_param_len = typelen LOC mt-tdep.c:828 (mt-tdep.c:838) - Function write_memory expects arg 1 to be CORE_ADDR gets int: stack_dest + Function memcpy expects arg 3 to be size_t gets LONGEST: typelen LOC mt-tdep.c:838 - Function write_memory expects arg 3 to be ssize_t gets int: typelen + Function write_memory expects arg 1 to be CORE_ADDR gets LONGEST: stack_dest +LOC mt-tdep.c:838 + Function write_memory expects arg 3 to be ssize_t gets LONGEST: typelen +LOC mt-tdep.c:851 + Assignment of LONGEST to int: slacklen = (4 - (typelen % 4)) % 4 LOC mt-tdep.c:852 - Function C_alloca expects arg 1 to be size_t gets int: typelen + slacklen + Function C_alloca expects arg 1 to be size_t gets LONGEST: typelen + slacklen LOC mt-tdep.c:853 - Function memcpy expects arg 3 to be size_t gets int: typelen + Function memcpy expects arg 3 to be size_t gets LONGEST: typelen LOC mt-tdep.c:857 - Function write_memory expects arg 1 to be CORE_ADDR gets int: stack_dest + Function write_memory expects arg 1 to be CORE_ADDR gets LONGEST: stack_dest LOC mt-tdep.c:857 - Function write_memory expects arg 3 to be ssize_t gets int: typelen + slacklen + Function write_memory expects arg 3 to be ssize_t gets LONGEST: typelen + slacklen LOC mt-tdep.c:865 - Function write_memory expects arg 1 to be CORE_ADDR gets int: stack_dest + Function write_memory expects arg 1 to be CORE_ADDR gets LONGEST: stack_dest LOC mt-tdep.c:882 - Return value type int does not match declared type CORE_ADDR: stack_dest + Return value type LONGEST does not match declared type CORE_ADDR: stack_dest LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC objc-lang.c:371 (objc-lang.c:379) + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC objc-lang.c:379 Test expression for if not boolean, type int: quit_flag LOC objc-lang.c:389 (objc-lang.c:397) + Operands of < have incompatible types (UINT, ULONGEST): rep1 < length +LOC objc-lang.c:397 Test expression for if not boolean, type int: in_quotes LOC objc-lang.c:435 + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC objc-lang.c:435 Left operand of || is non-boolean (int): force_ellipses || i < length LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC opencl-lang.c:191 (opencl-lang.c:190) - Assignment of LONGEST to int: n = offset + highb - lowb + 1 -LOC opencl-lang.c:191 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Assertion `%s' failed.") LOC opencl-lang.c:196 - Function memcpy expects arg 3 to be size_t gets int: elsize + Function memcpy expects arg 3 to be size_t gets LONGEST: elsize LOC opencl-lang.c:236 (opencl-lang.c:219) - Assignment of LONGEST to int: n = offset + highb - lowb + 1 -LOC opencl-lang.c:236 - Function memcpy expects arg 3 to be size_t gets int: elsize + Function memcpy expects arg 3 to be size_t gets LONGEST: elsize +LOC opencl-lang.c:253 + Variable startrest initialized to type LONGEST, expects int: offset % elsize +LOC opencl-lang.c:255 + Variable endrest initialized to type LONGEST, expects int: (offset + length) % elsize LOC opencl-lang.c:268 (opencl-lang.c:269) + Conditional clauses are not of same type: endrest (int), elsize (LONGEST) +LOC opencl-lang.c:270 Operand of ! is non-boolean (int): !value_bits_valid(c->val, c->indices[i] * elsize + comp_offset, comp_length) +LOC opencl-lang.c:307 + Variable startrest initialized to type LONGEST, expects int: offset % elsize +LOC opencl-lang.c:309 + Variable endrest initialized to type LONGEST, expects int: (offset + length) % elsize LOC opencl-lang.c:322 (opencl-lang.c:323) + Conditional clauses are not of same type: endrest (int), elsize (LONGEST) +LOC opencl-lang.c:324 Operand of ! is non-boolean (int): !value_bits_synthetic_pointer(c->val, c->indices[i] * elsize + comp_offset, comp_length) LOC opencl-lang.c:428 (opencl-lang.c:427) - Function memcpy expects arg 3 to be size_t gets UINT: (elm_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (elm_type)->length LOC opencl-lang.c:581 (opencl-lang.c:580) - Function memset expects arg 3 to be size_t gets UINT: (eltype)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (eltype)->length LOC opencl-lang.c:681 (opencl-lang.c:680) - Function memset expects arg 3 to be size_t gets UINT: (eltype1)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (eltype1)->length LOC opencl-lang.c:901 (opencl-lang.c:900) - Function memcpy expects arg 3 to be size_t gets UINT: (eltype2)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (eltype2)->length LOC symtab.h:1267 File static function VEC_CORE_ADDR_safe_insert declared but not used LOC symtab.h:1267 Definition of VEC_CORE_ADDR_safe_insert LOC p-lang.c:233 - Assignment of UINT to int: width = (type)->length + Assignment of ULONGEST to int: width = (type)->length LOC p-lang.c:249 (p-lang.c:258) + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC p-lang.c:258 Test expression for if not boolean, type int: quit_flag LOC p-lang.c:271 (p-lang.c:281) + Operands of < have incompatible types (UINT, ULONGEST): rep1 < length +LOC p-lang.c:281 Test expression for if not boolean, type int: in_quotes LOC p-lang.c:319 + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC p-lang.c:319 Left operand of || is non-boolean (int): force_ellipses || i < length LOC symtab.h:1267 File static function VEC_CORE_ADDR_safe_insert declared but not used LOC symtab.h:1267 Definition of VEC_CORE_ADDR_safe_insert ppc-linux-nat.c: (in function ppc_linux_can_accel_watchpoint_condition) LOC ppc-linux-nat.c:2030 (ppc-linux-nat.c:2057) + Function calculate_dvc expects arg 2 to be int gets LONGEST: len +LOC ppc-linux-nat.c:2057 Assignment of int to uint32_t: p->trigger_type = get_trigger_type(rw) ppc-linux-nat.c: (in function ppc_linux_insert_watchpoint) LOC ppc-linux-nat.c:1398 File static function VEC_thread_points_p_safe_insert declared but not used LOC ppc-linux-nat.c:1398 Definition of VEC_thread_points_p_safe_insert LOC ppc-sysv-tdep.c:162 - Assignment of ULONGEST to int: argoffset = align_up(argoffset, len) + Function align_up expects arg 2 to be int gets LONGEST: len +LOC ppc-sysv-tdep.c:162 + Assignment of ULONGEST to LONGEST: argoffset = align_up(argoffset, len) LOC ppc-sysv-tdep.c:164 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:193 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:215 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:250 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len +LOC ppc-sysv-tdep.c:304 + Function align_up expects arg 2 to be int gets LONGEST: len LOC ppc-sysv-tdep.c:308 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len +LOC ppc-sysv-tdep.c:380 + Function align_up expects arg 2 to be int gets LONGEST: len LOC ppc-sysv-tdep.c:382 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:395 - Function write_memory expects arg 3 to be ssize_t gets UINT: (eltype)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (eltype)->length LOC ppc-sysv-tdep.c:447 (ppc-sysv-tdep.c:453) + Operands of < have incompatible types (int, LONGEST): i < len / 16 +LOC ppc-sysv-tdep.c:453 Test expression for if not boolean, type int: write_pass LOC ppc-sysv-tdep.c:537 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:550 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC ppc-sysv-tdep.c:574 (ppc-sysv-tdep.c:587) + Assignment of LONGEST to int: argspace = argoffset +LOC ppc-sysv-tdep.c:587 Test expression for if not boolean, type int: write_pass LOC ppc-sysv-tdep.c:814 - Operands of <= have incompatible types (UINT, int): (type)->length <= tdep->wordsize + Operands of <= have incompatible types (ULONGEST, int): (type)->length <= tdep->wordsize +LOC ppc-sysv-tdep.c:852 + Variable regnum initialized to type LONGEST, expects int: tdep->ppc_fp0_regnum + 1 + i LOC ppc-sysv-tdep.c:871 (ppc-sysv-tdep.c:876) + Variable regnum initialized to type LONGEST, expects int: tdep->ppc_gp0_regnum + 3 + i +LOC ppc-sysv-tdep.c:876 Assignment of LONGEST to ULONGEST: regval = unpack_long(eltype, writebuf + offset) LOC ppc-sysv-tdep.c:1019 - Operands of > have incompatible types (UINT, int): (type)->length > tdep->wordsize + Operands of > have incompatible types (ULONGEST, int): (type)->length > tdep->wordsize LOC ppc-sysv-tdep.c:1022 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1031 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1034 - Operands of > have incompatible types (UINT, int): (type)->length > tdep->wordsize + Operands of > have incompatible types (ULONGEST, int): (type)->length > tdep->wordsize LOC ppc-sysv-tdep.c:1304 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1360 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1448 - Operands of < have incompatible types (int, UINT): i < (type)->length / 16 + Operands of < have incompatible types (int, ULONGEST): i < (type)->length / 16 LOC ppc-sysv-tdep.c:1487 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1502 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1561 - Operands of < have incompatible types (int, UINT): byte < (type)->length + Operands of < have incompatible types (int, ULONGEST): byte < (type)->length LOC ppc-sysv-tdep.c:1597 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:1599 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len +LOC ppc-sysv-tdep.c:1796 + Variable offset initialized to type ULONGEST, expects int: i * (eltype)->length +LOC ppc-sysv-tdep.c:1851 + Variable regnum initialized to type LONGEST, expects int: tdep->ppc_vr0_regnum + 2 + i LOC ppc-sysv-tdep.c:1869 (ppc-sysv-tdep.c:1873) - Function regcache_cooked_write_part expects arg 4 to be int gets UINT: (valtype)->length + Variable offset initialized to type ULONGEST, expects int: (register_size(gdbarch, tdep->ppc_gp0_regnum + 3) - (valtype)->length) +LOC ppc-sysv-tdep.c:1873 + Function regcache_cooked_write_part expects arg 4 to be int gets ULONGEST: (valtype)->length LOC ppc-sysv-tdep.c:1876 - Function regcache_cooked_read_part expects arg 4 to be int gets UINT: (valtype)->length + Function regcache_cooked_read_part expects arg 4 to be int gets ULONGEST: (valtype)->length LOC ppc-sysv-tdep.c:1900 - Operands of < have incompatible types (int, UINT): i < (valtype)->length / 8 + Operands of < have incompatible types (int, ULONGEST): i < (valtype)->length / 8 LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC printcmd.c:384 - Operands of > have incompatible types (UINT, size_t): len > sizeof(LONGEST) + Operands of > have incompatible types (ULONGEST, size_t): len > sizeof(LONGEST) +LOC printcmd.c:391 + Function print_octal_chars expects arg 3 to be UINT gets ULONGEST: len LOC printcmd.c:395 (printcmd.c:396) + Function print_decimal_chars expects arg 3 to be UINT gets ULONGEST: len +LOC printcmd.c:396 Fresh storage gdbarch not released before return LOC printcmd.c:376 Fresh storage gdbarch created LOC printcmd.c:398 (printcmd.c:399) + Function print_binary_chars expects arg 3 to be UINT gets ULONGEST: len +LOC printcmd.c:399 Fresh storage gdbarch not released before return LOC printcmd.c:376 Fresh storage gdbarch created LOC printcmd.c:404 (printcmd.c:405) + Function print_char_chars expects arg 4 to be UINT gets ULONGEST: len +LOC printcmd.c:405 Fresh storage gdbarch not released before return LOC printcmd.c:376 Fresh storage gdbarch created LOC printcmd.c:425 - Operands of < have incompatible types (UINT, size_t): len < sizeof(LONGEST) + Operands of < have incompatible types (ULONGEST, size_t): len < sizeof(LONGEST) LOC printcmd.c:2454 (printcmd.c:2455) - Function convert_between_encodings expects arg 5 to be int gets UINT: (valtype)->length + Function convert_between_encodings expects arg 4 to be UINT gets ULONGEST: (valtype)->length +LOC printcmd.c:2455 + Function convert_between_encodings expects arg 5 to be int gets ULONGEST: (valtype)->length LOC printcmd.c:2547 (printcmd.c:2609) + Variable param_len initialized to type ULONGEST, expects UINT: (param_type)->length +LOC printcmd.c:2609 Function decimal_convert expects arg 2 to be int gets UINT: param_len LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC p-typeprint.c:821 (p-typeprint.c:753) - Operands of != have incompatible types (int, LONGEST): lastval != ((((type)->main_type->flds_bnds.fields[i]).loc.enumval) + 0) -LOC p-typeprint.c:758 - Assignment of LONGEST to int: lastval = ((((type)->main_type->flds_bnds.fields[i]).loc.enumval) + 0) -LOC p-typeprint.c:821 Fresh storage type not released before return LOC p-typeprint.c:478 Fresh storage type created LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC p-valprint.c:212 (p-valprint.c:211) - Function xmalloc expects arg 1 to be size_t gets int: length_size + Function xmalloc expects arg 1 to be size_t gets LONGEST: length_size +LOC p-valprint.c:213 + Function read_memory expects arg 3 to be ssize_t gets LONGEST: length_size LOC p-valprint.c:214 (p-valprint.c:212) - Function read_memory expects arg 3 to be ssize_t gets int: length_size + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: length_size LOC p-valprint.c:324 (p-valprint.c:322) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: length_size +LOC p-valprint.c:323 Assignment of ULONGEST to UINT: len = extract_unsigned_integer(valaddr + embedded_offset + length_pos, length_size, byte_order) LOC p-valprint.c:799 (p-valprint.c:798) - Operands of >= have incompatible types (int, UINT): boffset >= (type)->length + Operands of >= have incompatible types (LONGEST, ULONGEST): boffset >= (type)->length LOC p-valprint.c:802 (p-valprint.c:801) - Function C_alloca expects arg 1 to be size_t gets UINT: (baseclass)->length + Function C_alloca expects arg 1 to be size_t gets ULONGEST: (baseclass)->length LOC p-valprint.c:806 (p-valprint.c:805) - Function target_read_memory expects arg 3 to be ssize_t gets UINT: (baseclass)->length + Function target_read_memory expects arg 3 to be ssize_t gets ULONGEST: (baseclass)->length LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert Spec file not found: python.lcl Cannot open file: python.c Finished checking --- no code processed regcache.c: (in function regcache_cooked_read_signed) LOC regcache.c:915 - Operands of <= have incompatible types (int, LONGEST): offset <= descr->sizeof_register[regnum] -LOC regcache.c:915 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Assertion `%s' failed.") LOC regcache.c:916 - Operands of <= have incompatible types (int, LONGEST): offset + len <= descr->sizeof_register[regnum] -LOC regcache.c:916 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Assertion `%s' failed.") LOC regcache.c:927 (regcache.c:923) - Operands of < have incompatible types (int, LONGEST): offset + len < descr->sizeof_register[regnum] -LOC regcache.c:927 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Assertion `%s' failed.") LOC progspace.h:37 File static function VEC_so_list_ptr_safe_insert declared but not used LOC progspace.h:37 Definition of VEC_so_list_ptr_safe_insert LOC remote.c:7971 + Function phex_nz expects arg 1 to be ULONGEST gets LONGEST: len +LOC remote.c:7971 Function xsnprintf expects arg 2 to be size_t gets int: endbuf - p LOC remote.c:8015 + Function phex_nz expects arg 1 to be ULONGEST gets LONGEST: len +LOC remote.c:8015 Function xsnprintf expects arg 2 to be size_t gets int: endbuf - p LOC remote.c:9136 File static function VEC_remote_g_packet_guess_s_safe_insert declared but not used LOC remote.c:9136 Definition of VEC_remote_g_packet_guess_s_safe_insert LOC remote-m32r-sdi.c:1433 - Assignment of int to UINT: ab_size[i] = len + Assignment of LONGEST to UINT: ab_size[i] = len LOC remote-mips.c:2434 (remote-mips.c:2433) Parameter cond not used +remote-mips.c: (in function mips_set_breakpoint) +LOC remote-mips.c:2457 + Function mips_common_breakpoint expects arg 3 to be int gets LONGEST: len +remote-mips.c: (in function mips_clear_breakpoint) +LOC remote-mips.c:2466 + Function mips_common_breakpoint expects arg 3 to be int gets LONGEST: len remote-mips.c: (in function mips_check_lsi_error) LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert rl78-tdep.c: (in function rl78_pointer_to_address) LOC rl78-tdep.c:1027 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC rs6000-aix-tdep.c:277 (rs6000-aix-tdep.c:280) + Operands of < have incompatible types (int, LONGEST): argbytes < len +LOC rs6000-aix-tdep.c:280 Function memset expects arg 3 to be size_t gets int: reg_size LOC rs6000-aix-tdep.c:284 (rs6000-aix-tdep.c:283) - Function memcpy expects arg 3 to be size_t gets int: (len - argbytes) > reg_size ? reg_size : len - argbytes + Conditional clauses are not of same type: reg_size (int), len - argbytes (LONGEST) +LOC rs6000-aix-tdep.c:299 + Variable adj initialized to type LONGEST, expects int: gdbarch_byte_order(gdbarch) == BFD_ENDIAN_BIG ? reg_size - len : 0 LOC rs6000-aix-tdep.c:304 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC rs6000-aix-tdep.c:366 - Function write_memory expects arg 3 to be ssize_t gets int: len - argbytes + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len - argbytes LOC rs6000-aix-tdep.c:393 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC rs6000-aix-tdep.c:494 - Operands of <= have incompatible types (UINT, int): (valtype)->length <= tdep->wordsize + Operands of <= have incompatible types (ULONGEST, int): (valtype)->length <= tdep->wordsize LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert s390-tdep.c: (in function s390_pseudo_register_reggroup_p) LOC s390-tdep.c:2495 (s390-tdep.c:2496) + Function is_power_of_two expects arg 1 to be UINT gets ULONGEST: (type)->length +LOC s390-tdep.c:2495 Operand of ! is non-boolean (int): !is_power_of_two((type)->length) LOC s390-tdep.c:2516 (s390-tdep.c:2522) + Variable length initialized to type ULONGEST, expects UINT: (type)->length +LOC s390-tdep.c:2520 Operands of || are non-boolean (int): is_integer_like(type) || is_pointer_like(type) LOC s390-tdep.c:2555 (s390-tdep.c:2557) - Assignment of UINT to int: alignment = (type)->length + Assignment of ULONGEST to int: alignment = (type)->length LOC s390-tdep.c:2675 (s390-tdep.c:2678) - Function write_memory expects arg 3 to be ssize_t gets UINT: length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: length LOC s390-tdep.c:2699 (s390-tdep.c:2702) - Function regcache_cooked_write_part expects arg 4 to be int gets UINT: length + Function regcache_cooked_write_part expects arg 4 to be int gets ULONGEST: length LOC s390-tdep.c:2707 (s390-tdep.c:2710) - Function write_memory expects arg 3 to be ssize_t gets UINT: length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: length LOC s390-tdep.c:2710 (s390-tdep.c:2713) - Operands of <= have incompatible types (UINT, int): length <= word_size + Operands of <= have incompatible types (ULONGEST, int): length <= word_size LOC s390-tdep.c:2728 (s390-tdep.c:2731) - Operands of == have incompatible types (UINT, int): length == 2 * word_size + Operands of == have incompatible types (ULONGEST, int): length == 2 * word_size LOC s390-tdep.c:2744 (s390-tdep.c:2747) - Function write_memory expects arg 3 to be ssize_t gets UINT: length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: length LOC s390-tdep.c:2797 (s390-tdep.c:2802) - Variable length initialized to type UINT, expects int: (type)->length -LOC s390-tdep.c:2800 Parameter gdbarch not used s390-tdep.c: (in function s390_return_value) +LOC s390-tdep.c:2840 + Function regcache_cooked_write_part expects arg 4 to be int gets LONGEST: length LOC s390-tdep.c:2847 (s390-tdep.c:2862) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: length +LOC s390-tdep.c:2850 + Function extract_signed_integer expects arg 2 to be int gets LONGEST: length +LOC s390-tdep.c:2858 New fresh storage (type char *) passed as implicitly temp (not released): gettext("invalid return type") LOC s390-tdep.c:2877 (s390-tdep.c:2880) + Function regcache_cooked_read_part expects arg 4 to be int gets LONGEST: length +LOC s390-tdep.c:2876 Return value (type enum register_status) ignored: regcache_cooked_... LOC s390-tdep.c:2883 (s390-tdep.c:2886) + Function regcache_cooked_read_part expects arg 4 to be int gets LONGEST: length +LOC s390-tdep.c:2882 Return value (type enum register_status) ignored: regcache_cooked_... LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC score-tdep.c:465 - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC score-tdep.c:470 - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC score-tdep.c:471 - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC score-tdep.c:592 (score-tdep.c:602) + Variable partial_len initialized to type LONGEST, expects int: arglen < 4 ? arglen : 4 +LOC score-tdep.c:602 Right operand of <<= may be negative (int): regval <<= ((4 - partial_len) * 8) LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC sh64-tdep.c:1116 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC sh64-tdep.c:1118 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC sh64-tdep.c:1269 (sh64-tdep.c:1273) - Function memcpy expects arg 3 to be size_t gets int: len + Assignment of LONGEST to int: offset = register_size(gdbarch, DEFAULT_RETURN_REGNUM) - len +LOC sh64-tdep.c:1273 + Function memcpy expects arg 3 to be size_t gets LONGEST: len +LOC sh64-tdep.c:1298 + Operands of < have incompatible types (int, LONGEST): i < len LOC sh64-tdep.c:1318 (sh64-tdep.c:1320) - Function memcpy expects arg 3 to be size_t gets int: len + Assignment of LONGEST to int: offset = register_size(gdbarch, return_register) - len +LOC sh64-tdep.c:1320 + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC sh-tdep.c:828 - Operands of == have incompatible types (UINT, int): ((((type)->main_type->flds_bnds.fields[0]).type))->length == len + Operands of == have incompatible types (ULONGEST, int): ((((type)->main_type->flds_bnds.fields[0]).type))->length == len sh-tdep.c: (in function sh_use_struct_convention_nofpu) LOC sh-tdep.c:1099 - Assignment of UINT to int: len = (type)->length + Assignment of ULONGEST to int: len = (type)->length LOC sh-tdep.c:1148 - Operands of == have incompatible types (UINT, int): (type)->length == 2 * reg_size + Operands of == have incompatible types (ULONGEST, int): (type)->length == 2 * reg_size LOC sh-tdep.c:1236 - Assignment of UINT to int: len = (type)->length + Assignment of ULONGEST to int: len = (type)->length LOC sh-tdep.c:1318 (sh-tdep.c:1324) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC sh-tdep.c:1323 + Operands of < have incompatible types (int, LONGEST): i < len +LOC sh-tdep.c:1324 Function regcache_raw_read expects arg 3 to be gdb_byte * gets char *: (char *)valbuf + i +LOC sh-tdep.c:1367 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC sh-tdep.c:1373 + Operands of < have incompatible types (int, LONGEST): i < len LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC sparc64-tdep.c:666 (sparc64-tdep.c:670) + Assignment of LONGEST to int: regnum = SPARC64_D0_REGNUM + element + bitpos / 64 +LOC sparc64-tdep.c:671 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Assertion `%s' failed.") LOC sparc64-tdep.c:674 (sparc64-tdep.c:677) + Assignment of LONGEST to int: regnum = SPARC_F0_REGNUM + element * 2 + bitpos / 32 +LOC sparc64-tdep.c:678 Test expression for if not boolean, type int: sparc64_structure_or_union_p(type) LOC sparc64-tdep.c:728 + Assignment of LONGEST to int: regnum = SPARC64_Q0_REGNUM + bitpos / 128 +LOC sparc64-tdep.c:729 Return value (type enum register_status) ignored: regcache_cooked_... LOC sparc64-tdep.c:735 + Assignment of LONGEST to int: regnum = SPARC64_D0_REGNUM + bitpos / 64 +LOC sparc64-tdep.c:736 Return value (type enum register_status) ignored: regcache_cooked_... LOC sparc64-tdep.c:743 + Assignment of LONGEST to int: regnum = SPARC_F0_REGNUM + bitpos / 32 +LOC sparc64-tdep.c:744 Return value (type enum register_status) ignored: regcache_cooked_... LOC sparc64-tdep.c:816 (sparc64-tdep.c:815) - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC sparc-tdep.c:486 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC sparc-tdep.c:1379 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length +LOC spu-tdep.c:323 + Variable preferred_slot initialized to type LONGEST, expects int: len < 4 ? 4 - len : 0 spu-tdep.c: (in function spu_gdbarch_id) spu-tdep.c: (in function spu_pointer_to_address) LOC spu-tdep.c:1475 - Operands of <= have incompatible types (UINT, int): (type)->length <= (SPU_ARGN_REGNUM - SPU_ARG1_REGNUM + 1) * 16 + Operands of <= have incompatible types (ULONGEST, int): (type)->length <= (SPU_ARGN_REGNUM - SPU_ARG1_REGNUM + 1) * 16 LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC tracepoint.c:1483 (tracepoint.c:1482) - Function add_memrange expects arg 3 to be bfd_signed_vma gets ULONGEST: addr + Function add_memrange expects arg 3 to be bfd_signed_vma gets CORE_ADDR: addr LOC tracepoint.c:2667 (tracepoint.c:2665) - Operands of < have incompatible types (int, UINT): j < ((sym)->type)->length + Operands of < have incompatible types (LONGEST, ULONGEST): j < ((sym)->type)->length LOC tracepoint.c:4685 (tracepoint.c:4680) - Assignment of unsigned short int to int: r->length = mlen + Assignment of unsigned short int to LONGEST: r->length = mlen LOC v850-tdep.c:837 Variable len shadows outer declaration LOC v850-tdep.c:812 - Previous definition of len: int + Previous definition of len: LONGEST LOC v850-tdep.c:851 - Assignment of UINT to int: len = (value_type(*args))->length + Assignment of ULONGEST to int: len = (value_type(*args))->length LOC v850-tdep.c:900 (v850-tdep.c:908) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC v850-tdep.c:908 Passed storage buf not completely defined (*buf is undefined): regcache_raw_read (..., buf) +LOC v850-tdep.c:925 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC v850-tdep.c:929 + Operands of < have incompatible types (int, LONGEST): i < len LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC valarith.c:713 - Assignment of UINT to int: inval2len = (type2)->length + Assignment of ULONGEST to int: inval2len = (type2)->length LOC valarith.c:757 - Assignment of UINT to int: inval1len = (type1)->length + Assignment of ULONGEST to int: inval1len = (type1)->length LOC valarith.c:758 - Assignment of UINT to int: inval2len = (type2)->length + Assignment of ULONGEST to int: inval2len = (type2)->length LOC valarith.c:895 - Assignment of UINT to int: *len_x = (type1)->length + Assignment of ULONGEST to int: *len_x = (type1)->length LOC valarith.c:901 - Assignment of UINT to int: *len_x = (type2)->length + Assignment of ULONGEST to int: *len_x = (type2)->length LOC valarith.c:914 - Assignment of UINT to int: *len_y = (type2)->length + Assignment of ULONGEST to int: *len_y = (type2)->length LOC valarith.c:920 - Assignment of UINT to int: *len_y = (type1)->length + Assignment of ULONGEST to int: *len_y = (type1)->length LOC valarith.c:973 - Assignment of UINT to int: len_v = (result_type)->length + Assignment of ULONGEST to int: len_v = (result_type)->length LOC valarith.c:1414 - Assignment of UINT to int: elsize = (eltype1)->length + Assignment of ULONGEST to int: elsize = (eltype1)->length LOC valarith.c:1417 - Operands of != have incompatible types (int, UINT): elsize != (eltype2)->length + Operands of != have incompatible types (int, ULONGEST): elsize != (eltype2)->length LOC valarith.c:1487 - Function decimal_is_zero expects arg 2 to be int gets UINT: (type1)->length + Function decimal_is_zero expects arg 2 to be int gets ULONGEST: (type1)->length +LOC valarith.c:1512 + Variable len initialized to type LONGEST, expects int: len1 < len2 ? len1 : len2 LOC valarith.c:1628 - Function memcmp expects arg 3 to be size_t gets UINT: (type1)->length + Function memcmp expects arg 3 to be size_t gets ULONGEST: (type1)->length LOC valarith.c:1718 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC valarith.c:1772 - Function memcpy expects arg 3 to be size_t gets UINT: (eltype)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (eltype)->length LOC valarith.c:1809 - Function memcpy expects arg 3 to be size_t gets UINT: (eltype)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (eltype)->length LOC target.h:1034 File static function VEC_memory_write_request_s_safe_insert declared but not used LOC target.h:1034 Definition of VEC_memory_write_request_s_safe_insert LOC valops.c:480 (valops.c:479) - Function decimal_convert expects arg 2 to be int gets UINT: (type2)->length + Function decimal_convert expects arg 2 to be int gets ULONGEST: (type2)->length LOC valops.c:569 (valops.c:568) - Function memcpy expects arg 3 to be size_t gets UINT: (eltype)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (eltype)->length LOC valops.c:884 (valops.c:882) - Function decimal_from_string expects arg 2 to be int gets UINT: (type)->length + Function decimal_from_string expects arg 2 to be int gets ULONGEST: (type)->length LOC valops.c:910 (valops.c:908) - Function memcpy expects arg 3 to be size_t gets UINT: (eltype)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (eltype)->length LOC valops.c:999 (valops.c:997) - Variable length initialized to type UINT, expects int: (type)->length -LOC valops.c:1000 - Function value_bits_valid expects arg 2 to be int gets LONGEST: 8 * offset + value_bitpos(val) + Variable length initialized to type ULONGEST, expects LONGEST: (type)->length LOC valops.c:1006 - Function unpack_value_bits_as_long expects arg 3 to be int gets LONGEST: offset -LOC valops.c:1004 New fresh storage (type struct type *) passed as implicitly temp (not released): value_type(val) LOC valops.c:1015 (valops.c:1013) + Function store_signed_integer expects arg 2 to be int gets LONGEST: length +LOC valops.c:1015 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents_raw(val) LOC valops.c:1022 (valops.c:1019) - New fresh storage (type struct type *) passed as implicitly temp (not released): value_enclosing_type(val) + Variable length initialized to type ULONGEST, expects LONGEST: (check_typedef(enclosing_type))->length LOC valops.c:1024 (valops.c:1019) - Variable length initialized to type UINT, expects int: (check_typedef(value_enclosing_type(val)))->length + Test expression for if not boolean, type LONGEST: length LOC valops.c:1026 (valops.c:1021) - Test expression for if not boolean, type int: length -LOC valops.c:1023 - Function read_value_memory expects arg 6 to be size_t gets int: length + Function read_value_memory expects arg 6 to be size_t gets LONGEST: length LOC valops.c:1027 (valops.c:1029) + Fresh storage enclosing_type not released before scope exit + LOC valops.c:1021 + Fresh storage enclosing_type created +LOC valops.c:1032 New fresh storage (type struct type *) passed as implicitly temp (not released): value_type(val) LOC valops.c:1283 (valops.c:1280) - Operands of < have incompatible types (int, UINT): changed_len < (type)->length + Operands of < have incompatible types (LONGEST, ULONGEST): changed_len < (type)->length LOC valops.c:1284 (valops.c:1281) - Operands of <= have incompatible types (UINT, int): (type)->length <= (int)sizeof(LONGEST) + Operands of <= have incompatible types (ULONGEST, int): (type)->length <= (int)sizeof(LONGEST) LOC valops.c:1293 (valops.c:1290) - Function read_memory expects arg 3 to be ssize_t gets int: changed_len + Function read_memory expects arg 3 to be ssize_t gets LONGEST: changed_len LOC valops.c:1305 (valops.c:1302) - Function write_memory expects arg 3 to be ssize_t gets int: changed_len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: changed_len LOC valops.c:1354 (valops.c:1351) - Function get_frame_register_bytes expects arg 3 to be CORE_ADDR gets int: offset + Function get_frame_register_bytes expects arg 3 to be CORE_ADDR gets LONGEST: offset LOC valops.c:1368 (valops.c:1365) - Function put_frame_register_bytes expects arg 3 to be CORE_ADDR gets int: offset + Function put_frame_register_bytes expects arg 3 to be CORE_ADDR gets LONGEST: offset LOC valops.c:1374 (valops.c:1371) - Function put_frame_register_bytes expects arg 3 to be CORE_ADDR gets int: value_offset(toval) + Function put_frame_register_bytes expects arg 3 to be CORE_ADDR gets LONGEST: value_offset(toval) LOC valops.c:1375 (valops.c:1372) - Function put_frame_register_bytes expects arg 4 to be int gets UINT: (type)->length + Function put_frame_register_bytes expects arg 4 to be int gets ULONGEST: (type)->length LOC valops.c:1459 (valops.c:1456) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC valops.c:1493 (valops.c:1490) - Function read_value_memory expects arg 6 to be size_t gets UINT: (value_enclosing_type(val))->length + Function read_value_memory expects arg 6 to be size_t gets ULONGEST: (value_enclosing_type(val))->length LOC valops.c:1832 (valops.c:1830) - Function value_contents_copy expects arg 5 to be int gets UINT: typelength + Function value_contents_copy expects arg 2 to be LONGEST gets ULONGEST: idx * typelength +LOC valops.c:1833 + Function value_contents_copy expects arg 5 to be LONGEST gets ULONGEST: typelength LOC valops.c:1842 (valops.c:1839) - Function value_contents_copy expects arg 5 to be int gets UINT: typelength + Function value_contents_copy expects arg 2 to be LONGEST gets ULONGEST: idx * typelength +LOC valops.c:1842 + Function value_contents_copy expects arg 5 to be LONGEST gets ULONGEST: typelength LOC valops.c:1851 (valops.c:1853) + Variable highbound initialized to type ULONGEST, expects int: len / (char_type)->length +LOC valops.c:1856 Function memcpy expects arg 3 to be size_t gets int: len LOC valops.c:1874 (valops.c:1876) + Variable highbound initialized to type ULONGEST, expects int: len / (char_type)->length +LOC valops.c:1879 Function memcpy expects arg 3 to be size_t gets int: len LOC valops.c:1893 (valops.c:1890) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC valops.c:2131 (valops.c:2128) - Operands of >= have incompatible types (int, UINT): boffset >= (value_enclosing_type(arg1))->length + Operands of >= have incompatible types (LONGEST, ULONGEST): boffset >= (value_enclosing_type(arg1))->length LOC valops.c:2139 (valops.c:2136) - Function target_read_memory expects arg 3 to be ssize_t gets UINT: (basetype)->length + Function target_read_memory expects arg 3 to be ssize_t gets ULONGEST: (basetype)->length LOC valops.c:2175 (valops.c:2171) + Function update_search_result expects arg 4 to be int gets LONGEST: boffset +LOC valops.c:2174 Null storage v passed as non-null param: update_search_result (..., v, ...) LOC valops.c:2103 (valops.c:2100) Storage v becomes null LOC valops.c:2287 (valops.c:2284) - Operands of >= have incompatible types (int, UINT): offset >= (type)->length + Operands of >= have incompatible types (LONGEST, ULONGEST): offset >= (type)->length LOC valops.c:2289 (valops.c:2286) - Function C_alloca expects arg 1 to be size_t gets UINT: (baseclass)->length + Function C_alloca expects arg 1 to be size_t gets ULONGEST: (baseclass)->length LOC valops.c:2293 (valops.c:2290) - Function target_read_memory expects arg 3 to be ssize_t gets UINT: (baseclass)->length + Function target_read_memory expects arg 3 to be ssize_t gets ULONGEST: (baseclass)->length LOC valops.c:3357 (valops.c:3354) - Left operand of >> may be negative (int): ((((t)->main_type->flds_bnds.fields[i]).loc.bitpos) + 0) >> 3 + Left operand of >> may be negative (LONGEST): ((((t)->main_type->flds_bnds.fields[i]).loc.bitpos) + 0) >> 3 LOC valops.c:3826 (valops.c:3822) - Function value_contents_copy expects arg 4 to be int gets LONGEST: offset -LOC valops.c:3823 - Function value_contents_copy expects arg 5 to be int gets UINT: (slice_type)->length -LOC valops.c:3828 - Function set_value_offset expects arg 2 to be int gets LONGEST: value_offset(array) + offset + Function value_contents_copy expects arg 5 to be LONGEST gets ULONGEST: (slice_type)->length LOC valops.c:3855 (valops.c:3852) - Function memcpy expects arg 3 to be size_t gets UINT: (real_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (real_type)->length LOC valops.c:3857 (valops.c:3854) - Function memcpy expects arg 3 to be size_t gets UINT: (real_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (real_type)->length LOC valops.c:3875 (valops.c:3872) - Function memcpy expects arg 3 to be size_t gets UINT: (val_real_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (val_real_type)->length LOC valops.c:3878 (valops.c:3875) - Function memcpy expects arg 3 to be size_t gets UINT: (val_real_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (val_real_type)->length LOC memrange.h:38 File static function VEC_mem_range_s_safe_insert declared but not used LOC memrange.h:38 Definition of VEC_mem_range_s_safe_insert LOC valprint.c:848 - Operands of > have incompatible types (UINT, size_t): (type)->length > sizeof(LONGEST) + Operands of > have incompatible types (ULONGEST, size_t): (type)->length > sizeof(LONGEST) LOC valprint.c:1024 (valprint.c:1035) + Variable len initialized to type ULONGEST, expects UINT: (type)->length +LOC valprint.c:1035 Test expression for if not boolean, type int: floatformat_is_negative(fmt, valaddr) LOC valprint.c:1096 (valprint.c:1098) + Variable len initialized to type ULONGEST, expects UINT: (type)->length +LOC valprint.c:1098 Function decimal_to_string expects arg 2 to be int gets UINT: len LOC valprint.c:1607 (valprint.c:1611) + Operands of < have incompatible types (UINT, ULONGEST): i < len +LOC valprint.c:1611 Test expression for if not boolean, type int: options->prettyprint_arrays LOC valprint.c:1631 (valprint.c:1637) - Function value_available_contents_eq expects arg 5 to be int gets UINT: eltlen + Operands of < have incompatible types (UINT, ULONGEST): rep1 < len +LOC valprint.c:1637 + Function value_available_contents_eq expects arg 5 to be LONGEST gets ULONGEST: eltlen +LOC valprint.c:1666 + Operands of < have incompatible types (UINT, ULONGEST): i < len valprint.c: (in function partial_memory_read) LOC valprint.c:1979 - Function C_alloca expects arg 1 to be size_t gets UINT: (type)->length + Function C_alloca expects arg 1 to be size_t gets ULONGEST: (type)->length LOC valprint.c:1982 - Function make_wchar_iterator expects arg 2 to be size_t gets UINT: (type)->length + Function make_wchar_iterator expects arg 2 to be size_t gets ULONGEST: (type)->length LOC valprint.c:1983 - Function make_wchar_iterator expects arg 4 to be size_t gets UINT: (type)->length + Function make_wchar_iterator expects arg 4 to be size_t gets ULONGEST: (type)->length LOC valprint.c:2023 - Function print_wchar expects arg 4 to be int gets UINT: (type)->length + Function print_wchar expects arg 4 to be int gets ULONGEST: (type)->length LOC valprint.c:2030 - Function print_wchar expects arg 4 to be int gets UINT: (type)->length + Function print_wchar expects arg 4 to be int gets ULONGEST: (type)->length LOC valprint.c:2079 - Operands of == have incompatible types (UINT, int): length == -1 + Operands of == have incompatible types (ULONGEST, int): length == -1 LOC valprint.c:2109 - Function make_wchar_iterator expects arg 2 to be size_t gets UINT: length * width + Function make_wchar_iterator expects arg 2 to be size_t gets ULONGEST: length * width LOC valprint.c:2366 - Function expects arg 4 to be UINT gets int: bytes_read / width + Function expects arg 4 to be ULONGEST gets int: bytes_read / width LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC value.c:449 (value.c:447) - Assignment of UINT to int: i = (VEC_range_s_lower_bound(value->unavailable, &newr, range_lessthan, "/home/siddhesh/src/upstream/gdb-sources/gdb.git/gdb/value.c", 447)) + Assignment of UINT to int: i = (VEC_range_s_lower_bound(value->unavailable, &newr, range_lessthan, "/home/siddhesh/src/upstream/gdb-sources/gdb.git/gdb/value.c", 449)) LOC value.c:568 (value.c:566) - Function memcmp expects arg 3 to be size_t gets int: length + Function memcmp expects arg 3 to be size_t gets LONGEST: length LOC value.c:697 (value.c:695) - Function xzalloc expects arg 1 to be size_t gets UINT: (val->enclosing_type)->length + Function xzalloc expects arg 1 to be size_t gets ULONGEST: (val->enclosing_type)->length value.c: (in function allocate_repeat_value) LOC value.c:949 (value.c:946) - Function memcpy expects arg 3 to be size_t gets int: length + Function memcpy expects arg 3 to be size_t gets LONGEST: length LOC value.c:956 (value.c:953) - Assignment of int to ULONGEST: l = ((r->offset) > (src_offset) ? (r->offset) : (src_offset)) -LOC value.c:954 - Assignment of int to ULONGEST: h = ((r->offset + r->length) < (src_offset + length) ? (r->offset + r->length) : (src_offset + length)) + Assignment of LONGEST to ULONGEST: l = ((r->offset) > (src_offset) ? (r->offset) : (src_offset)) LOC value.c:957 (value.c:958) - Function mark_value_bytes_unavailable expects arg 2 to be int gets ULONGEST: dst_offset + (l - src_offset) + Assignment of LONGEST to ULONGEST: h = ((r->offset + r->length) < (src_offset + length) ? (r->offset + r->length) : (src_offset + length)) value.c: (in function value_contents_copy) LOC value.c:1044 (value.c:1041) - Operands of != have incompatible types (int, UINT): len != (type2)->length + Operands of != have incompatible types (LONGEST, ULONGEST): len != (type2)->length LOC value.c:1047 (value.c:1044) - Function memcmp expects arg 3 to be size_t gets int: len + Function memcmp expects arg 3 to be size_t gets LONGEST: len LOC value.c:1402 (value.c:1399) - Function memcpy expects arg 3 to be size_t gets UINT: (value_enclosing_type(arg))->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (value_enclosing_type(arg))->length LOC value.c:1430 (value.c:1427) - Function memcpy expects arg 3 to be size_t gets UINT: (enc_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (enc_type)->length LOC value.c:1934 (value.c:1931) - Function memcpy expects arg 3 to be size_t gets UINT: (value_type(newval))->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (value_type(newval))->length LOC value.c:2454 (value.c:2451) - Assignment of UINT to int: len = (type)->length + Assignment of ULONGEST to int: len = (type)->length LOC value.c:2577 (value.c:2574) - Function xrealloc expects arg 2 to be size_t gets UINT: (new_encl_type)->length + Function xrealloc expects arg 2 to be size_t gets ULONGEST: (new_encl_type)->length LOC value.c:2624 (value.c:2621) - Operands of <= have incompatible types (UINT, int): (type)->length <= (int)sizeof(LONGEST) + Operands of <= have incompatible types (ULONGEST, int): (type)->length <= (int)sizeof(LONGEST) +LOC value.c:2625 + Assignment of LONGEST to int: v->bitpos = bitpos % container_bitsize +LOC value.c:2627 + Assignment of LONGEST to int: v->bitpos = bitpos % 8 LOC value.c:2793 (value.c:2792) - Assignment of UINT to int: bytes_read = (field_type)->length + Assignment of LONGEST to int: bytes_read = ((bitpos % 8) + bitsize + 7) / 8 +LOC value.c:2795 + Assignment of ULONGEST to int: bytes_read = (field_type)->length LOC value.c:2810 + Assignment of LONGEST to int: lsbcount = (bytes_read * 8 - bitpos % 8 - bitsize) +LOC value.c:2812 + Assignment of LONGEST to int: lsbcount = (bitpos % 8) +LOC value.c:2813 Right operand of >>= may be negative (int): val >>= lsbcount value.c: (in function modify_field) LOC value.c:2984 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: bytesize +LOC value.c:2987 New fresh storage (type struct gdbarch *) passed as implicitly temp (not released): get_type_arch(type) LOC value.c:2990 (value.c:2987) - Right operand of << may be negative (int): mask << bitpos + Right operand of << may be negative (LONGEST): mask << bitpos LOC value.c:2991 (value.c:2988) - Right operand of << may be negative (int): fieldval << bitpos + Right operand of << may be negative (LONGEST): fieldval << bitpos +LOC value.c:2993 + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: bytesize value.c: (in function pack_long) LOC value.c:3005 (value.c:3002) - Assignment of UINT to int: len = (type)->length + Assignment of ULONGEST to int: len = (type)->length LOC value.c:3040 (value.c:3037) - Assignment of UINT to int: len = (type)->length + Assignment of ULONGEST to int: len = (type)->length LOC value.c:3121 (value.c:3118) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length value.c: (in function value_from_contents) LOC value.c:3137 (value.c:3134) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length value.c: (in function value_from_double) LOC value.c:3163 (value.c:3160) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length value.c: (in function value_from_history_ref) LOC value.c:78 File static function VEC_range_s_safe_push declared but not used LOC value.c:78 Definition of VEC_range_s_safe_push LOC vax-tdep.c:132 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC vax-tdep.c:227 - Function read_memory expects arg 3 to be ssize_t gets int: len + Function read_memory expects arg 3 to be ssize_t gets LONGEST: len LOC vax-tdep.c:239 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC vax-tdep.c:244 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len +LOC xstormy16-tdep.c:287 + Assignment of LONGEST to int: slacklen = typelen & 1 LOC xstormy16-tdep.c:288 (xstormy16-tdep.c:285) - Function C_alloca expects arg 1 to be size_t gets int: typelen + slacklen + Function C_alloca expects arg 1 to be size_t gets LONGEST: typelen + slacklen LOC xstormy16-tdep.c:289 (xstormy16-tdep.c:286) - Function memcpy expects arg 3 to be size_t gets int: typelen + Function memcpy expects arg 3 to be size_t gets LONGEST: typelen LOC xstormy16-tdep.c:293 (xstormy16-tdep.c:290) - Function write_memory expects arg 3 to be ssize_t gets int: typelen + slacklen + Function write_memory expects arg 3 to be ssize_t gets LONGEST: typelen + slacklen xstormy16-tdep.c: (in function xstormy16_alloc_frame_cache) LOC breakpoint.h:829 File static function VEC_breakpoint_p_safe_insert declared but not used LOC breakpoint.h:829 Definition of VEC_breakpoint_p_safe_insert LOC xtensa-tdep.c:1601 - New fresh storage (type char *) passed as implicitly temp (not released): gettext("cannot extract return value of %d bytes long") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("cannot extract return value of %s bytes long") LOC xtensa-tdep.c:1621 (xtensa-tdep.c:1625) + Assignment of LONGEST to int: offset = 4 - len +LOC xtensa-tdep.c:1626 + Function regcache_raw_read_part expects arg 4 to be int gets LONGEST: len +LOC xtensa-tdep.c:1626 Return value (type enum register_status) ignored: regcache_raw_rea... LOC xtensa-tdep.c:1657 (xtensa-tdep.c:1656) - New fresh storage (type char *) passed as implicitly temp (not released): gettext("unimplemented for this length: %d") + New fresh storage (type char *) passed as implicitly temp (not released): gettext("unimplemented for this length: %s") LOC xtensa-tdep.c:1671 (xtensa-tdep.c:1675) + Assignment of LONGEST to int: offset = 4 - len +LOC xtensa-tdep.c:1676 Function regcache_raw_write_part expects arg 2 to be int gets UINT: areg LOC xtensa-tdep.c:1676 (xtensa-tdep.c:1677) + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len +LOC xtensa-tdep.c:1678 Function regcache_raw_write expects arg 2 to be int gets UINT: areg LOC xtensa-tdep.c:1785 (xtensa-tdep.c:1795) + Fresh storage arg_type_len_s not released before scope exit + LOC xtensa-tdep.c:1767 + Fresh storage arg_type_len_s created +LOC xtensa-tdep.c:1797 Test expression for if not boolean, type int: struct_return LOC xtensa-tdep.c:1822 (xtensa-tdep.c:1820) - Assignment of UINT to int: info->align = (arg_type)->length + Assignment of ULONGEST to int: info->align = (arg_type)->length LOC xtensa-tdep.c:1830 (xtensa-tdep.c:1828) - Assignment of UINT to int: info->align = (builtin_type(gdbarch)->builtin_double)->length + Assignment of ULONGEST to int: info->align = (builtin_type(gdbarch)->builtin_double)->length LOC xtensa-tdep.c:1832 (xtensa-tdep.c:1830) - Assignment of UINT to int: info->align = (builtin_type(gdbarch)->builtin_long)->length + Assignment of ULONGEST to int: info->align = (builtin_type(gdbarch)->builtin_long)->length LOC xtensa-tdep.c:1837 (xtensa-tdep.c:1835) - Assignment of UINT to int: info->align = (builtin_type(gdbarch)->builtin_long)->length + Assignment of ULONGEST to int: info->align = (builtin_type(gdbarch)->builtin_long)->length +LOC xtensa-tdep.c:1856 + Assignment of LONGEST to int: info->u.regno = (gdbarch_tdep(gdbarch)->call_abi == CallAbiCall0Only ? (gdbarch_tdep(gdbarch)->a0_base + 2) : (gdbarch_tdep(gdbarch)->a0_base + 6)) + size / 4 LOC xtensa-tdep.c:1886 (xtensa-tdep.c:1895) - Function write_memory expects arg 3 to be ssize_t gets int: info->length + Variable n initialized to type LONGEST, expects int: info->length +LOC xtensa-tdep.c:1897 + Function write_memory expects arg 3 to be ssize_t gets LONGEST: info->length +LOC xtensa-tdep.c:1902 + Variable n initialized to type LONGEST, expects int: info->length LOC dwarf2expr.h:335 File static function gdb_skip_leb128 declared but not used LOC dwarf2expr.h:342 Definition of gdb_skip_leb128 ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-11 18:33 ` Siddhesh Poyarekar @ 2012-06-12 9:56 ` Jan Kratochvil 2012-06-12 14:35 ` Jan Kratochvil 0 siblings, 1 reply; 70+ messages in thread From: Jan Kratochvil @ 2012-06-12 9:56 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey On Mon, 11 Jun 2012 20:33:36 +0200, Siddhesh Poyarekar wrote: > rm -rf splint/ > mkdir -p splint/bits > touch splint/bits/confname.h > for i in `cat files`; do > mkdir -p splint/`dirname $i` > splint +posixlib +gnuextensions -linelen 999 -hints -showcolumn > \ -Isplint -exportlocal -DTUI -I. \ > -Icommon -I../include -I../bfd -I../libdecnumber > -I../opcodes \ -I.. -I/usr/include/python2.7 $i &>splint/$i.out > done BTW this line wrapping corrupted the script, it is not convenient to copy-past it then. > After running this script the changes to review have come to approx > 2500 lines (also attached). Does this look OK? If it does, then I can do > a step-by-step review of these changes and post them. Yes, I agree with everything you did. Just I have now found splint crashes on some files so the results are incomplete and some regressions may have been missed. I have filed https://bugzilla.redhat.com/show_bug.cgi?id=831141 But apparently maybe just removing some assertion would be enough for this GDB purpose. Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-12 9:56 ` Jan Kratochvil @ 2012-06-12 14:35 ` Jan Kratochvil 2012-06-18 10:31 ` [1/2][PATCH " Siddhesh Poyarekar 2012-06-18 10:31 ` [2/2][PATCH " Siddhesh Poyarekar 0 siblings, 2 replies; 70+ messages in thread From: Jan Kratochvil @ 2012-06-12 14:35 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey On Tue, 12 Jun 2012 11:55:43 +0200, Jan Kratochvil wrote: > On Mon, 11 Jun 2012 20:33:36 +0200, Siddhesh Poyarekar wrote: > > splint +posixlib +gnuextensions -linelen 999 -hints -showcolumn > > \ -Isplint -exportlocal -DTUI -I. \ > > -Icommon -I../include -I../bfd -I../libdecnumber > > -I../opcodes \ -I.. -I/usr/include/python2.7 $i &>splint/$i.out [...] > But apparently maybe just removing some assertion would be enough for this GDB > purpose. Maybe for example removing +posixlib would be easier. Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [1/2][PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-12 14:35 ` Jan Kratochvil @ 2012-06-18 10:31 ` Siddhesh Poyarekar 2012-06-20 15:47 ` Jan Kratochvil 2012-06-18 10:31 ` [2/2][PATCH " Siddhesh Poyarekar 1 sibling, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-06-18 10:31 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey [-- Attachment #1: Type: text/plain, Size: 2081 bytes --] Splitting and resending for gdb-patches since the limit is 400k for it. On Tue, 12 Jun 2012 16:34:32 +0200, Jan wrote: > On Tue, 12 Jun 2012 11:55:43 +0200, Jan Kratochvil wrote: > > On Mon, 11 Jun 2012 20:33:36 +0200, Siddhesh Poyarekar wrote: > > > splint +posixlib +gnuextensions -linelen 999 -hints > > > -showcolumn \ -Isplint -exportlocal -DTUI -I. \ > > > -Icommon -I../include -I../bfd -I../libdecnumber > > > -I../opcodes \ -I.. -I/usr/include/python2.7 $i &>splint/$i.out > [...] > > But apparently maybe just removing some assertion would be enough > > for this GDB purpose. > > Maybe for example removing +posixlib would be easier. I have attached an updated patch (and changelog) after a minor rebase and minor changes you suggested earlier (lines longer than 80 chars, pulongest for size_t). New command is now: for i in `cat files`; do mkdir -p splint/`dirname $i` splint -linelen 999 -hints -showcolumn +trytorecover \ -Dsigjmp_buf=int -Dsiginfo_t=int \ -Isplint -exportlocal -DTUI -I. \ -Icommon -I../include -I../bfd -I../libdecnumber \ -I../opcodes -I.. -I/usr/include/python2.7 \ $i &>splint/$i.out done The command now fails only for the following arch dependent files (no additional assertion failures): ia64-linux-nat.c mips-linux-nat.c nto-procfs.c procfs.c s390-nat.c on parser errors due to missing headers. Attached new locdiff output as well as modified my script for the following: * Skip 'Test expression for ... not boolean' warnings * Skip 'New fresh storage ... passed as implicitly temp' warnings since our changes couldn't have caused them. * Skip 'Operands have incompatible types' when the types after the change are ULONGEST and LONGEST * Remove blocks that do not record changes, i.e. of the type: --- 8< ----- LOC... | foo... |=> Remove this. bar... | --- 8< ----- [ -+]LOC... If these changes are OK, then I'll record my review on the resultant locdiff.processed.out, which is 2330 lines now. Thanks, Siddhesh [-- Attachment #2: bitpos-changelog.txt --] [-- Type: text/plain, Size: 28815 bytes --] gdb/ChangeLog 2012-05-31 Siddhesh Poyarekar <siddhesh@redhat.com> * ada-lang.c (fat_pntr_bounds_bitpos): Return LONGEST. (fat_pntr_data_bitpos): Likewise. (desc_bound_bitpos): Likewise. (constrained_packed_array_type): Expand elt_bits parameter to LONGEST. (move_bits): Expand parameters src_offset and n to LONGEST. (cond_offset_host): Expand parameter offset to LONGEST. (cond_offset_target): Likewise. (ada_type_of_array): Expand array_bitsize to LONGEST. (decode_constrained_packed_array_type): Expand bits to LONGEST. (decode_constrained_packed_array): Expand bit_pos to LONGEST. (ada_value_primitive_packed_val): Expand parameter offset to LONGEST. Expand targ and ntarg to LONGEST. (ada_value_assign): Expand from_size to LONGEST. (value_assign_to_component): Expand bits to LONGEST. (ensure_lval): Expand len to LONGEST. (value_pointer): Expand len to ULONGEST. (value_tag_from_contents_and_address): Expand tag_byte_offset to LONGEST. (ada_value_primitive_field): Expand parameter offset to LONGEST. Expand bit_pos to LONGEST. (find_struct_field): Expand parameters offset and byte_offset_p to LONGEST. Expand bit_pos and fld_offset to LONGEST. (ada_search_struct_field): Expand parameter offset to LONGEST. Expand var_offset to LONGEST. (ada_index_struct_field): Expand parameters index and offset to LONGEST. (ada_index_struct_field_1): Expand parameters index_p and offset to LONGEST. (ada_value_struct_elt): Expand byte_offset to LONGEST. (align_value): Return ULONGEST. Expand parameter off and alignment to ULONGEST. (ada_template_to_fixed_record_type_1): Expand off, bit_len and fld_bit_len to LONGEST. Expand field_offset to LONGEST. Use pulongest function to print TYPE_LENGTH. (to_fixed_array_type): Expand len to LONGEST. * ada-lang.h (ada_val_print): Expand parameter embedded_offset to LONGEST. (ada_printstr): Expand parameter length to ULONGEST. (ada_value_primitive_packed_val): Expand parameter offset to LONGEST. * ada-typeprint.c (ada_print_type): Use pulongest to print TYPE_LENGTH. * ada-valprint.c (val_print_packed_array_elements): Expand eltlen to ULONGEST. (char_at): Expand parameter i to LONGEST. (printstr): Expand parameter length to ULONGEST. (ada_printstr): Likewise. (ada_val_print): Expand embedded_offset to LONGEST. (ada_val_print_array): Expand eltlen, len to ULONGEST and temp_len to LONGEST. (ada_val_print_1): Expand parameter offset to LONGEST. Expand len to LONGEST. (print_variant_part): Expand parameters offset and outer_offset to LONGEST. (print_field_values): Likewise. Expand bit_pos to LONGEST. * alpha-tdep.c (struct alpha_arg): Expand member len to LONGEST. (alpha_push_dummy_call): Expand len to LONGEST. (alpha_extract_return_value): Likewise. (alpha_store_return_value): Likewise. * amd64-tdep.c (amd64_classify_aggregate): Expand len, bitsize, endpos and pos to LONGEST. (amd64_classify): Expand len to LONGEST. (amd64_return_value): Likewise. (amd64_push_arguments): Expand num_elements, element and len to LONGEST. (amd64_get_longjmp_target): Expand len to LONGEST. * amd64-windows-tdep.c (amd64_windows_return_value): Likewise. * arm-linux-nat.c (arm_linux_hw_watchpoint_initialize): Expand parameter len to LONGEST. (arm_linux_region_ok_for_hw_watchpoint): Likewise. (arm_linux_insert_watchpoint): Likewise. (arm_linux_remove_watchpoint): Likewise. * arm-tdep.c (arm_push_dummy_call): Expand len to LONGEST. (arm_extract_return_value): Likewise. (arm_store_return_value): Likewise. * avr-tdep.c (avr_return_value): Expand i to LONGEST. (push_stack_item): Expand parameter len to LONGEST. (avr_push_dummy_call): Expand last_regnum, len to LONGEST. * ax-gdb.c (gen_trace_static_fields): Expand length to LONGEST. (gen_traced_pop): Likewise. (gen_left_shift): Expand parameter distance to LONGEST. (gen_offset): Expand parameter offset to LONGEST. (gen_bitfield_ref): Expand parameters start, end to LONGEST. Expand bound_start, bound_end, offset to LONGEST. (gen_primitive_field): Expand parameter offset to LONGEST. (gen_struct_ref_recursive): Likewise. * bfin-tdep.c (bfin_push_dummy_call): Expand total_len, len, container_len to LONGEST. (bfin_extract_return_value): Expand len to LONGEST. (bfin_store_return_value): Likewise. * breakpoint.c (update_watchpoint): Expand len to LONGEST. (can_use_hardware_watchpoint): Likewise. (invalidate_bp_value_on_memory_change): Expand parameter len to LONGEST. * breakpoint.h (struct bp_location): Expand member length to LONGEST. * c-lang.c (c_printstr): Expand parameter length to ULONGEST. (evaluate_subexp_c): Expand element_size, i to LONGEST. * c-lang.h (c_val_print): Expand parameter embedded_offset to LONGEST. (c_printstr): Expand parameter length to ULONGEST. (cp_print_value_fields): Expand parameter offset to LONGEST. (cp_print_value_fields_rtti): Likewise. * c-typeprint.c (c_type_print_varspec_suffix): Remove cast down to int and use plongest to print LONGEST. * c-valprint.c (c_val_print): Expand parameter embedded_offset to LONGEST. Expand offset to LONGEST, eltlen to ULONGEST. (c_value_print): Expand top to LONGEST. * cp-abi.c (baseclass_offset): Return LONGEST. Expand parameter embedded_offset to LONGEST. Expand res to LONGEST. (value_virtual_fn_field): Expand parameter offset to LONGEST. (value_rtti_type): Expand parameter top to point to LONGEST. * cp-abi.h (value_virtual_fn_field): Expand offset to LONGEST. (value_rtti_type): Expand top to point to LONGEST. (baseclass_offset): Return LONGEST. Expand parameter embedded_offset to LONGEST. (struct cp_abi_ops): Expand parameter offset for virtual_fn_field to LONGEST. Expand parameter top to point to LONGEST in value_rtti_type. Return LONGEST from baseclass_offset and expand parameter for embedded_offset to LONGEST. * cp-valprint.c (cp_print_value_fields): Expand parameter offset to LONGEST. (cp_print_value_fields_rtti): Likewise. Expand top to LONGEST. (cp_print_value): Expand parameter offset to LONGEST. Expand thisoffset, boffset to LONGEST. * cris-tdep.c (push_stack_item): Expand parameter len to LONGEST. (cris_push_dummy_call): Expand len, reg_demand, i to LONGEST. (cris_store_return_value): Expand len to LONGEST. (cris_extract_return_value): Likewise. * d-lang.h (d_val_print): Expand parameter embedded_offset to LONGEST. * d-valprint.c (dynamic_array_type): Likewise. (d_val_print): Likewise. * doublest.c (floatformat_from_length): Expand parameter len to LONGEST. Use plongest to format string for LONGEST. * dwarf2loc.c (copy_bitwise): Expand parameters dest_offset_bits, bit_count to ULONGEST. Rename parameter source_offset_bits to source_offset and expand to ULONGEST. New variable source_offset_bits. (read_pieced_value): Expand offset, dest_offset_bits, source_offset_bits, source_offset to LONGEST. Expand type_len, this_size, this_size_bits to ULONGEST. (write_pieced_value): Expand type_len, this_size, this_size_bits to ULONGEST. Expand dest_offset_bits, source_offset_bits, dest_offset, source_offset to LONGEST. (check_pieced_value_bits): Expand parameters bit_offset and bit_length to LONGEST. (check_pieced_value_validity): Likewise. (check_pieced_synthetic_pointer): Likewise. (indirect_pieced_value): Expand bit_length, byte_offset and bit_offset to LONGEST. (dwarf2_evaluate_loc_desc_full): Expand n to ULONGEST. * dwarf2read.c (struct dwarf_block): Expand member size to size_t. (dwarf2_const_value_length_mismatch_complaint): Expand parameters arg2 and arg3 to LONGEST. Use plongest to print arg2 and arg3. (dwarf2_add_field): Expand anonymous_size to LONGEST. (dump_die_shallow): Use pulongest to format print dwarf_block.size. * eval.c (evaluate_struct_tuple): Expand bitpos to LONGEST. (init_array_element): Expand element_size to LONGEST. (binop_promote): Expand promoted_len1, promoted_len2, result_len to ULONGEST. (evaluate_subexp_standard): Expand mem_offset, top, element_size to LONGEST. * f-lang.c (f_printstr): Expand parameter length to ULONGEST. * f-lang.h (f_val_print): Expand parameter embedded_offset to LONGEST. * f-valprint.c (f77_array_offset_tbl): Make LONGEST. (f77_create_arrayprint_offset_tbl): Expand eltlen to LONGEST. (f77_print_array_1): Expand parameter embedded_offset to LONGEST. (f77_print_array): Likewise. (f_val_print): Likewise. Expand offset to LONGEST. * findcmd.c (parse_find_args): Expand val_bytes to LONGEST. * findvar.c (default_read_var_value): Expand len to LONGEST. (default_value_from_register): Likewise. (read_frame_register_value): Expand offset, reg_offset, len, reg_len to LONGEST. * frv-tdep.c (frv_extract_return_value): Expand len to LONGEST. Use plongest to format print len. (frv_push_dummy_call): Expand len to LONGEST. (frv_store_return_value): Likewise. Use plongest to format print len. * gdbtypes.c (init_type): Expand parameter length to LONGEST. (is_unique_ancestor_worker): Expand parameters offset, embedded_offset to LONGEST. Expand this_offset to LONGEST. (is_unique_ancestor): Expand offset to LONGEST. (recursive_dump_type): Use pulongest to format print TYPE_LENGTH. Use plongest to format print TYPE_FIELD_BITPOS. (arch_type): Expand parameter length to LONGEST. * gdbtypes.h (type.main_type.fld_bnds.fields): Expand bitpos to LONGEST. (type): Expand length to ULONGEST. (init_type): Expand parameter length to LONGEST. (arch_type): Likewise. * gnu-v2-abi.c (gnuv2_virtual_fn_field): Expand parameter offset to LONGEST. (gnuv2_value_rtti_type): Expand parameter top to point to LONGEST. (gnuv2_baseclass_offset): Return LONGEST. Expand parameter embedded_offset to LONGEST. Expand field_offset, boffset, field_length to LONGEST. * gnu-v3-abi.c (build_gdb_vtable_type): Expand offset to LONGEST. (vtable_address_point_offset): Return LONGEST. (gnuv3_rtti_type): Expand parameter top_p to point to LONGEST. (gnuv3_virtual_fn_field): Expand parameter offset to LONGEST. (gnuv3_baseclass_offset): Return LONGEST. Expand parameter embedded_ofset to LONGEST. Expand cur_base_offset, base_offset to LONGEST. (gnuv3_find_method_in): Expand pos to LONGEST. * go-lang.h (go_val_print): Expand parameter embedded_offset to LONGEST. * go-valprint.c (go_val_print): Likewise. * h8300-tdep.c (h8300_push_dummy_call): Expand stack_alloc, stack_offset, len, padded_len, offset to LONGEST. * hppa-tdep.c (hppa64_push_dummy_call): Expand len to LONGEST. (hppa64_return_value): Likewise. * i386-darwin-tdep.c (i386_darwin_arg_type_alignment): Return LONGEST. Expand res to LONGEST. (i386_darwin_push_dummy_call): Expand arg_spaces, len, align to LONGEST. * i386-nat.c (i386_show_dr): Expand parameter len to LONGEST. Use plongest to format print len. (i386_handle_nonaligned_watchpoint): Expand parameter len to LONGEST. (i386_insert_watchpoint): Likewise. (i386_remove_watchpoint): Likewise. (i386_region_ok_for_watchpoint): Likewise. * i386-tdep.c (i386_push_dummy_call): Expand arg_space, arg_space_used, len to LONGEST. (i386_extract_return_value): Expand len to LONGEST. Use plongest to format print len. (i386_store_return_value): Likewise. * ia64-linux-nat.c (ia64_linux_insert_watchpoint): Expand parameter len to LONGEST. (ia64_linux_remove_watchpoint): Likewise. * ia64-tdep.c (ia64_extract_return_value): Expand n to LONGEST. (ia64_store_return_value): Likewise. (ia64_push_dummy_call): Expand argoffset, len, nslots, memslots to LONGEST. * inf-ttrace.c (inf_ttrace_insert_watchpoint): Expand parameter len to LONGEST. (inf_ttrace_remove_watchpoint): Likewise. (inf_ttrace_region_ok_for_hw_watchpoint): Likewise. * infcall.c (call_function_by_hand): Expand len to LONGEST. * infrun.c (save_infcall_suspend_state): Expand len to ULONGEST. (restore_infcall_suspend_state): Eliminate single-use variable len. * iq2000-tdep.c (iq2000_store_return_value): Expand len to LONGEST. (iq2000_extract_return_value): Likewise. (iq2000_push_dummy_call): Expand typelen, stackspace to LONGEST. * jv-lang.c (java_link_class_type): Expand boffset to LONGEST. (java_printstr): Expand parameter length to ULONGEST. * jv-lang.h (java_val_print): Expand parameter embedded_offset to LONGEST. * jv-valprint.c (java_print_value_fields): Expand parameter offset to LONGEST. (java_val_print): Expand parameter embedded_offset to LONGEST. * language.c (unk_lang_printstr): Expand parameter length to ULONGEST. (unk_lang_val_print): Expand parameter embedded_offset to LONGEST. * language.h (language_defn): Expand parameter length of la_printstr to ULONGEST. Expand parameter embedded_offset of la_val_print to LONGEST. * lm32-tdep.c (lm32_push_dummy_call): Expand len to LONGEST. (lm32_store_return_value): Likewise. * m2-lang.c (m2_printstr): Expand parameter length to ULONGEST. * m2-lang.h (m2_val_print): Expand parameter embedded_offset to LONGEST. * m2-typeprint.c (m2_array): Use pulongest to print TYPE_LENGTH. (m2_enum): expand lastval to LONGEST. * m2-valprint.c (m2_print_long_set): Expand parameter embedded_offset to LONGEST. (m2_print_unbounded_array): Likewise. (m2_print_array_contents): Likewise. Eliminate eltlen and use TYPE_LENGTH directly. (m2_val_print): Expand parameter embedded_offset to LONGEST. Expand i, len, temp_len to ULONGEST. Remove eltlen, use TYPE_LENGTH directly. * m32r-tdep.c (m32r_push_dummy_call): Expand len to LONGEST. (m32r_extract_return_value): Likewise. * m68hc11-tdep.c (m68hc11_push_dummy_call): Expand len to LONGEST. (m68hc11_store_return_value): Likewise. * m68k-tdep.c (m68k_extract_return_value): Expand len to LONGEST. Use plongest to format print len. (m68k_svr4_extract_return_value): Replace single-use variable len with TYPE_LENGTH. (m68k_store_return_value): Expand len to LONGEST. Use plongest to format print len. (m68k_svr4_store_return_value): Replace single-use variable len with TYPE_LENGTH. (m68k_push_dummy_call): Expand len, container_len, offset to LONGEST. * m88k-tdep.c (m88k_store_arguments): Expand num_register_words, num_stack_words, len to LONGEST. (m88k_return_value): Expand len to LONGEST. * memrange.c (mem_ranges_overlap): Expand parameters len1, len2 to LONGEST. * memrange.h (struct mem_range): Expand member length to LONGEST. (mem_ranges_overlap): Expand parameters len1, len2 to LONGEST. * mep-tdep.c (push_large_arguments): Expand arg_len to ULONGEST. (mep_push_dummy_call): Expand arg_size to ULONGEST. * microblaze-tdep.c (microblaze_store_return_value): Expand len to LONGEST. * mips-linux-nat.c (mips_linux_region_ok_for_hw_watchpoint): Expand parameter len to LONGEST. (mips_linux_insert_watchpoint): Likewise. (mips_linux_remove_watchpoint): Likewise. * mips-tdep.c (mips_xfer_register): Expand parameter buf_offset to LONGEST. Use plongest to format print buf_offset. (mips_eabi_push_dummy_call): Expand len to LONGEST. Use plongest to format print len. (mips_n32n64_fp_arg_chunk_p): Expand parameter offset to LONGEST. Expand pos to LONGEST. (mips_n32n64_return_value): Expand offset to LONGEST. Use plongest to format print offset. (mips_o32_push_dummy_call): Expand len to LONGEST. Eliminate single-use variable arglen. Use plongest to format print len. (mips_o64_push_dummy_call): Expand len, stack_offset to LONGEST. Eliminate single-use variable arglen. Use plongest to format print len. * mn10300-tdep.c (mn10300_type_align): Return LONGEST. Expand align, falign to LONGEST. (mn10300_push_dummy_call): Expand len, arg_len to LONGEST. * moxie-tdep.c (moxie_store_return_value): Expand len to LONGEST. (moxie_extract_return_value): Likewise. * mt-tdep.c (mt_push_dummy_call): Expand stack_dest, typelen to LONGEST. * nto-procfs.c (procfs_hw_watchpoint): Expand parameter len to LONGEST. (procfs_remove_hw_watchpoint): Likewise. (procfs_insert_hw_watchpoint): Likewise. * objc-lang.c (objc_printstr): Expand parameter length to ULONGEST. * opencl-lang.c (lookup_opencl_vector_type): Expand parameter el_length to ULONGEST. Expand length to ULONGEST. (lval_func_read): Expand offset, n, i, j and elsize to LONGEST. (lval_func_write): Likewise. (lval_func_check_validity): Expand parameter length to LONGEST. Expand elsize, start, end, i to LONGEST. (lval_func_check_any_valid): Expand elsize to LONGEST. (lval_func_check_synthetic_pointer): Expand parameters offset and length to LONGEST. Expand elsize, start, end, i to LONGEST. * p-lang.c (is_pascal_string_type): Expand parameters length_pos, string_pos, length_size to point to LONGEST. (pascal_printstr): Expand parameter length to ULONGEST. * p-lang.h (pascal_val_print): Expand parameter embedded_offset to LONGEST. (is_pascal_string_type): Expand parameters length_pos, string_pos, length_size to point to LONGEST. (pascal_printstr): Expand parameter length to ULONGEST. (pascal_object_print_value_fields): Expand parameter offset to LONGEST. * p-typeprint.c (pascal_type_print_base): Expand lastval to LONGEST. * p-valprint.c (pascal_val_print): Expand parameter embedded_offset to LONGEST. Expand eltlen to ULONGEST. Expand length_size, length_pos, string_pos to LONGEST. (pascal_object_print_value_fields): Expand parameter offset to LONGEST. (pascal_object_print_value): Likewise. Expand boffset, thisoffset to LONGEST. * ppc-linux-nat.c (check_condition): Expand parameter len to point to LONGEST. (ppc_linux_can_accel_watchpoint_condition): Expand parameter len to LONGEST. (create_watchpoint_request): Likewise. (ppc_linux_insert_watchpoint): Likewise. (ppc_linux_remove_watchpoint): Likewise. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Expand argoffset, structoffset, len, i, nelt to LONGEST. (do_ppc_sysv_return_value): Expand i, nelt, offset to LONGEST. (ppc64_sysv_abi_push_dummy_call): Expand len to LONGEST. (ppc64_sysv_abi_return_value): Expand n_regs, i, offset to LONGEST. * printcmd.c (print_formatted): Expand len to LONGEST. (float_type_from_length): Expand len to ULONGEST. (print_scalar_formatted): Likewise. * procfs.c (procfs_set_watchpoint): Expand parameter len to LONGEST. (procfs_insert_watchpoint): Likewise. (procfs_remove_watchpoint): Likewise. (procfs_region_ok_for_hw_watchpoint): Likewise. * python/py-prettyprint.c (apply_val_pretty_printer): Expand parameter embedded_offset to LONGEST. * python/python.h (apply_val_pretty_printer): Likewise. * regcache.c (regcache_xfer_part): Expand parameter offset to LONGEST. (regcache_cooked_read_part): Likewise. (regcache_cooked_write_part): Likewise. * regcache.h (regcache_cooked_read_part): Likewise. (regcache_cooked_write_part): Likewise. * remote-m32r-sdi.c (m32r_insert_watchpoint): Expand parameter len to LONGEST. Use plongest to format print len. (m32r_remove_watchpoint): Likewise. * remote-mips.c (struct lsi_breakpoint_info): Expand member len to LONGEST. (calculate_mask): Expand parameter len to LONGEST. (mips_insert_watchpoint): Likewise. (mips_remove_watchpoint): Likewise. (mips_set_breakpoint): Likewise. (mips_clear_breakpoint): Likewise. * remote.c (remote_insert_watchpoint): Expand parameter len to LONGEST. Use phex_nz to format print len. (remote_remove_watchpoint): Likewise. (remote_region_ok_for_hw_watchpoint): Expand parameter len to LONGEST. * rl78-tdep.c (rl78_push_dummy_call): Expand len, container_len to LONGEST. * rs6000-aix-tdep.c (rs6000_push_dummy_call): Expand len to LONGEST. (ran_out_of_registers_for_arguments): Expand space, jj to LONGEST. * s390-nat.c (s390_insert_watchpoint): Expand parameter len to LONGEST. (s390_remove_watchpoint): Likewise. (s390_region_ok_for_hw_watchpoint): Likewise. * s390-tdep.c (s390_value_from_register): Expand len to LONGEST. (s390_function_arg_pass_by_reference): Eliminate single-use variable length. (s390_function_arg_float): Likewise. (s390_push_dummy_call): Likewise. Expand length to ULONGEST. (s390_frame_align): Eliminate single-us variable length. (s390_return_value_convention): Eliminate single-us variable length. (s390_return_value): Expand length to LONGEST. * score-tdep.c (score_push_dummy_call): Expand arglen to LONGEST. * sh-tdep.c (sh_extract_return_value_nofpu): Expand len to LONGEST. (sh_store_return_value_nofpu): Likewise. * sh64-tdep.c (sh64_push_dummy_call): Expand stack_offset, stack_alloc, len to LONGEST. (sh64_extract_return_value): Expand len to LONGEST. (sh64_store_return_value): Likewise. * sparc-tdep.c (sparc32_store_arguments): Likewise. * sparc64-tdep.c (sparc64_store_floating_fields): Expand parameter bitpos to LONGEST. Expand subpos to LONGEST. (sparc64_extract_floating_fields): Likewise. (sparc64_store_arguments): Expand len to LONGEST. * spu-multiarch.c (spu_region_ok_for_hw_watchpoint): Expand parameter len to LONGEST. * spu-tdep.c (spu_value_from_register): Expand len to LONGEST. * stack.c (read_frame_arg): Expand len, len_deref to ULONGEST. (print_frame_args): Expand current_offset, arg_size to LONGEST. * symmisc.c (print_symbol): Expand i to ULONGEST. Use pulongest to format print TYPE_LENGTH. * target.c (default_region_ok_for_hw_watchpoint): Expand parameter len to LONGEST. (debug_to_insert_watchpoint): Likewise. (debug_to_remove_watchpoint): Likewise. (debug_to_region_ok_for_hw_watchpoint): Likewise. (debug_to_can_accel_watchpoint_condition): Likewise. (update_current_target): Adjust function signatures for to_insert_watchpoint, to_remove_watchpoint and to_can_accel_watchpoint_condition. * target.h (struct target_ops): Expand parameter len to LONGEST for to_remove_watchpoint, to_insert_watchpoint, to_region_ok_for_hw_watchpoint and to_can_accel_watchpoint_condition. * tracepoint.c (collect_symbol): Expand len to ULONGEST. Use pulongest to format print len. (encode_actions_1): Make addr as CORE_ADDR. Expand len to ULONGEST. (scope_info): Expand j to LONGEST. Use pulongest to format print TYPE_LENGTH. * typeprint.c (whatis_exp): Expand top to LONGEST. * v850-tdep.c (v850_push_dummy_call): Expand len to LONGEST. (v850_extract_return_value): Likewise. (v850_store_return_value): Likewise. * valarith.c (value_subscripted_rvalue): Expand elt_size, elt_offs to ULONGEST. (value_logical_not): Expand len to LONGEST. (value_strcmp): Expand len1, len2 to LONGEST. * valops.c (value_allocate_space_in_inferior): Expand parameter len to LONGEST. (value_cast_structs): Expand top to LONGEST. (value_cast): Expand element_length to ULONGEST. Expand val_length to LONGEST. (dynamic_cast_check_1): Expand parameter embedded_offset to LONGEST. Expand offset to LONGEST. (dynamic_cast_check_2): Likewise. (value_dynamic_cast): Expand top to LONGEST. (value_fetch_lazy): Expand length to LONGEST. (value_assign): Expand changed_len, offset to LONGEST. (value_array): Expand typelength to ULONGEST. (do_search_struct_field): Expand parameter offset to LONGEST. Expand new_offset, boffset to LONGEST. (search_struct_field): Expand parameter offset to LONGEST. (search_struct_method): Likewise. Expand base_offset, this_offset to LONGEST. (find_method_list): Expand parameter offset to LONGEST, parameter boffset to point to LONGEST. Expand base_offset to LONGEST. (value_find_oload_method_list): Expand parameter boffset to point to LONGEST. (find_overload_match): Expand boffset to LONGEST. (value_struct_elt_for_reference): Expand parameter offset to LONGEST. Remove unneeded cast. Expand base_offset to LONGEST. (value_rtti_indirect_type): Expand parameter top to point to LONGEST. (value_full_object): Expand parameter xtop to LONGEST. Expand top to LONGEST. * valprint.c (valprint_check_validity): Expand parameter embedded_offset to LONGEST. (generic_val_print): Likewise. (val_print): Likewise. (val_print_scalar_formatted): Likewise. (print_hex_chars): Expand parameter len to ULONGEST. (val_print_array_elements): Expand parameter embedded_offset to LONGEST. Expand len, eltlen to ULONGEST. (generic_printstr): Expand parameter length to ULONGEST. * valprint.h (val_print_array_elements): Expand parameter embedded_offset to LONGEST. (val_print_scalar_formatted): Likewise. (print_hex_chars): Expand parameter len to ULONGEST. (generic_val_print): Expand parameter embedded_offset to LONGEST. (generic_printstr): Expand parameter length to ULONGEST. * value.c (struct range): Expand members offset, length to LONGEST. (ranges_overlap): Expand parameters offset1, offset2, len1 and len2 to LONGEST. (range_contain): Expand parameter offset, length to LONGEST. (struct value): Expand members offset, embedded_offset, pointed_to_offset to LONGEST. (value_bytes_available): Expand parameters offset, length to LONGEST. (mark_value_bytes_unavailable): Likewise. (find_first_range_overlap): Likewise. (value_available_contents_eq): Expand parameters offset1, offset2 and length to LONGEST. (value_offset): Return LONGEST. (set_value_offset): Expand parameter offset to LONGEST. (value_contents_copy_raw): Expand parameters src_offset, dst_offset, length to LONGEST. (value_contents_copy): Likewise. (value_contents_equal): Expand len to LONGEST. (value_bits_valid): Expand parameters offset, length to LONGEST. (value_bits_synthetic_pointer): Likewise. (value_embedded_offset): Return LONGEST. (set_value_embedded_offset): Expand parameter val to LONGEST. (value_pointed_to_offset): Return LONGEST. (set_value_pointed_to_offset): Expand parameter val to LONGEST. (set_internalvar_component): Expand parameter offset to LONGEST. (value_primitive_field): Likewise. Expand bitpos, boffset, container_bitpos to LONGEST. (value_fn_field): Expand parameter offset to LONGEST. (unpack_value_bits_as_long_1): Expand parameters embedded_offset, bitpos to LONGEST. Expand read_offset to LONGEST. (unpack_value_bits_as_long): Expand parameter embeded_offset to LONGEST. (unpack_value_field_as_long_1): Likewise. Expand bitpos to LONGEST. (unpack_value_field_as_long): Expand parameter embedded_offset to LONGEST. (value_field_bitfield): Likewise. (modify_field): Expand parameter bitpos to LONGEST. Expand bytesize to LONGEST. * value.h (value_offset): Return LONGEST. (set_value_offset): Expand parameter offset to LONGEST. (value_pointed_to_offset): Return LONGEST. (set_value_pointed_to_offset): Expand parameter val to LONGEST. (value_embedded_offset): Return LONGEST. (set_value_embedded_offset): Expand parameter val to LONGEST. (struct lval_funcs): Expand parameters offset and length to LONGEST for check_validity. Likewise for check_synthetic_pointer. (valprint_check_validity): Expand parameter embedded_offset to LONGEST. (value_bits_valid): Expand parameters offset, length to LONGEST. (value_bits_synthetic_pointer): Likewise. (value_bytes_available): Likewise. (mark_value_bytes_unavailable): Likewise. (value_available_contents_eq): Expand parameters offset1, offset2, length to LONGEST. (unpack_value_bits_as_long): Expand parameter embeded_offset to LONGEST. (unpack_value_field_as_long): Likewise. (value_field_bitfield): Likewise. (value_contents_copy_raw): Expand parameters src_offset, dst_offset, length to LONGEST. (value_contents_copy): Likewise. (value_primitive_field): Expand parameter offset to LONGEST. (value_rtti_indirect_type): Expand parameter top to point to LONGEST. (value_full_object): Expand parameter xtop to LONGEST. (set_internalvar_component): Expand parameter offset to LONGEST. (value_fn_field): Expand parameter offset to LONGEST. (modify_field): Expand parameter bitpos to LONGEST. (val_print): Expand parameter embedded_offset to LONGEST. (value_allocate_space_in_inferior): Expand parameter len to LONGEST. * vax-tdep.c (vax_store_arguments): Expand count, len to LONGEST. (vax_return_value): Expand len to LONGEST. * xstormy16-tdep.c (xstormy16_extract_return_value): Expand len, i to LONGEST. (xstormy16_store_return_value): Likewise. (xstormy16_push_dummy_call): Expand j, typelen to LONGEST. * xtensa-tdep.c (xtensa_extract_return_value): Expand len to LONGEST. Use plongest to format print len. (xtensa_store_return_value): Expand len to LONGEST. Use pulongest to print TYPE_LENGTH. (struct argument_info): Expoand member length to LONGEST. (struct argument_info.u): Expand member offset to LONGEST. (xtensa_push_dummy_call): Expand size and onstack_size to LONGEST. Use int_string to format print TYPE_LENGTH. gdb/testsuite/ChangeLog: 2012-05-31 Siddhesh Poyarekar <siddhesh@redhat.com> * gdb.base/structs-longest-bitpos.c: New test case. * gdb.base/structs-longest-bitpos.exp: New test case. gdb/doc/ChangeLog: 2012-05-31 Siddhesh Poyarekar <siddhesh@redhat.com> * observer.texi (memory_changed): Expand parameter len to LONGEST. [-- Attachment #3: bitpos-expand.patch --] [-- Type: text/x-patch, Size: 224062 bytes --] diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 6f65472..48ea2d7 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -80,7 +80,7 @@ static struct type *desc_bounds_type (struct type *); static struct value *desc_bounds (struct value *); -static int fat_pntr_bounds_bitpos (struct type *); +static LONGEST fat_pntr_bounds_bitpos (struct type *); static int fat_pntr_bounds_bitsize (struct type *); @@ -88,13 +88,13 @@ static struct type *desc_data_target_type (struct type *); static struct value *desc_data (struct value *); -static int fat_pntr_data_bitpos (struct type *); +static LONGEST fat_pntr_data_bitpos (struct type *); static int fat_pntr_data_bitsize (struct type *); static struct value *desc_one_bound (struct value *, int, int); -static int desc_bound_bitpos (struct type *, int, int); +static LONGEST desc_bound_bitpos (struct type *, int, int); static int desc_bound_bitsize (struct type *, int, int); @@ -174,7 +174,7 @@ static struct type *static_unwrap_type (struct type *type); static struct value *unwrap_value (struct value *); -static struct type *constrained_packed_array_type (struct type *, long *); +static struct type *constrained_packed_array_type (struct type *, LONGEST *); static struct type *decode_constrained_packed_array_type (struct type *); @@ -189,7 +189,8 @@ static int ada_is_unconstrained_packed_array_type (struct type *); static struct value *value_subscript_packed (struct value *, int, struct value **); -static void move_bits (gdb_byte *, int, const gdb_byte *, int, int, int); +static void move_bits (gdb_byte *, int, const gdb_byte *, LONGEST, LONGEST, + int); static struct value *coerce_unspec_val_to_type (struct value *, struct type *); @@ -217,14 +218,14 @@ static struct value *value_val_atr (struct type *, struct value *); static struct symbol *standard_lookup (const char *, const struct block *, domain_enum); -static struct value *ada_search_struct_field (char *, struct value *, int, +static struct value *ada_search_struct_field (char *, struct value *, LONGEST, struct type *); -static struct value *ada_value_primitive_field (struct value *, int, int, +static struct value *ada_value_primitive_field (struct value *, LONGEST, int, struct type *); -static int find_struct_field (const char *, struct type *, int, - struct type **, int *, int *, int *, int *); +static int find_struct_field (const char *, struct type *, LONGEST, + struct type **, LONGEST *, int *, int *, int *); static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR, struct value *); @@ -240,7 +241,7 @@ static void ada_language_arch_info (struct gdbarch *, static void check_size (const struct type *); -static struct value *ada_index_struct_field (int, struct value *, int, +static struct value *ada_index_struct_field (LONGEST, struct value *, LONGEST, struct type *); static struct value *assign_aggregate (struct value *, struct value *, @@ -586,7 +587,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) } static const gdb_byte * -cond_offset_host (const gdb_byte *valaddr, long offset) +cond_offset_host (const gdb_byte *valaddr, LONGEST offset) { if (valaddr == NULL) return NULL; @@ -595,7 +596,7 @@ cond_offset_host (const gdb_byte *valaddr, long offset) } static CORE_ADDR -cond_offset_target (CORE_ADDR address, long offset) +cond_offset_target (CORE_ADDR address, LONGEST offset) { if (address == 0) return 0; @@ -1601,7 +1602,7 @@ desc_bounds (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the bounds data. */ -static int +static LONGEST fat_pntr_bounds_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 1); @@ -1667,7 +1668,7 @@ desc_data (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the data. */ -static int +static LONGEST fat_pntr_data_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 0); @@ -1702,7 +1703,7 @@ desc_one_bound (struct value *bounds, int i, int which) of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper bound, if WHICH is 1. The first bound is I=1. */ -static int +static LONGEST desc_bound_bitpos (struct type *type, int i, int which) { return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); @@ -1892,7 +1893,7 @@ ada_type_of_array (struct value *arr, int bounds) zero, and does not need to be recomputed. */ if (lo < hi) { - int array_bitsize = + LONGEST array_bitsize = (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; @@ -2044,7 +2045,7 @@ decode_packed_array_bitsize (struct type *type) in bits. */ static struct type * -constrained_packed_array_type (struct type *type, long *elt_bits) +constrained_packed_array_type (struct type *type, LONGEST *elt_bits) { struct type *new_elt_type; struct type *new_type; @@ -2096,7 +2097,7 @@ decode_constrained_packed_array_type (struct type *type) char *name; const char *tail; struct type *shadow_type; - long bits; + LONGEST bits; if (!raw_name) raw_name = ada_type_name (desc_base_type (type)); @@ -2167,7 +2168,8 @@ decode_constrained_packed_array (struct value *arr) array with no wrapper. In order to interpret the value through the (left-justified) packed array type we just built, we must first left-justify it. */ - int bit_size, bit_pos; + int bit_size; + LONGEST bit_pos; ULONGEST mod; mod = ada_modulus (value_type (arr)) - 1; @@ -2268,15 +2270,16 @@ has_negatives (struct type *type) struct value * ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, - long offset, int bit_offset, int bit_size, + LONGEST offset, int bit_offset, int bit_size, struct type *type) { struct value *v; - int src, /* Index into the source area */ - targ, /* Index into the target area */ - srcBitsLeft, /* Number of source bits left to move */ - nsrc, ntarg, /* Number of source and target bytes */ - unusedLS, /* Number of bits in next significant + int src; /* Index into the source area */ + LONGEST targ; /* Index into the target area */ + int srcBitsLeft, /* Number of source bits left to move */ + nsrc; /* Number of source bytes */ + LONGEST ntarg; /* Number of target bytes */ + int unusedLS, /* Number of bits in next significant byte of source that are unused */ accumSize; /* Number of meaningful bits in accum */ unsigned char *bytes; /* First byte containing data to unpack */ @@ -2426,7 +2429,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, not overlap. */ static void move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source, - int src_offset, int n, int bits_big_endian_p) + LONGEST src_offset, LONGEST n, int bits_big_endian_p) { unsigned int accum, mask; int accum_bits, chunk_size; @@ -2516,7 +2519,7 @@ ada_value_assign (struct value *toval, struct value *fromval) { int len = (value_bitpos (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; - int from_size; + LONGEST from_size; char *buffer = (char *) alloca (len); struct value *val; CORE_ADDR to_addr = value_address (toval); @@ -2562,7 +2565,7 @@ value_assign_to_component (struct value *container, struct value *component, (LONGEST) (value_address (component) - value_address (container)); int bit_offset_in_container = value_bitpos (component) - value_bitpos (container); - int bits; + LONGEST bits; val = value_cast (value_type (component), val); @@ -4082,7 +4085,7 @@ ensure_lval (struct value *val) if (VALUE_LVAL (val) == not_lval || VALUE_LVAL (val) == lval_internalvar) { - int len = TYPE_LENGTH (ada_check_typedef (value_type (val))); + LONGEST len = TYPE_LENGTH (ada_check_typedef (value_type (val))); const CORE_ADDR addr = value_as_long (value_allocate_space_in_inferior (len)); @@ -4156,7 +4159,7 @@ static CORE_ADDR value_pointer (struct value *value, struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); - unsigned len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); gdb_byte *buf = alloca (len); CORE_ADDR addr; @@ -6025,7 +6028,7 @@ value_tag_from_contents_and_address (struct type *type, const gdb_byte *valaddr, CORE_ADDR address) { - int tag_byte_offset; + LONGEST tag_byte_offset; struct type *tag_type; if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, @@ -6408,7 +6411,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num) only in that it can handle packed values of arbitrary type. */ static struct value * -ada_value_primitive_field (struct value *arg1, int offset, int fieldno, +ada_value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type) { struct type *type; @@ -6420,7 +6423,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) { - int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); + LONGEST bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno); int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); return ada_value_primitive_packed_val (arg1, value_contents (arg1), @@ -6447,9 +6450,9 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, Returns 1 if found, 0 otherwise. */ static int -find_struct_field (const char *name, struct type *type, int offset, +find_struct_field (const char *name, struct type *type, LONGEST offset, struct type **field_type_p, - int *byte_offset_p, int *bit_offset_p, int *bit_size_p, + LONGEST *byte_offset_p, int *bit_offset_p, int *bit_size_p, int *index_p) { int i; @@ -6467,8 +6470,8 @@ find_struct_field (const char *name, struct type *type, int offset, for (i = 0; i < TYPE_NFIELDS (type); i += 1) { - int bit_pos = TYPE_FIELD_BITPOS (type, i); - int fld_offset = offset + bit_pos / 8; + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); + LONGEST fld_offset = offset + bit_pos / 8; const char *t_field_name = TYPE_FIELD_NAME (type, i); if (t_field_name == NULL) @@ -6538,7 +6541,7 @@ num_visible_fields (struct type *type) Searches recursively through wrapper fields (e.g., '_parent'). */ static struct value * -ada_search_struct_field (char *name, struct value *arg, int offset, +ada_search_struct_field (char *name, struct value *arg, LONGEST offset, struct type *type) { int i; @@ -6571,7 +6574,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset, int j; struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i)); - int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; + LONGEST var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) { @@ -6589,8 +6592,8 @@ ada_search_struct_field (char *name, struct value *arg, int offset, return NULL; } -static struct value *ada_index_struct_field_1 (int *, struct value *, - int, struct type *); +static struct value *ada_index_struct_field_1 (LONGEST *, struct value *, + LONGEST, struct type *); /* Return field #INDEX in ARG, where the index is that returned by @@ -6599,7 +6602,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *, * If found, return value, else return NULL. */ static struct value * -ada_index_struct_field (int index, struct value *arg, int offset, +ada_index_struct_field (LONGEST index, struct value *arg, LONGEST offset, struct type *type) { return ada_index_struct_field_1 (&index, arg, offset, type); @@ -6611,7 +6614,7 @@ ada_index_struct_field (int index, struct value *arg, int offset, * *INDEX_P. */ static struct value * -ada_index_struct_field_1 (int *index_p, struct value *arg, int offset, +ada_index_struct_field_1 (LONGEST *index_p, struct value *arg, LONGEST offset, struct type *type) { int i; @@ -6701,7 +6704,8 @@ ada_value_struct_elt (struct value *arg, char *name, int no_err) v = ada_search_struct_field (name, arg, 0, t); else { - int bit_offset, bit_size, byte_offset; + int bit_offset, bit_size; + LONGEST byte_offset; struct type *field_type; CORE_ADDR address; @@ -7007,8 +7011,8 @@ ada_coerce_ref (struct value *val0) /* Return OFF rounded upward if necessary to a multiple of ALIGNMENT (a power of 2). */ -static unsigned int -align_value (unsigned int off, unsigned int alignment) +static ULONGEST +align_value (ULONGEST off, ULONGEST alignment) { return (off + alignment - 1) & ~(alignment - 1); } @@ -7387,10 +7391,9 @@ ada_template_to_fixed_record_type_1 (struct type *type, struct value *mark = value_mark (); struct value *dval; struct type *rtype; - int nfields, bit_len; + int nfields; int variant_field; - long off; - int fld_bit_len; + LONGEST off, bit_len, fld_bit_len; int f; /* Compute the number of fields in this record type that are going @@ -7461,7 +7464,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, that follow this one. */ if (ada_is_aligner_type (field_type)) { - long field_offset = TYPE_FIELD_BITPOS (field_type, f); + LONGEST field_offset = TYPE_FIELD_BITPOS (field_type, f); field_valaddr = cond_offset_host (field_valaddr, field_offset); field_address = cond_offset_target (field_address, field_offset); @@ -7580,11 +7583,11 @@ ada_template_to_fixed_record_type_1 (struct type *type, if (TYPE_LENGTH (type) <= 0) { if (TYPE_NAME (rtype)) - warning (_("Invalid type size for `%s' detected: %d."), - TYPE_NAME (rtype), TYPE_LENGTH (type)); + warning (_("Invalid type size for `%s' detected: %s."), + TYPE_NAME (rtype), pulongest (TYPE_LENGTH (type))); else - warning (_("Invalid type size for <unnamed> detected: %d."), - TYPE_LENGTH (type)); + warning (_("Invalid type size for <unnamed> detected: %s."), + pulongest (TYPE_LENGTH (type))); } else { @@ -7921,7 +7924,8 @@ to_fixed_array_type (struct type *type0, struct value *dval, type was a regular (non-packed) array type. As a result, the bitsize of the array elements needs to be set again, and the array length needs to be recomputed based on that bitsize. */ - int len = TYPE_LENGTH (result) / TYPE_LENGTH (TYPE_TARGET_TYPE (result)); + LONGEST len = (TYPE_LENGTH (result) + / TYPE_LENGTH (TYPE_TARGET_TYPE (result))); int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0); TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0); diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index 9a93c50..3de0723 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -168,7 +168,7 @@ extern void ada_print_type (struct type *, const char *, struct ui_file *, int, extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream); -extern void ada_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern void ada_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -183,7 +183,7 @@ extern void ada_emit_char (int, struct type *, struct ui_file *, int, int); extern void ada_printchar (int, struct type *, struct ui_file *); extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *, - unsigned int, const char *, int, + ULONGEST, const char *, int, const struct value_print_options *); struct value *ada_convert_actual (struct value *actual, @@ -257,7 +257,7 @@ extern int ada_is_constrained_packed_array_type (struct type *); extern struct value *ada_value_primitive_packed_val (struct value *, const gdb_byte *, - long, int, int, + LONGEST, int, int, struct type *); extern struct type *ada_coerce_to_simple_array_type (struct type *); diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index 40f3058..10acc5e 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -815,8 +815,8 @@ ada_print_type (struct type *type0, const char *varstring, const char *name = ada_type_name (type); if (!ada_is_range_type_name (name)) - fprintf_filtered (stream, _("<%d-byte integer>"), - TYPE_LENGTH (type)); + fprintf_filtered (stream, _("<%s-byte integer>"), + pulongest (TYPE_LENGTH (type))); else { fprintf_filtered (stream, "range "); @@ -837,7 +837,8 @@ ada_print_type (struct type *type0, const char *varstring, } break; case TYPE_CODE_FLT: - fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type)); + fprintf_filtered (stream, _("<%s-byte float>"), + pulongest (TYPE_LENGTH (type))); break; case TYPE_CODE_ENUM: if (show < 0) diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 95ec7ec..9b474f7 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -42,16 +42,16 @@ static void print_record (struct type *, const gdb_byte *, int, const struct value_print_options *); static int print_field_values (struct type *, const gdb_byte *, - int, + LONGEST, struct ui_file *, int, const struct value *, const struct value_print_options *, - int, struct type *, int); + int, struct type *, LONGEST); static void adjust_type_signedness (struct type *); -static void ada_val_print_1 (struct type *, const gdb_byte *, int, CORE_ADDR, - struct ui_file *, int, +static void ada_val_print_1 (struct type *, const gdb_byte *, LONGEST, + CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); \f @@ -144,7 +144,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr, unsigned int things_printed = 0; unsigned len; struct type *elttype, *index_type; - unsigned eltlen; + ULONGEST eltlen; unsigned long bitsize = TYPE_FIELD_BITSIZE (type, 0); struct value *mark = value_mark (); LONGEST low = 0; @@ -293,7 +293,7 @@ ada_emit_char (int c, struct type *type, struct ui_file *stream, of a character. */ static int -char_at (const gdb_byte *string, int i, int type_len, +char_at (const gdb_byte *string, LONGEST i, int type_len, enum bfd_endian byte_order) { if (type_len == 1) @@ -465,7 +465,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream) static void printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, - unsigned int length, int force_ellipses, int type_len, + ULONGEST length, int force_ellipses, int type_len, const struct value_print_options *options) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (elttype)); @@ -556,7 +556,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, void ada_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { @@ -570,7 +570,7 @@ ada_printstr (struct ui_file *stream, struct type *type, void ada_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) @@ -602,8 +602,8 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); struct type *elttype = TYPE_TARGET_TYPE (type); - unsigned int eltlen; - unsigned int len; + ULONGEST eltlen; + ULONGEST len; /* We know that ELTTYPE cannot possibly be null, because we found that TYPE is a string-like type. Similarly, the size of ELTTYPE @@ -621,7 +621,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, elements up to it. */ if (options->stop_print_at_null) { - int temp_len; + LONGEST temp_len; /* Look for a NULL char. */ for (temp_len = 0; @@ -654,7 +654,7 @@ ada_val_print_array (struct type *type, const gdb_byte *valaddr, static void ada_val_print_1 (struct type *type, const gdb_byte *valaddr, - int offset, CORE_ADDR address, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -730,7 +730,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, if (ada_is_fixed_point_type (type)) { LONGEST v = unpack_long (type, valaddr + offset_aligned); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); fprintf_filtered (stream, len < 4 ? "%.11g" : "%.17g", (double) ada_fixed_to_float (type, v)); @@ -924,12 +924,12 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr, static int print_variant_part (struct type *type, int field_num, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int comma_needed, - struct type *outer_type, int outer_offset) + struct type *outer_type, LONGEST outer_offset) { struct type *var_type = TYPE_FIELD_TYPE (type, field_num); int which = ada_which_variant_applies (var_type, outer_type, @@ -1036,11 +1036,11 @@ print_record (struct type *type, const gdb_byte *valaddr, static int print_field_values (struct type *type, const gdb_byte *valaddr, - int offset, struct ui_file *stream, int recurse, + LONGEST offset, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int comma_needed, - struct type *outer_type, int outer_offset) + struct type *outer_type, LONGEST outer_offset) { int i, len; @@ -1121,7 +1121,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, } else { - int bit_pos = TYPE_FIELD_BITPOS (type, i); + LONGEST bit_pos = TYPE_FIELD_BITPOS (type, i); int bit_size = TYPE_FIELD_BITSIZE (type, i); struct value_print_options opts; diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 5d3affa..9dd64fe 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -303,7 +303,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct alpha_arg { const gdb_byte *contents; - int len; + LONGEST len; int offset; }; struct alpha_arg *alpha_args @@ -424,7 +424,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { const gdb_byte *contents = m_arg->contents; int offset = m_arg->offset; - int len = m_arg->len; + LONGEST len = m_arg->len; /* Copy the bytes destined for registers into arg_reg_buffer. */ if (offset < sizeof(arg_reg_buffer)) @@ -475,7 +475,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int length = TYPE_LENGTH (valtype); + LONGEST length = TYPE_LENGTH (valtype); gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; ULONGEST l; @@ -544,7 +544,7 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache, const gdb_byte *valbuf) { struct gdbarch *gdbarch = get_regcache_arch (regcache); - int length = TYPE_LENGTH (valtype); + LONGEST length = TYPE_LENGTH (valtype); gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; ULONGEST l; diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 8ae1142..ef837a4 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -446,7 +446,7 @@ amd64_non_pod_p (struct type *type) static void amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); /* 1. If the size of an object is larger than two eightbytes, or in C++, is a non-POD structure or union type, or contains @@ -485,10 +485,10 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int pos = TYPE_FIELD_BITPOS (type, i) / 64; + LONGEST pos = TYPE_FIELD_BITPOS (type, i) / 64; enum amd64_reg_class subclass[2]; - int bitsize = TYPE_FIELD_BITSIZE (type, i); - int endpos; + LONGEST bitsize = TYPE_FIELD_BITSIZE (type, i); + LONGEST endpos; if (bitsize == 0) bitsize = TYPE_LENGTH (subtype) * 8; @@ -552,7 +552,7 @@ void amd64_classify (struct type *type, enum amd64_reg_class class[2]) { enum type_code code = TYPE_CODE (type); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); class[0] = class[1] = AMD64_NO_CLASS; @@ -601,7 +601,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum amd64_reg_class class[2]; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM }; static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM }; int integer_reg = 0; @@ -730,8 +730,8 @@ amd64_push_arguments (struct regcache *regcache, int nargs, that register number (or a negative value otherwise). */ int *arg_addr_regno = alloca (nargs * sizeof (int)); int num_stack_args = 0; - int num_elements = 0; - int element = 0; + LONGEST num_elements = 0; + LONGEST element = 0; int integer_reg = 0; int sse_reg = 0; int i; @@ -745,7 +745,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); enum amd64_reg_class class[2]; int needed_integer_regs = 0; int needed_sse_regs = 0; @@ -839,7 +839,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, { struct type *type = value_type (stack_args[i]); const gdb_byte *valbuf = value_contents (stack_args[i]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); CORE_ADDR arg_addr = sp + element * 8; write_memory (arg_addr, valbuf, len); @@ -2764,7 +2764,7 @@ amd64_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc) CORE_ADDR jb_addr; struct gdbarch *gdbarch = get_frame_arch (frame); int jb_pc_offset = gdbarch_tdep (gdbarch)->jb_pc_offset; - int len = TYPE_LENGTH (builtin_type (gdbarch)->builtin_func_ptr); + LONGEST len = TYPE_LENGTH (builtin_type (gdbarch)->builtin_func_ptr); /* If JB_PC_OFFSET is -1, we have no way to find out where the longjmp will land. */ diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c index 41e0efa..a67190f 100644 --- a/gdb/amd64-windows-tdep.c +++ b/gdb/amd64-windows-tdep.c @@ -78,7 +78,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regnum = -1; /* See if our value is returned through a register. If it is, then diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index f9f6ba5..b818f2c 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -920,7 +920,7 @@ arm_linux_get_hwbp_type (int rw) /* Initialize the hardware breakpoint structure P for a watchpoint at ADDR to LEN. The type of watchpoint is given in RW. */ static void -arm_linux_hw_watchpoint_initialize (CORE_ADDR addr, int len, int rw, +arm_linux_hw_watchpoint_initialize (CORE_ADDR addr, LONGEST len, int rw, struct arm_linux_hw_breakpoint *p) { const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap (); @@ -1067,7 +1067,7 @@ arm_linux_remove_hw_breakpoint (struct gdbarch *gdbarch, /* Are we able to use a hardware watchpoint for the LEN bytes starting at ADDR? */ static int -arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap (); CORE_ADDR max_wp_length, aligned_addr; @@ -1099,7 +1099,7 @@ arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) /* Insert a Hardware breakpoint. */ static int -arm_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +arm_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { struct lwp_info *lp; @@ -1117,7 +1117,7 @@ arm_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, /* Remove a hardware breakpoint. */ static int -arm_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw, +arm_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { struct lwp_info *lp; diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index df5dea7..52dfb25 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3574,7 +3574,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { - int len; + LONGEST len; struct type *arg_type; struct type *target_type; enum type_code typecode; @@ -8768,7 +8768,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs, /* If the type is a plain integer, then the access is straight-forward. Otherwise we have to play around a bit more. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; ULONGEST tmp; @@ -8790,7 +8790,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs, /* For a structure or union the behaviour is as if the value had been stored to word-aligned memory and then loaded into registers with 32-bit load instruction(s). */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; bfd_byte tmpbuf[INT_REGISTER_SIZE]; @@ -8971,7 +8971,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, /* Integral values greater than one word are stored in consecutive registers starting with r0. This will always be a multiple of the regiser size. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; while (len > 0) @@ -8987,7 +8987,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, /* For a structure or union the behaviour is as if the value had been stored to word-aligned memory and then loaded into registers with 32-bit load instruction(s). */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = ARM_A1_REGNUM; bfd_byte tmpbuf[INT_REGISTER_SIZE]; diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 864d288..e138699 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -905,7 +905,7 @@ avr_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int i; + LONGEST i; /* Single byte are returned in r24. Otherwise, the MSB of the return value is always in r25, calculate which register holds the LSB. */ @@ -1176,7 +1176,8 @@ struct stack_item }; static struct stack_item * -push_stack_item (struct stack_item *prev, const bfd_byte *contents, int len) +push_stack_item (struct stack_item *prev, const bfd_byte *contents, + LONGEST len) { struct stack_item *si; si = xmalloc (sizeof (struct stack_item)); @@ -1265,12 +1266,12 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < nargs; i++) { - int last_regnum; + LONGEST last_regnum; int j; struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); const bfd_byte *contents = value_contents (arg); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); /* Calculate the potential last register needed. */ last_regnum = regnum - (len + (len & 1)); diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 1bf03df..53d2154 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -80,12 +80,12 @@ static void gen_traced_pop (struct gdbarch *, struct agent_expr *, static void gen_sign_extend (struct agent_expr *, struct type *); static void gen_extend (struct agent_expr *, struct type *); static void gen_fetch (struct agent_expr *, struct type *); -static void gen_left_shift (struct agent_expr *, int); +static void gen_left_shift (struct agent_expr *, LONGEST); static void gen_frame_args_address (struct gdbarch *, struct agent_expr *); static void gen_frame_locals_address (struct gdbarch *, struct agent_expr *); -static void gen_offset (struct agent_expr *ax, int offset); +static void gen_offset (struct agent_expr *ax, LONGEST offset); static void gen_sym_offset (struct agent_expr *, struct symbol *); static void gen_var_ref (struct gdbarch *, struct agent_expr *ax, struct axs_value *value, struct symbol *var); @@ -133,15 +133,16 @@ static void gen_deref (struct agent_expr *, struct axs_value *); static void gen_address_of (struct agent_expr *, struct axs_value *); static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - struct type *type, int start, int end); + struct type *type, LONGEST start, LONGEST end); static void gen_primitive_field (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - int offset, int fieldno, struct type *type); + LONGEST offset, int fieldno, + struct type *type); static int gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - char *field, int offset, + char *field, LONGEST offset, struct type *type); static void gen_struct_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -363,7 +364,7 @@ gen_trace_static_fields (struct gdbarch *gdbarch, { case axs_lvalue_memory: { - int length = TYPE_LENGTH (check_typedef (value.type)); + LONGEST length = TYPE_LENGTH (check_typedef (value.type)); ax_const_l (ax, length); ax_simple (ax, aop_trace); @@ -421,7 +422,7 @@ gen_traced_pop (struct gdbarch *gdbarch, case axs_lvalue_memory: { - int length = TYPE_LENGTH (check_typedef (value->type)); + LONGEST length = TYPE_LENGTH (check_typedef (value->type)); if (string_trace) ax_simple (ax, aop_dup); @@ -565,7 +566,7 @@ gen_fetch (struct agent_expr *ax, struct type *type) right shift it by -DISTANCE bits if DISTANCE < 0. This generates unsigned (logical) right shifts. */ static void -gen_left_shift (struct agent_expr *ax, int distance) +gen_left_shift (struct agent_expr *ax, LONGEST distance) { if (distance > 0) { @@ -619,7 +620,7 @@ gen_frame_locals_address (struct gdbarch *gdbarch, struct agent_expr *ax) programming in ML, it would be clearer why these are the same thing. */ static void -gen_offset (struct agent_expr *ax, int offset) +gen_offset (struct agent_expr *ax, LONGEST offset) { /* It would suffice to simply push the offset and add it, but this makes it easier to read positive and negative offsets in the @@ -1275,7 +1276,7 @@ gen_address_of (struct agent_expr *ax, struct axs_value *value) static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *type, - int start, int end) + LONGEST start, LONGEST end) { /* Note that ops[i] fetches 8 << i bits. */ static enum agent_op ops[] @@ -1310,13 +1311,13 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, /* The first and one-after-last bits in the field, but rounded down and up to byte boundaries. */ - int bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; - int bound_end = (((end + TARGET_CHAR_BIT - 1) - / TARGET_CHAR_BIT) - * TARGET_CHAR_BIT); + LONGEST bound_start = (start / TARGET_CHAR_BIT) * TARGET_CHAR_BIT; + LONGEST bound_end = (((end + TARGET_CHAR_BIT - 1) + / TARGET_CHAR_BIT) + * TARGET_CHAR_BIT); /* current bit offset within the structure */ - int offset; + LONGEST offset; /* The index in ops of the opcode we're considering. */ int op; @@ -1435,7 +1436,7 @@ gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, static void gen_primitive_field (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - int offset, int fieldno, struct type *type) + LONGEST offset, int fieldno, struct type *type) { /* Is this a bitfield? */ if (TYPE_FIELD_PACKED (type, fieldno)) @@ -1460,7 +1461,7 @@ gen_primitive_field (struct expression *exp, static int gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, struct axs_value *value, - char *field, int offset, struct type *type) + char *field, LONGEST offset, struct type *type) { int i, rslt; int nbases = TYPE_N_BASECLASSES (type); diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c index fb2ead0..77c22e2 100644 --- a/gdb/bfin-tdep.c +++ b/gdb/bfin-tdep.c @@ -506,14 +506,14 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, char buf[4]; int i; long reg_r0, reg_r1, reg_r2; - int total_len = 0; + LONGEST total_len = 0; enum bfin_abi abi = bfin_abi (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); - int len = TYPE_LENGTH (value_type); + LONGEST len = TYPE_LENGTH (value_type); total_len += (len + 3) & ~3; } @@ -531,8 +531,8 @@ bfin_push_dummy_call (struct gdbarch *gdbarch, { struct type *value_type = value_enclosing_type (args[i]); struct type *arg_type = check_typedef (value_type); - int len = TYPE_LENGTH (value_type); - int container_len = (len + 3) & ~3; + LONGEST len = TYPE_LENGTH (value_type); + LONGEST container_len = (len + 3) & ~3; sp -= container_len; write_memory (sp, value_contents_writeable (args[i]), container_len); @@ -613,7 +613,7 @@ bfin_extract_return_value (struct type *type, struct gdbarch *gdbarch = get_regcache_arch (regs); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); ULONGEST tmp; int regno = BFIN_R0_REGNUM; @@ -642,7 +642,7 @@ bfin_store_return_value (struct type *type, registers starting with R0. This will always be a multiple of the register size. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = BFIN_R0_REGNUM; gdb_assert (len <= 8); diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 82265cc..29d7e7d 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -1806,7 +1806,8 @@ update_watchpoint (struct watchpoint *b, int reparse) && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR addr; - int len, type; + LONGEST len; + int type; struct bp_location *loc, **tmp; addr = value_address (v); @@ -10748,7 +10749,7 @@ can_use_hardware_watchpoint (struct value *v) && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR vaddr = value_address (v); - int len; + LONGEST len; int num_regs; len = (target_exact_watchpoints @@ -14366,7 +14367,7 @@ show_breakpoint_cmd (char *args, int from_tty) GDB itself. */ static void -invalidate_bp_value_on_memory_change (CORE_ADDR addr, int len, +invalidate_bp_value_on_memory_change (CORE_ADDR addr, LONGEST len, const bfd_byte *data) { struct breakpoint *bp; diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 2ad80d6..f9d8a46 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -408,7 +408,7 @@ struct bp_location /* For hardware watchpoints, the size of the memory region being watched. For hardware ranged breakpoints, the size of the breakpoint range. */ - int length; + LONGEST length; /* Type of hardware watchpoint. */ enum target_hw_bp_type watchpoint_type; diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 28dce8d..303cf4d 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -189,7 +189,7 @@ c_printchar (int c, struct type *type, struct ui_file *stream) void c_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *user_encoding, int force_ellipses, const struct value_print_options *options) { @@ -679,7 +679,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, } else { - int i; + LONGEST i; /* Write the terminating character. */ for (i = 0; i < TYPE_LENGTH (type); ++i) @@ -688,7 +688,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp, if (satisfy_expected) { LONGEST low_bound, high_bound; - int element_size = TYPE_LENGTH (type); + LONGEST element_size = TYPE_LENGTH (type); if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type), &low_bound, &high_bound) < 0) diff --git a/gdb/c-lang.h b/gdb/c-lang.h index 5cbe34d..c02b8f4 100644 --- a/gdb/c-lang.h +++ b/gdb/c-lang.h @@ -72,7 +72,7 @@ extern void c_print_typedef (struct type *, struct ui_file *); extern void c_val_print (struct type *, const gdb_byte *, - int, CORE_ADDR, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -92,7 +92,7 @@ extern void c_printchar (int, struct type *, struct ui_file *); extern void c_printstr (struct ui_file * stream, struct type *elttype, const gdb_byte *string, - unsigned int length, + ULONGEST length, const char *user_encoding, int force_ellipses, const struct value_print_options *options); @@ -118,14 +118,14 @@ extern void cp_print_class_member (const gdb_byte *, struct type *, struct ui_file *, char *); extern void cp_print_value_fields (struct type *, struct type *, - const gdb_byte *, int, CORE_ADDR, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, struct type **, int); extern void cp_print_value_fields_rtti (struct type *, - const gdb_byte *, int, CORE_ADDR, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index a5892b5..7acbb8b 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -625,8 +625,8 @@ c_type_print_varspec_suffix (struct type *type, fprintf_filtered (stream, "["); if (get_array_bounds (type, &low_bound, &high_bound)) - fprintf_filtered (stream, "%d", - (int) (high_bound - low_bound + 1)); + fprintf_filtered (stream, "%s", + plongest (high_bound - low_bound + 1)); fprintf_filtered (stream, "]"); c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 7a1bb02..2de41d7 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -133,7 +133,7 @@ static const struct generic_val_print_decorations c_decorations = void c_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -144,7 +144,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, unsigned len; struct type *elttype, *unresolved_elttype; struct type *unresolved_type = type; - unsigned eltlen; + ULONGEST eltlen; CORE_ADDR addr; CHECK_TYPEDEF (type); @@ -364,9 +364,9 @@ c_val_print (struct type *type, const gdb_byte *valaddr, /* Print vtable entry - we only get here if NOT using -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ - int offset = (embedded_offset - + TYPE_FIELD_BITPOS (type, - VTBL_FNADDR_OFFSET) / 8); + LONGEST offset = (embedded_offset + + TYPE_FIELD_BITPOS (type, + VTBL_FNADDR_OFFSET) / 8); struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET); CORE_ADDR addr @@ -445,7 +445,8 @@ c_value_print (struct value *val, struct ui_file *stream, const struct value_print_options *options) { struct type *type, *real_type, *val_type; - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct value_print_options opts = *options; opts.deref_ref = 1; diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c index 16b5356..03f4baf 100644 --- a/gdb/cp-abi.c +++ b/gdb/cp-abi.c @@ -68,13 +68,13 @@ is_operator_name (const char *name) return (*current_cp_abi.is_operator_name) (name); } -int +LONGEST baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { volatile struct gdb_exception ex; - int res = 0; + LONGEST res = 0; gdb_assert (current_cp_abi.baseclass_offset != NULL); @@ -98,7 +98,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr, struct value * value_virtual_fn_field (struct value **arg1p, struct fn_field *f, int j, - struct type *type, int offset) + struct type *type, LONGEST offset) { if ((current_cp_abi.virtual_fn_field) == NULL) return NULL; @@ -108,7 +108,7 @@ value_virtual_fn_field (struct value **arg1p, struct type * value_rtti_type (struct value *v, int *full, - int *top, int *using_enc) + LONGEST *top, int *using_enc) { struct type *ret = NULL; volatile struct gdb_exception e; diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h index 8451450..a34e9fe 100644 --- a/gdb/cp-abi.h +++ b/gdb/cp-abi.h @@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, struct fn_field *f, int j, struct type *type, - int offset); + LONGEST offset); /* Try to find the run-time type of VALUE, using C++ run-time type @@ -135,7 +135,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep, FULL, TOP, and USING_ENC can each be zero, in which case we don't provide the corresponding piece of information. */ extern struct type *value_rtti_type (struct value *value, - int *full, int *top, + int *full, LONGEST *top, int *using_enc); /* Compute the offset of the baseclass which is the INDEXth baseclass @@ -144,11 +144,11 @@ extern struct type *value_rtti_type (struct value *value, contents of VAL. The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. */ -extern int baseclass_offset (struct type *type, - int index, const gdb_byte *valaddr, - int embedded_offset, - CORE_ADDR address, - const struct value *val); +extern LONGEST baseclass_offset (struct type *type, + int index, const gdb_byte *valaddr, + LONGEST embedded_offset, + CORE_ADDR address, + const struct value *val); /* Describe the target of a pointer to method. CONTENTS is the byte pattern representing the pointer to method. TYPE is the pointer to @@ -204,12 +204,13 @@ struct cp_abi_ops struct value *(*virtual_fn_field) (struct value **arg1p, struct fn_field * f, int j, struct type * type, - int offset); + LONGEST offset); struct type *(*rtti_type) (struct value *v, int *full, - int *top, int *using_enc); - int (*baseclass_offset) (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, - CORE_ADDR address, const struct value *val); + LONGEST *top, int *using_enc); + LONGEST (*baseclass_offset) (struct type *type, int index, + const bfd_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + const struct value *val); void (*print_method_ptr) (const gdb_byte *contents, struct type *type, struct ui_file *stream); diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 2e3beea..5aba016 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -82,7 +82,7 @@ static void cp_print_static_field (struct type *, struct value *, const struct value_print_options *); static void cp_print_value (struct type *, struct type *, - const gdb_byte *, int, + const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -156,7 +156,7 @@ cp_is_vtbl_member (struct type *type) void cp_print_value_fields (struct type *type, struct type *real_type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -443,7 +443,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, void cp_print_value_fields_rtti (struct type *type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -459,7 +459,8 @@ cp_print_value_fields_rtti (struct type *type, TARGET_CHAR_BIT * TYPE_LENGTH (type))) { struct value *value; - int full, top, using_enc; + int full, using_enc; + LONGEST top; /* Ugh, we have to convert back to a value here. */ value = value_from_contents_and_address (type, valaddr + offset, @@ -483,7 +484,7 @@ cp_print_value_fields_rtti (struct type *type, static void cp_print_value (struct type *type, struct type *real_type, - const gdb_byte *valaddr, int offset, + const gdb_byte *valaddr, LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -493,7 +494,7 @@ cp_print_value (struct type *type, struct type *real_type, = (struct type **) obstack_next_free (&dont_print_vb_obstack); struct obstack tmp_obstack = dont_print_vb_obstack; int i, n_baseclasses = TYPE_N_BASECLASSES (type); - int thisoffset; + LONGEST thisoffset; struct type *thistype; if (dont_print_vb == 0) @@ -507,7 +508,7 @@ cp_print_value (struct type *type, struct type *real_type, for (i = 0; i < n_baseclasses; i++) { - int boffset = 0; + LONGEST boffset = 0; int skip; struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); const char *basename = TYPE_NAME (baseclass); diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 6739037..b011ec8 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -676,7 +676,7 @@ struct stack_item }; static struct stack_item * -push_stack_item (struct stack_item *prev, void *contents, int len) +push_stack_item (struct stack_item *prev, void *contents, LONGEST len) { struct stack_item *si; si = xmalloc (sizeof (struct stack_item)); @@ -849,10 +849,10 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { - int len; + LONGEST len; char *val; - int reg_demand; - int i; + LONGEST reg_demand; + LONGEST i; len = TYPE_LENGTH (value_type (args[argnum])); val = (char *) value_contents (args[argnum]); @@ -1662,7 +1662,7 @@ cris_store_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { @@ -1833,7 +1833,7 @@ cris_extract_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { diff --git a/gdb/d-lang.h b/gdb/d-lang.h index f93405a..84b149f 100644 --- a/gdb/d-lang.h +++ b/gdb/d-lang.h @@ -25,7 +25,7 @@ extern char *d_demangle (const char *mangled, int options); extern void d_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c index 3a8d11d..5d066e7 100644 --- a/gdb/d-valprint.c +++ b/gdb/d-valprint.c @@ -29,7 +29,7 @@ static int dynamic_array_type (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) @@ -71,9 +71,9 @@ dynamic_array_type (struct type *type, const gdb_byte *valaddr, /* Implements the la_val_print routine for language D. */ void -d_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, - const struct value *val, +d_val_print (struct type *type, const gdb_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) { int ret; diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi index 6827ed8..6370d92 100644 --- a/gdb/doc/observer.texi +++ b/gdb/doc/observer.texi @@ -216,7 +216,7 @@ The inferior @var{inf} has been removed from the list of inferiors. This method is called immediately before freeing @var{inf}. @end deftypefun -@deftypefun void memory_changed (CORE_ADDR @var{addr}, int @var{len}, const bfd_byte *@var{data}) +@deftypefun void memory_changed (CORE_ADDR @var{addr}, LONGEST @var{len}, const bfd_byte *@var{data}) Bytes from @var{data} to @var{data} + @var{len} have been written to the current inferior at @var{addr}. @end deftypefun diff --git a/gdb/doublest.c b/gdb/doublest.c index c8c9e05..e67158e 100644 --- a/gdb/doublest.c +++ b/gdb/doublest.c @@ -770,7 +770,7 @@ floatformat_from_doublest (const struct floatformat *fmt, but not passed on by GDB. This should be fixed. */ static const struct floatformat * -floatformat_from_length (struct gdbarch *gdbarch, int len) +floatformat_from_length (struct gdbarch *gdbarch, LONGEST len) { const struct floatformat *format; @@ -798,8 +798,8 @@ floatformat_from_length (struct gdbarch *gdbarch, int len) else format = NULL; if (format == NULL) - error (_("Unrecognized %d-bit floating-point type."), - len * TARGET_CHAR_BIT); + error (_("Unrecognized %s-bit floating-point type."), + plongest (len * TARGET_CHAR_BIT)); return format; } diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 54dc5ad..5fa9075 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -1481,19 +1481,19 @@ insert_bits (unsigned int datum, BITS_BIG_ENDIAN is taken directly from gdbarch. */ static void -copy_bitwise (gdb_byte *dest, unsigned int dest_offset_bits, - const gdb_byte *source, unsigned int source_offset_bits, - unsigned int bit_count, +copy_bitwise (gdb_byte *dest, ULONGEST dest_offset_bits, + const gdb_byte *source, ULONGEST source_offset, + ULONGEST bit_count, int bits_big_endian) { - unsigned int dest_avail; + unsigned int dest_avail, source_offset_bits; int datum; /* Reduce everything to byte-size pieces. */ dest += dest_offset_bits / 8; dest_offset_bits %= 8; - source += source_offset_bits / 8; - source_offset_bits %= 8; + source += source_offset / 8; + source_offset_bits = source_offset % 8; dest_avail = 8 - dest_offset_bits % 8; @@ -1531,13 +1531,13 @@ static void read_pieced_value (struct value *v) { int i; - long offset = 0; + LONGEST offset = 0; ULONGEST bits_to_skip; gdb_byte *contents; struct piece_closure *c = (struct piece_closure *) value_computed_closure (v); struct frame_info *frame = frame_find_by_id (VALUE_FRAME_ID (v)); - size_t type_len; + ULONGEST type_len; size_t buffer_size = 0; char *buffer = NULL; struct cleanup *cleanup; @@ -1564,8 +1564,8 @@ read_pieced_value (struct value *v) for (i = 0; i < c->n_pieces && offset < type_len; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size, this_size_bits; - long dest_offset_bits, source_offset_bits, source_offset; + ULONGEST this_size, this_size_bits; + LONGEST dest_offset_bits, source_offset_bits, source_offset; const gdb_byte *intermediate_buffer; /* Compute size, source, and destination offsets for copying, in @@ -1720,7 +1720,7 @@ write_pieced_value (struct value *to, struct value *from) struct piece_closure *c = (struct piece_closure *) value_computed_closure (to); struct frame_info *frame = frame_find_by_id (VALUE_FRAME_ID (to)); - size_t type_len; + ULONGEST type_len; size_t buffer_size = 0; char *buffer = NULL; struct cleanup *cleanup; @@ -1748,8 +1748,8 @@ write_pieced_value (struct value *to, struct value *from) for (i = 0; i < c->n_pieces && offset < type_len; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; - size_t this_size_bits, this_size; - long dest_offset_bits, source_offset_bits, dest_offset, source_offset; + ULONGEST this_size_bits, this_size; + LONGEST dest_offset_bits, source_offset_bits, dest_offset, source_offset; int need_bitwise; const gdb_byte *source_buffer; @@ -1878,8 +1878,8 @@ write_pieced_value (struct value *to, struct value *from) implicit pointer. */ static int -check_pieced_value_bits (const struct value *value, int bit_offset, - int bit_length, +check_pieced_value_bits (const struct value *value, LONGEST bit_offset, + LONGEST bit_length, enum dwarf_value_location check_for) { struct piece_closure *c @@ -1933,8 +1933,8 @@ check_pieced_value_bits (const struct value *value, int bit_offset, } static int -check_pieced_value_validity (const struct value *value, int bit_offset, - int bit_length) +check_pieced_value_validity (const struct value *value, LONGEST bit_offset, + LONGEST bit_length) { return check_pieced_value_bits (value, bit_offset, bit_length, DWARF_VALUE_MEMORY); @@ -1952,8 +1952,8 @@ check_pieced_value_invalid (const struct value *value) a synthetic pointer. */ static int -check_pieced_synthetic_pointer (const struct value *value, int bit_offset, - int bit_length) +check_pieced_synthetic_pointer (const struct value *value, LONGEST bit_offset, + LONGEST bit_length) { return check_pieced_value_bits (value, bit_offset, bit_length, DWARF_VALUE_IMPLICIT_POINTER); @@ -1978,9 +1978,10 @@ indirect_pieced_value (struct value *value) struct type *type; struct frame_info *frame; struct dwarf2_locexpr_baton baton; - int i, bit_offset, bit_length; + int i; + LONGEST bit_length; struct dwarf_expr_piece *piece = NULL; - LONGEST byte_offset; + LONGEST byte_offset, bit_offset; type = check_typedef (value_type (value)); if (TYPE_CODE (type) != TYPE_CODE_PTR) @@ -2227,7 +2228,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, struct value *value = dwarf_expr_fetch (ctx, 0); gdb_byte *contents; const gdb_byte *val_bytes; - size_t n = TYPE_LENGTH (value_type (value)); + ULONGEST n = TYPE_LENGTH (value_type (value)); if (byte_offset + TYPE_LENGTH (type) > n) invalid_synthetic_pointer (); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 7ac125a..4767519 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -834,7 +834,7 @@ struct die_info /* Blocks are a bunch of untyped bytes. */ struct dwarf_block { - unsigned int size; + size_t size; /* Valid only if SIZE is not zero. */ gdb_byte *data; @@ -971,12 +971,12 @@ dwarf2_complex_location_expr_complaint (void) } static void -dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2, - int arg3) +dwarf2_const_value_length_mismatch_complaint (const char *arg1, LONGEST arg2, + LONGEST arg3) { complaint (&symfile_complaints, - _("const value length mismatch for '%s', got %d, expected %d"), - arg1, arg2, arg3); + _("const value length mismatch for '%s', got %s, expected %s"), + arg1, plongest (arg2), plongest (arg3)); } static void @@ -8542,7 +8542,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die, object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ - int anonymous_size; + LONGEST anonymous_size; int bit_offset = DW_UNSND (attr); attr = dwarf2_attr (die, DW_AT_byte_size, cu); @@ -14730,12 +14730,12 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) case DW_FORM_block4: case DW_FORM_block: case DW_FORM_block1: - fprintf_unfiltered (f, "block: size %d", - DW_BLOCK (&die->attrs[i])->size); + fprintf_unfiltered (f, "block: size %s", + pulongest (DW_BLOCK (&die->attrs[i])->size)); break; case DW_FORM_exprloc: - fprintf_unfiltered (f, "expression: size %u", - DW_BLOCK (&die->attrs[i])->size); + fprintf_unfiltered (f, "expression: size %s", + pulongest (DW_BLOCK (&die->attrs[i])->size)); break; case DW_FORM_ref_addr: fprintf_unfiltered (f, "ref address: "); diff --git a/gdb/eval.c b/gdb/eval.c index 7f1dfac..c09d38f 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -319,7 +319,8 @@ evaluate_struct_tuple (struct value *struct_val, int pc = *pos; struct value *val = NULL; int nlabels = 0; - int bitpos, bitsize; + int bitsize; + LONGEST bitpos; bfd_byte *addr; /* Skip past the labels, and count them. */ @@ -462,7 +463,7 @@ init_array_element (struct value *array, struct value *element, enum noside noside, LONGEST low_bound, LONGEST high_bound) { LONGEST index; - int element_size = TYPE_LENGTH (value_type (element)); + LONGEST element_size = TYPE_LENGTH (value_type (element)); if (exp->elts[*pos].opcode == BINOP_COMMA) { @@ -625,11 +626,11 @@ binop_promote (const struct language_defn *language, struct gdbarch *gdbarch, /* FIXME: Also mixed integral/booleans, with result an integer. */ { const struct builtin_type *builtin = builtin_type (gdbarch); - unsigned int promoted_len1 = TYPE_LENGTH (type1); - unsigned int promoted_len2 = TYPE_LENGTH (type2); + ULONGEST promoted_len1 = TYPE_LENGTH (type1); + ULONGEST promoted_len2 = TYPE_LENGTH (type2); int is_unsigned1 = TYPE_UNSIGNED (type1); int is_unsigned2 = TYPE_UNSIGNED (type2); - unsigned int result_len; + ULONGEST result_len; int unsigned_operation; /* Determine type length and signedness after promotion for @@ -796,7 +797,7 @@ evaluate_subexp_standard (struct type *expect_type, int lower; int code; int ix; - long mem_offset; + LONGEST mem_offset; struct type **arg_types; int save_pos1; struct symbol *function = NULL; @@ -985,7 +986,7 @@ evaluate_subexp_standard (struct type *expect_type, struct type *range_type = TYPE_INDEX_TYPE (type); struct type *element_type = TYPE_TARGET_TYPE (type); struct value *array = allocate_value (expect_type); - int element_size = TYPE_LENGTH (check_typedef (element_type)); + LONGEST element_size = TYPE_LENGTH (check_typedef (element_type)); LONGEST low_bound, high_bound, index; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) @@ -1993,7 +1994,8 @@ evaluate_subexp_standard (struct type *expect_type, { struct type *type = value_type (arg1); struct type *real_type; - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct value_print_options opts; get_user_print_options (&opts); diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 7492149..1522590 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -138,7 +138,7 @@ f_printchar (int c, struct type *type, struct ui_file *stream) static void f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, - unsigned int length, const char *encoding, int force_ellipses, + ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { const char *type_encoding = f_get_encoding (type); diff --git a/gdb/f-lang.h b/gdb/f-lang.h index 4aae3c5..d20a46f 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h @@ -28,7 +28,7 @@ extern void f_error (char *); /* Defined in f-exp.y */ extern void f_print_type (struct type *, const char *, struct ui_file *, int, int); -extern void f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern void f_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 8b84b5a..7ba0626 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -46,7 +46,7 @@ static void f77_create_arrayprint_offset_tbl (struct type *, struct ui_file *); static void f77_get_dynamic_length_of_aggregate (struct type *); -int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; +LONGEST f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; /* Array which holds offsets to be applied to get a row's elements for a given array. Array also holds the size of each subarray. */ @@ -124,7 +124,7 @@ static void f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) { struct type *tmp_type; - int eltlen; + LONGEST eltlen; int ndimen = 1; int upper, lower; @@ -164,7 +164,7 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) static void f77_print_array_1 (int nss, int ndimensions, struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -215,7 +215,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, static void f77_print_array (struct type *type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -258,8 +258,9 @@ static const struct generic_val_print_decorations f_decorations = function; they are identical. */ void -f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, +f_val_print (struct type *type, const gdb_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) { @@ -381,7 +382,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, fprintf_filtered (stream, "( "); for (index = 0; index < TYPE_NFIELDS (type); index++) { - int offset = TYPE_FIELD_BITPOS (type, index) / 8; + LONGEST offset = TYPE_FIELD_BITPOS (type, index) / 8; val_print (TYPE_FIELD_TYPE (type, index), valaddr, embedded_offset + offset, diff --git a/gdb/findcmd.c b/gdb/findcmd.c index 3fce269..2ee44aa 100644 --- a/gdb/findcmd.c +++ b/gdb/findcmd.c @@ -169,7 +169,7 @@ parse_find_args (char *args, ULONGEST *max_countp, while (*s != '\0') { LONGEST x; - int val_bytes; + LONGEST val_bytes; while (isspace (*s)) ++s; diff --git a/gdb/findvar.c b/gdb/findvar.c index 66bcebe..c269ab5 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -446,7 +446,7 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) struct value *v; struct type *type = SYMBOL_TYPE (var); CORE_ADDR addr; - int len; + LONGEST len; /* Call check_typedef on our type to make sure that, if TYPE is a TYPE_CODE_TYPEDEF, its length is set to the length of the target type @@ -653,7 +653,7 @@ default_value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); struct value *value = allocate_value (type); VALUE_LVAL (value) = lval_register; @@ -683,10 +683,10 @@ void read_frame_register_value (struct value *value, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); - int offset = 0; - int reg_offset = value_offset (value); + LONGEST offset = 0; + LONGEST reg_offset = value_offset (value); int regnum = VALUE_REGNUM (value); - int len = TYPE_LENGTH (check_typedef (value_type (value))); + LONGEST len = TYPE_LENGTH (check_typedef (value_type (value))); gdb_assert (VALUE_LVAL (value) == lval_register); @@ -701,7 +701,7 @@ read_frame_register_value (struct value *value, struct frame_info *frame) while (len > 0) { struct value *regval = get_frame_register_value (frame, regnum); - int reg_len = TYPE_LENGTH (value_type (regval)) - reg_offset; + LONGEST reg_len = TYPE_LENGTH (value_type (regval)) - reg_offset; /* If the register length is larger than the number of bytes remaining to copy, then only copy the appropriate bytes. */ diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 9262b10..0873da6 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -1120,7 +1120,7 @@ frv_extract_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { @@ -1139,7 +1139,7 @@ frv_extract_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Illegal return value length: %d"), len); + _("Illegal return value length: %s"), plongest (len)); } static CORE_ADDR @@ -1210,7 +1210,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function, char valbuf[4]; struct value *arg; struct type *arg_type; - int len; + LONGEST len; enum type_code typecode; CORE_ADDR regval; int stack_space; @@ -1328,7 +1328,7 @@ static void frv_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { @@ -1344,7 +1344,8 @@ frv_store_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Don't know how to return a %d-byte value."), len); + _("Don't know how to return a %s-byte value."), + plongest (len)); } static enum return_value_convention diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index e3db1ed..ba8fc1c 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1898,7 +1898,7 @@ allocate_gnat_aux_type (struct type *type) where init_type is called with a NULL value for NAME). */ struct type * -init_type (enum type_code code, int length, int flags, +init_type (enum type_code code, LONGEST length, int flags, char *name, struct objfile *objfile) { struct type *type; @@ -2130,8 +2130,8 @@ is_public_ancestor (struct type *base, struct type *dclass) static int is_unique_ancestor_worker (struct type *base, struct type *dclass, - int *offset, - const gdb_byte *valaddr, int embedded_offset, + LONGEST *offset, + const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct value *val) { int i, count = 0; @@ -2142,7 +2142,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) { struct type *iter; - int this_offset; + LONGEST this_offset; iter = check_typedef (TYPE_BASECLASS (dclass, i)); @@ -2183,7 +2183,7 @@ is_unique_ancestor_worker (struct type *base, struct type *dclass, int is_unique_ancestor (struct type *base, struct value *val) { - int offset = -1; + LONGEST offset = -1; return is_unique_ancestor_worker (base, value_type (val), &offset, value_contents_for_printing (val), @@ -3076,7 +3076,7 @@ recursive_dump_type (struct type *type, int spaces) break; } puts_filtered ("\n"); - printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type)); + printfi_filtered (spaces, "length %s\n", pulongest (TYPE_LENGTH (type))); if (TYPE_OBJFILE_OWNED (type)) { printfi_filtered (spaces, "objfile "); @@ -3196,8 +3196,8 @@ recursive_dump_type (struct type *type, int spaces) idx, plongest (TYPE_FIELD_ENUMVAL (type, idx))); else printfi_filtered (spaces + 2, - "[%d] bitpos %d bitsize %d type ", - idx, TYPE_FIELD_BITPOS (type, idx), + "[%d] bitpos %s bitsize %d type ", + idx, plongest (TYPE_FIELD_BITPOS (type, idx)), TYPE_FIELD_BITSIZE (type, idx)); gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); printf_filtered (" name '%s' (", @@ -3479,7 +3479,7 @@ copy_type (const struct type *type) CODE, LENGTH, and NAME fields. */ struct type * arch_type (struct gdbarch *gdbarch, - enum type_code code, int length, char *name) + enum type_code code, LONGEST length, char *name) { struct type *type; diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index cf7d398..8e9ddae 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -515,7 +515,7 @@ struct main_type gdbarch_bits_big_endian=0 targets, it is the bit offset to the LSB. */ - int bitpos; + LONGEST bitpos; /* Enum value. */ LONGEST enumval; @@ -685,7 +685,7 @@ struct type HOST_CHAR_BIT. However, this would still fail to address machines based on a ternary or decimal representation. */ - unsigned length; + ULONGEST length; /* Core type, shared by a group of qualified types. */ struct main_type *main_type; @@ -1422,11 +1422,12 @@ extern struct type *alloc_type_copy (const struct type *); extern struct gdbarch *get_type_arch (const struct type *); /* Helper function to construct objfile-owned types. */ -extern struct type *init_type (enum type_code, int, int, char *, +extern struct type *init_type (enum type_code, LONGEST, int, char *, struct objfile *); /* Helper functions to construct architecture-owned types. */ -extern struct type *arch_type (struct gdbarch *, enum type_code, int, char *); +extern struct type *arch_type (struct gdbarch *, enum type_code, LONGEST, + char *); extern struct type *arch_integer_type (struct gdbarch *, int, int, char *); extern struct type *arch_character_type (struct gdbarch *, int, int, char *); extern struct type *arch_boolean_type (struct gdbarch *, int, int, char *); diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index e635e8f..8697c87 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -86,7 +86,7 @@ gnuv2_is_operator_name (const char *name) TYPE is the type in which F is located. */ static struct value * gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, - struct type * type, int offset) + struct type *type, LONGEST offset) { struct value *arg1 = *arg1p; struct type *type1 = check_typedef (value_type (arg1)); @@ -187,7 +187,8 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, static struct type * -gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc) +gnuv2_value_rtti_type (struct value *v, int *full, LONGEST *top, + int *using_enc) { struct type *known_type; struct type *rtti_type; @@ -342,9 +343,9 @@ vb_match (struct type *type, int index, struct type *basetype) target). The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. */ -static int +static LONGEST gnuv2_baseclass_offset (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, + const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { struct type *basetype = TYPE_BASECLASS (type, index); @@ -362,8 +363,8 @@ gnuv2_baseclass_offset (struct type *type, int index, if (vb_match (type, i, basetype)) { struct type *field_type; - int field_offset; - int field_length; + LONGEST field_offset; + LONGEST field_length; CORE_ADDR addr; field_type = check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -387,7 +388,7 @@ gnuv2_baseclass_offset (struct type *type, int index, /* Don't go through baseclass_offset, as that wraps exceptions, thus, inner exceptions would be wrapped more than once. */ - int boffset = + LONGEST boffset = gnuv2_baseclass_offset (type, i, valaddr, embedded_offset, address, val); diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index 3a83e2d..e763f29 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -105,7 +105,7 @@ build_gdb_vtable_type (struct gdbarch *arch) { struct type *t; struct field *field_list, *field; - int offset; + LONGEST offset; struct type *void_ptr_type = builtin_type (arch)->builtin_data_ptr; @@ -181,7 +181,7 @@ vtable_ptrdiff_type (struct gdbarch *gdbarch) /* Return the offset from the start of the imaginary `struct gdb_gnu_v3_abi_vtable' object to the vtable's "address point" (i.e., where objects' virtual table pointers point). */ -static int +static LONGEST vtable_address_point_offset (struct gdbarch *gdbarch) { struct type *vtable_type = gdbarch_data (gdbarch, vtable_type_gdbarch_data); @@ -272,7 +272,7 @@ gnuv3_get_vtable (struct gdbarch *gdbarch, static struct type * gnuv3_rtti_type (struct value *value, - int *full_p, int *top_p, int *using_enc_p) + int *full_p, LONGEST *top_p, int *using_enc_p) { struct gdbarch *gdbarch; struct type *values_type = check_typedef (value_type (value)); @@ -384,7 +384,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gdbarch, struct value *container, static struct value * gnuv3_virtual_fn_field (struct value **value_p, struct fn_field *f, int j, - struct type *vfn_base, int offset) + struct type *vfn_base, LONGEST offset) { struct type *values_type = check_typedef (value_type (*value_p)); struct gdbarch *gdbarch; @@ -414,16 +414,16 @@ gnuv3_virtual_fn_field (struct value **value_p, -1 is returned on error. */ -static int +static LONGEST gnuv3_baseclass_offset (struct type *type, int index, - const bfd_byte *valaddr, int embedded_offset, + const bfd_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, const struct value *val) { struct gdbarch *gdbarch; struct type *ptr_type; struct value *vtable; struct value *vbase_array; - long int cur_base_offset, base_offset; + LONGEST cur_base_offset, base_offset; /* Determine architecture. */ gdbarch = get_type_arch (type); @@ -447,7 +447,7 @@ gnuv3_baseclass_offset (struct type *type, int index, cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch); if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0) error (_("Misaligned vbase offset.")); - cur_base_offset = cur_base_offset / ((int) TYPE_LENGTH (ptr_type)); + cur_base_offset = cur_base_offset / ((LONGEST) TYPE_LENGTH (ptr_type)); vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset); gdb_assert (vtable != NULL); @@ -491,7 +491,7 @@ gnuv3_find_method_in (struct type *domain, CORE_ADDR voffset, we're out of luck. */ for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) { - int pos; + LONGEST pos; struct type *basetype; if (BASETYPE_VIA_VIRTUAL (domain, i)) diff --git a/gdb/go-lang.h b/gdb/go-lang.h index 67b5d93..51a1f7a 100644 --- a/gdb/go-lang.h +++ b/gdb/go-lang.h @@ -80,7 +80,7 @@ extern void go_print_type (struct type *type, const char *varstring, /* Defined in go-valprint.c. */ extern void go_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c index de52e9b..99563c2 100644 --- a/gdb/go-valprint.c +++ b/gdb/go-valprint.c @@ -86,9 +86,9 @@ print_go_string (struct type *type, const gdb_byte *valaddr, /* Implements the la_val_print routine for language Go. */ void -go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, - const struct value *val, +go_val_print (struct type *type, const gdb_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) { CHECK_TYPEDEF (type); diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 237f4a3..b7d53ba 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -641,7 +641,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int struct_return, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int stack_alloc = 0, stack_offset = 0; + LONGEST stack_alloc = 0, stack_offset = 0; int wordsize = BINWORD (gdbarch); int reg = E_ARG0_REGNUM; int argument; @@ -667,11 +667,11 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argument = 0; argument < nargs; argument++) { struct type *type = value_type (args[argument]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); char *contents = (char *) value_contents (args[argument]); /* Pad the argument appropriately. */ - int padded_len = align_up (len, wordsize); + LONGEST padded_len = align_up (len, wordsize); gdb_byte *padded = alloca (padded_len); memset (padded, 0, padded_len); @@ -699,7 +699,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Heavens to Betsy --- it's really going in registers! Note that on the h8/300s, there are gaps between the registers in the register file. */ - int offset; + LONGEST offset; for (offset = 0; offset < padded_len; offset += wordsize) { diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 581ffc7..e66f17f 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -962,7 +962,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = value_type (arg); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); const bfd_byte *valbuf; bfd_byte fptrbuf[8]; int regnum; @@ -1157,7 +1157,7 @@ hppa64_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regnum, offset; if (len > 16) diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c index c353154..a57fe2b 100644 --- a/gdb/i386-darwin-tdep.c +++ b/gdb/i386-darwin-tdep.c @@ -119,7 +119,7 @@ i386_m128_p (struct type *type) /* Return the alignment for TYPE when passed as an argument. */ -static int +static LONGEST i386_darwin_arg_type_alignment (struct type *type) { type = check_typedef (type); @@ -139,7 +139,7 @@ i386_darwin_arg_type_alignment (struct type *type) || TYPE_CODE (type) == TYPE_CODE_UNION) { int i; - int res = 4; + LONGEST res = 4; for (i = 0; i < TYPE_NFIELDS (type); i++) res = max (res, i386_darwin_arg_type_alignment (TYPE_FIELD_TYPE (type, i))); @@ -166,7 +166,7 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (write_pass = 0; write_pass < 2; write_pass++) { - int args_space = 0; + LONGEST args_space = 0; int num_m128 = 0; if (struct_return) @@ -196,8 +196,8 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else { - int len = TYPE_LENGTH (arg_type); - int align = i386_darwin_arg_type_alignment (arg_type); + LONGEST len = TYPE_LENGTH (arg_type); + LONGEST align = i386_darwin_arg_type_alignment (arg_type); args_space = align_up (args_space, align); if (write_pass) diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c index 753de67..4cf8273 100644 --- a/gdb/i386-nat.c +++ b/gdb/i386-nat.c @@ -293,7 +293,7 @@ static int i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state, valid value, bombs through internal_error. */ static int i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, i386_wp_op_t what, - CORE_ADDR addr, int len, + CORE_ADDR addr, LONGEST len, enum target_hw_bp_type type); /* Implementation. */ @@ -316,17 +316,17 @@ i386_cleanup_dregs (void) static void i386_show_dr (struct i386_debug_reg_state *state, const char *func, CORE_ADDR addr, - int len, enum target_hw_bp_type type) + LONGEST len, enum target_hw_bp_type type) { int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; int i; puts_unfiltered (func); if (addr || len) - printf_unfiltered (" (addr=%lx, len=%d, type=%s)", + printf_unfiltered (" (addr=%lx, len=%s, type=%s)", /* This code is for ia32, so casting CORE_ADDR to unsigned long should be okay. */ - (unsigned long)addr, len, + (unsigned long)addr, plongest (len), type == hw_write ? "data-write" : (type == hw_read ? "data-read" : (type == hw_access ? "data-read/write" @@ -505,8 +505,8 @@ i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state, static int i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, - i386_wp_op_t what, CORE_ADDR addr, int len, - enum target_hw_bp_type type) + i386_wp_op_t what, CORE_ADDR addr, + LONGEST len, enum target_hw_bp_type type) { int retval = 0; int max_wp_len = TARGET_HAS_DR_LEN_8 ? 8 : 4; @@ -592,7 +592,7 @@ i386_update_inferior_debug_regs (struct i386_debug_reg_state *new_state) of the type TYPE. Return 0 on success, -1 on failure. */ static int -i386_insert_watchpoint (CORE_ADDR addr, int len, int type, +i386_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct i386_debug_reg_state *state = i386_debug_reg_state (); @@ -629,7 +629,7 @@ i386_insert_watchpoint (CORE_ADDR addr, int len, int type, address ADDR, whose length is LEN bytes, and for accesses of the type TYPE. Return 0 on success, -1 on failure. */ static int -i386_remove_watchpoint (CORE_ADDR addr, int len, int type, +i386_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct i386_debug_reg_state *state = i386_debug_reg_state (); @@ -663,7 +663,7 @@ i386_remove_watchpoint (CORE_ADDR addr, int len, int type, address ADDR and whose length is LEN bytes. */ static int -i386_region_ok_for_watchpoint (CORE_ADDR addr, int len) +i386_region_ok_for_watchpoint (CORE_ADDR addr, LONGEST len) { struct i386_debug_reg_state *state = i386_debug_reg_state (); int nregs; diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index ce4c8a4..3d3839f 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -2342,7 +2342,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte buf[4]; int i; int write_pass; - int args_space = 0; + LONGEST args_space = 0; /* Determine the total space required for arguments and struct return address in a first pass (allowing for 16-byte-aligned @@ -2350,7 +2350,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (write_pass = 0; write_pass < 2; write_pass++) { - int args_space_used = 0; + LONGEST args_space_used = 0; if (struct_return) { @@ -2367,7 +2367,7 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < nargs; i++) { - int len = TYPE_LENGTH (value_enclosing_type (args[i])); + LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i])); if (write_pass) { @@ -2443,7 +2443,7 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, gdb_byte *valbuf) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); gdb_byte buf[I386_MAX_REGISTER_SIZE]; if (TYPE_CODE (type) == TYPE_CODE_FLT) @@ -2481,8 +2481,8 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type, } else internal_error (__FILE__, __LINE__, - _("Cannot extract return value of %d bytes long."), - len); + _("Cannot extract return value of %s bytes long."), + plongest (len)); } } @@ -2494,7 +2494,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_FLT) { @@ -2546,7 +2546,8 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type, } else internal_error (__FILE__, __LINE__, - _("Cannot store return value of %d bytes long."), len); + _("Cannot store return value of %s bytes long."), + plongest (len)); } } \f diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index 237f2c7..44f5431 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -542,7 +542,7 @@ is_power_of_2 (int val) } static int -ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +ia64_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { struct lwp_info *lp; @@ -596,7 +596,7 @@ ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, } static int -ia64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type, +ia64_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int idx; diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index a7a802a..5390c12 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -3263,7 +3263,7 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache, int offset = 0; int regnum = IA64_GR8_REGNUM; int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM)); - int n = TYPE_LENGTH (type) / reglen; + LONGEST n = TYPE_LENGTH (type) / reglen; int m = TYPE_LENGTH (type) % reglen; while (n-- > 0) @@ -3313,7 +3313,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache, int offset = 0; int regnum = IA64_GR8_REGNUM; int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM)); - int n = TYPE_LENGTH (type) / reglen; + LONGEST n = TYPE_LENGTH (type) / reglen; int m = TYPE_LENGTH (type) % reglen; while (n-- > 0) @@ -3719,8 +3719,10 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argno; struct value *arg; struct type *type; - int len, argoffset; - int nslots, rseslots, memslots, slotnum, nfuncargs; + LONGEST argoffset; + LONGEST len; + int rseslots, slotnum, nfuncargs; + LONGEST nslots, memslots; int floatreg; ULONGEST bsp; CORE_ADDR funcdescaddr, pc, global_pointer; diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c index 2c620d5..a9a40bb 100644 --- a/gdb/inf-ttrace.c +++ b/gdb/inf-ttrace.c @@ -313,7 +313,7 @@ inf_ttrace_disable_page_protections (pid_t pid) type TYPE. */ static int -inf_ttrace_insert_watchpoint (CORE_ADDR addr, int len, int type, +inf_ttrace_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { const int pagesize = inf_ttrace_page_dict.pagesize; @@ -337,7 +337,7 @@ inf_ttrace_insert_watchpoint (CORE_ADDR addr, int len, int type, type TYPE. */ static int -inf_ttrace_remove_watchpoint (CORE_ADDR addr, int len, int type, +inf_ttrace_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { const int pagesize = inf_ttrace_page_dict.pagesize; @@ -364,7 +364,7 @@ inf_ttrace_can_use_hw_breakpoint (int type, int len, int ot) } static int -inf_ttrace_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +inf_ttrace_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { return 1; } diff --git a/gdb/infcall.c b/gdb/infcall.c index 20a2c2b..0a22c08 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -682,7 +682,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) if (struct_return || hidden_first_param_p) { - int len = TYPE_LENGTH (values_type); + LONGEST len = TYPE_LENGTH (values_type); if (gdbarch_inner_than (gdbarch, 1, 2)) { diff --git a/gdb/infrun.c b/gdb/infrun.c index 95a3ae9..d6c7187 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -6666,7 +6666,7 @@ save_infcall_suspend_state (void) if (gdbarch_get_siginfo_type_p (gdbarch)) { struct type *type = gdbarch_get_siginfo_type (gdbarch); - size_t len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); struct cleanup *back_to; siginfo_data = xmalloc (len); @@ -6727,11 +6727,10 @@ restore_infcall_suspend_state (struct infcall_suspend_state *inf_state) if (inf_state->siginfo_gdbarch == gdbarch) { struct type *type = gdbarch_get_siginfo_type (gdbarch); - size_t len = TYPE_LENGTH (type); /* Errors ignored. */ target_write (¤t_target, TARGET_OBJECT_SIGNAL_INFO, NULL, - inf_state->siginfo_data, 0, len); + inf_state->siginfo_data, 0, TYPE_LENGTH (type)); } /* The inferior can be gone if the user types "print exit(0)" diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c index 6ecc671..2c646da 100644 --- a/gdb/iq2000-tdep.c +++ b/gdb/iq2000-tdep.c @@ -504,7 +504,7 @@ static void iq2000_store_return_value (struct type *type, struct regcache *regcache, const void *valbuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int regno = E_FN_RETURN_REGNUM; while (len > 0) @@ -550,7 +550,7 @@ iq2000_extract_return_value (struct type *type, struct regcache *regcache, returned in a register, and if larger than 8 bytes, it is returned in a stack location which is pointed to by the same register. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= (2 * 4)) { @@ -655,8 +655,9 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const bfd_byte *val; bfd_byte buf[4]; struct type *type; - int i, argreg, typelen, slacklen; - int stackspace = 0; + int i, argreg, slacklen; + LONGEST typelen; + LONGEST stackspace = 0; /* Used to copy struct arguments into the stack. */ CORE_ADDR struct_ptr; diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index a7cfb76..5ff69ca 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -439,7 +439,7 @@ java_link_class_type (struct gdbarch *gdbarch, for (i = TYPE_N_BASECLASSES (type); i < nfields; i++) { int accflags; - int boffset; + LONGEST boffset; if (fields == NULL) { @@ -888,7 +888,7 @@ java_printchar (int c, struct type *type, struct ui_file *stream) static void java_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, - unsigned int length, const char *encoding, int force_ellipses, + ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { const char *type_encoding = java_get_encoding (type); diff --git a/gdb/jv-lang.h b/gdb/jv-lang.h index 8ea9c3c..bf77ccf 100644 --- a/gdb/jv-lang.h +++ b/gdb/jv-lang.h @@ -42,8 +42,8 @@ struct builtin_java_type extern const struct builtin_java_type *builtin_java_type (struct gdbarch *); -extern void java_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, - struct ui_file *, int, +extern void java_val_print (struct type *, const gdb_byte *, LONGEST, + CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index d1274dd..42b85dc 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -266,7 +266,7 @@ java_value_print (struct value *val, struct ui_file *stream, static void java_print_value_fields (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -484,7 +484,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr, void java_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) diff --git a/gdb/language.c b/gdb/language.c index f0a8697..9ae020e 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -831,7 +831,7 @@ unk_lang_printchar (int c, struct type *type, struct ui_file *stream) static void unk_lang_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { @@ -849,7 +849,7 @@ unk_lang_print_type (struct type *type, const char *varstring, static void unk_lang_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) diff --git a/gdb/language.h b/gdb/language.h index 38c4830..86c5406 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -200,7 +200,7 @@ struct language_defn struct ui_file * stream); void (*la_printstr) (struct ui_file * stream, struct type *elttype, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *); @@ -242,7 +242,7 @@ struct language_defn void (*la_val_print) (struct type *type, const gdb_byte *contents, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index 57d73b5..a1306a9 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -261,7 +261,7 @@ lm32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); gdb_byte *contents; - int len; + LONGEST len; ULONGEST val; /* Promote small integer types to int. */ @@ -350,7 +350,7 @@ lm32_store_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index 8faa6c1..0c9d394 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -104,7 +104,7 @@ m2_printchar (int c, struct type *type, struct ui_file *stream) static void m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, - unsigned int length, const char *encoding, int force_ellipses, + ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { unsigned int i; diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h index fc6de34..9d65366 100644 --- a/gdb/m2-lang.h +++ b/gdb/m2-lang.h @@ -32,7 +32,7 @@ extern void m2_print_typedef (struct type *, struct symbol *, extern int m2_is_long_set (struct type *type); extern int m2_is_unbounded_array (struct type *type); -extern void m2_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern void m2_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index fb3d49c..09c21af 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -228,9 +228,12 @@ static void m2_array (struct type *type, struct ui_file *stream, m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1); } else - fprintf_filtered (stream, "%d", - (TYPE_LENGTH (type) - / TYPE_LENGTH (TYPE_TARGET_TYPE (type)))); + { + ULONGEST val = (TYPE_LENGTH (type) + / TYPE_LENGTH (TYPE_TARGET_TYPE (type))); + + fprintf_filtered (stream, "%s", pulongest (val)); + } } fprintf_filtered (stream, "] OF "); m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level); @@ -587,7 +590,8 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show, void m2_enum (struct type *type, struct ui_file *stream, int show, int level) { - int lastval, i, len; + LONGEST lastval; + int i, len; if (show < 0) { diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c index e92679f..dae0f0d 100644 --- a/gdb/m2-valprint.c +++ b/gdb/m2-valprint.c @@ -36,7 +36,7 @@ static int print_unpacked_pointer (struct type *type, struct ui_file *stream); static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -68,7 +68,7 @@ get_long_set_bounds (struct type *type, LONGEST *low, LONGEST *high) static void m2_print_long_set (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream) { int empty_set = 1; @@ -159,7 +159,7 @@ m2_print_long_set (struct type *type, const gdb_byte *valaddr, static void m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value_print_options *options) { @@ -263,22 +263,20 @@ print_variable_at_address (struct type *type, static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, int len) { - int eltlen; CHECK_TYPEDEF (type); if (TYPE_LENGTH (type) > 0) { - eltlen = TYPE_LENGTH (type); if (options->prettyprint_arrays) print_spaces_filtered (2 + 2 * recurse, stream); /* For an array of chars, print with string syntax. */ - if (eltlen == 1 && + if (TYPE_LENGTH (type) == 1 && ((TYPE_CODE (type) == TYPE_CODE_INT) || ((current_language->la_language == language_m2) && (TYPE_CODE (type) == TYPE_CODE_CHAR))) @@ -311,16 +309,16 @@ static const struct generic_val_print_decorations m2_decorations = function; they are identical. */ void -m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, - CORE_ADDR address, struct ui_file *stream, int recurse, +m2_val_print (struct type *type, const gdb_byte *valaddr, + LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) { struct gdbarch *gdbarch = get_type_arch (type); - unsigned int i = 0; /* Number of characters printed. */ - unsigned len; + ULONGEST i = 0; /* Number of characters printed. */ + ULONGEST len; struct type *elttype; - unsigned eltlen; CORE_ADDR addr; CHECK_TYPEDEF (type); @@ -330,12 +328,11 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0) { elttype = check_typedef (TYPE_TARGET_TYPE (type)); - eltlen = TYPE_LENGTH (elttype); - len = TYPE_LENGTH (type) / eltlen; + len = TYPE_LENGTH (type) / TYPE_LENGTH (elttype); if (options->prettyprint_arrays) print_spaces_filtered (2 + 2 * recurse, stream); /* For an array of chars, print with string syntax. */ - if (eltlen == 1 && + if (TYPE_LENGTH (elttype) == 1 && ((TYPE_CODE (elttype) == TYPE_CODE_INT) || ((current_language->la_language == language_m2) && (TYPE_CODE (elttype) == TYPE_CODE_CHAR))) @@ -345,7 +342,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, elements up to it. */ if (options->stop_print_at_null) { - unsigned int temp_len; + ULONGEST temp_len; /* Look for a NULL char. */ for (temp_len = 0; diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index 150b9de..4d39534 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -696,7 +696,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, CORE_ADDR regval; gdb_byte *val; gdb_byte valbuf[MAX_REGISTER_SIZE]; - int len; + LONGEST len; /* First force sp to a 4-byte alignment. */ sp = sp & ~3; @@ -790,7 +790,7 @@ m32r_extract_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); ULONGEST tmp; /* By using store_unsigned_integer we avoid having to do diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 79629ef..47600a2 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1174,7 +1174,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int first_stack_argnum; struct type *type; char *val; - int len; + LONGEST len; char buf[2]; first_stack_argnum = 0; @@ -1266,7 +1266,7 @@ static void m68hc11_store_return_value (struct type *type, struct regcache *regcache, const void *valbuf) { - int len; + LONGEST len; len = TYPE_LENGTH (type); diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index b1e2cd4..40215b4 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -292,7 +292,7 @@ static void m68k_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); gdb_byte buf[M68K_MAX_REGISTER_SIZE]; if (len <= 4) @@ -308,14 +308,14 @@ m68k_extract_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Cannot extract return value of %d bytes long."), len); + _("Cannot extract return value of %s bytes long."), + plongest (len)); } static void m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache, gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); gdb_byte buf[M68K_MAX_REGISTER_SIZE]; struct gdbarch *gdbarch = get_regcache_arch (regcache); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -326,7 +326,7 @@ m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache, regcache_raw_read (regcache, M68K_FP0_REGNUM, buf); convert_typed_floating (buf, fpreg_type, valbuf, type); } - else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4) + else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4) regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf); else m68k_extract_return_value (type, regcache, valbuf); @@ -338,7 +338,7 @@ static void m68k_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) regcache_raw_write_part (regcache, M68K_D0_REGNUM, 4 - len, len, valbuf); @@ -350,14 +350,14 @@ m68k_store_return_value (struct type *type, struct regcache *regcache, } else internal_error (__FILE__, __LINE__, - _("Cannot store return value of %d bytes long."), len); + _("Cannot store return value of %s bytes long."), + plongest (len)); } static void m68k_svr4_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); struct gdbarch *gdbarch = get_regcache_arch (regcache); struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -368,7 +368,7 @@ m68k_svr4_store_return_value (struct type *type, struct regcache *regcache, convert_typed_floating (valbuf, type, buf, fpreg_type); regcache_raw_write (regcache, M68K_FP0_REGNUM, buf); } - else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4) + else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4) { regcache_raw_write (regcache, M68K_A0_REGNUM, valbuf); regcache_raw_write (regcache, M68K_D0_REGNUM, valbuf); @@ -515,9 +515,9 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); - int len = TYPE_LENGTH (value_type); - int container_len = (len + 3) & ~3; - int offset; + LONGEST len = TYPE_LENGTH (value_type); + LONGEST container_len = (len + 3) & ~3; + LONGEST offset; /* Non-scalars bigger than 4 bytes are left aligned, others are right aligned. */ diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c index c4c3266..ec27ed7 100644 --- a/gdb/m88k-tdep.c +++ b/gdb/m88k-tdep.c @@ -259,14 +259,14 @@ m88k_store_arguments (struct regcache *regcache, int nargs, struct value **args, CORE_ADDR sp) { struct gdbarch *gdbarch = get_regcache_arch (regcache); - int num_register_words = 0; - int num_stack_words = 0; + LONGEST num_register_words = 0; + LONGEST num_stack_words = 0; int i; for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (m88k_integral_or_pointer_p (type) && len < 4) { @@ -387,7 +387,7 @@ m88k_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); gdb_byte buf[8]; if (!m88k_integral_or_pointer_p (type) && !m88k_floating_p (type)) diff --git a/gdb/memrange.c b/gdb/memrange.c index ed41b9a..a87bc85 100644 --- a/gdb/memrange.c +++ b/gdb/memrange.c @@ -21,8 +21,8 @@ #include "memrange.h" int -mem_ranges_overlap (CORE_ADDR start1, int len1, - CORE_ADDR start2, int len2) +mem_ranges_overlap (CORE_ADDR start1, LONGEST len1, + CORE_ADDR start2, LONGEST len2) { ULONGEST h, l; diff --git a/gdb/memrange.h b/gdb/memrange.h index 926af22..050a56f 100644 --- a/gdb/memrange.h +++ b/gdb/memrange.h @@ -30,7 +30,7 @@ struct mem_range CORE_ADDR start; /* Length of the range. */ - int length; + LONGEST length; }; typedef struct mem_range mem_range_s; @@ -40,8 +40,8 @@ DEF_VEC_O(mem_range_s); /* Returns true if the ranges defined by [start1, start1+len1) and [start2, start2+len2) overlap. */ -extern int mem_ranges_overlap (CORE_ADDR start1, int len1, - CORE_ADDR start2, int len2); +extern int mem_ranges_overlap (CORE_ADDR start1, LONGEST len1, + CORE_ADDR start2, LONGEST len2); /* Sort ranges by start address, then coalesce contiguous or overlapping ranges. */ diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 960500c..e50d8ba 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -2279,7 +2279,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv, for (i = 0; i < argc; i++) { - unsigned arg_len = TYPE_LENGTH (value_type (argv[i])); + ULONGEST arg_len = TYPE_LENGTH (value_type (argv[i])); if (arg_len > MEP_GPR_SIZE) { @@ -2337,7 +2337,7 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = 0; i < argc; i++) { - unsigned arg_size = TYPE_LENGTH (value_type (argv[i])); + ULONGEST arg_size = TYPE_LENGTH (value_type (argv[i])); ULONGEST value; /* Arguments that fit in a GPR get expanded to fill the GPR. */ diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index ca59213..df5a78a 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -590,7 +590,7 @@ static void microblaze_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); gdb_byte buf[8]; memset (buf, 0, sizeof(buf)); diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c index b9f7f1d..7467d11 100644 --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c @@ -938,7 +938,7 @@ try_one_watch (struct pt_watch_regs *regs, CORE_ADDR addr, the specified region can be covered by the watch registers. */ static int -mips_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +mips_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { struct pt_watch_regs dummy_regs; int i; @@ -1017,7 +1017,7 @@ populate_regs_from_watches (struct pt_watch_regs *regs) watch. Return zero on success. */ static int -mips_linux_insert_watchpoint (CORE_ADDR addr, int len, int type, +mips_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct pt_watch_regs regs; @@ -1067,7 +1067,7 @@ mips_linux_insert_watchpoint (CORE_ADDR addr, int len, int type, Return zero on success. */ static int -mips_linux_remove_watchpoint (CORE_ADDR addr, int len, int type, +mips_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int retval; diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 0439989..f4ebbe0 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -396,7 +396,7 @@ static void mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, int reg_num, int length, enum bfd_endian endian, gdb_byte *in, - const gdb_byte *out, int buf_offset) + const gdb_byte *out, LONGEST buf_offset) { int reg_offset = 0; @@ -419,8 +419,8 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, } if (mips_debug) fprintf_unfiltered (gdb_stderr, - "xfer $%d, reg offset %d, buf offset %d, length %d, ", - reg_num, reg_offset, buf_offset, length); + "xfer $%d, reg offset %d, buf offset %s, length %d, ", + reg_num, reg_offset, plongest (buf_offset), length); if (mips_debug && out != NULL) { int i; @@ -4295,13 +4295,13 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (arg_type); + LONGEST len = TYPE_LENGTH (arg_type); enum type_code typecode = TYPE_CODE (arg_type); if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_eabi_push_dummy_call: %d len=%d type=%d", - argnum + 1, len, (int) typecode); + "mips_eabi_push_dummy_call: %d len=%s type=%d", + argnum + 1, plongest (len), (int) typecode); /* Function pointer arguments to mips16 code need to be made into mips16 pointers. */ @@ -4586,7 +4586,7 @@ mips_eabi_return_value (struct gdbarch *gdbarch, struct value *function, static int mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, - int offset) + LONGEST offset) { int i; @@ -4601,7 +4601,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, for (i = 0; i < TYPE_NFIELDS (arg_type); i++) { - int pos; + LONGEST pos; struct type *field_type; /* We're only looking at normal fields. */ @@ -4994,11 +4994,11 @@ mips_n32n64_return_value (struct gdbarch *gdbarch, struct value *function, : MIPS_V0_REGNUM); field < TYPE_NFIELDS (type); field++, regnum += 2) { - int offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) - / TARGET_CHAR_BIT); + LONGEST offset = (FIELD_BITPOS (TYPE_FIELDS (type)[field]) + / TARGET_CHAR_BIT); if (mips_debug) - fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n", - offset); + fprintf_unfiltered (gdb_stderr, "Return float struct+%s\n", + plongest (offset)); if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) { /* A 16-byte long double field goes in two consecutive @@ -5099,7 +5099,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; - int len = 0; + LONGEST len = 0; int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); @@ -5125,13 +5125,12 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { struct type *arg_type = check_typedef (value_type (args[argnum])); - int arglen = TYPE_LENGTH (arg_type); /* Align to double-word if necessary. */ if (mips_type_needs_double_align (arg_type)) len = align_up (len, MIPS32_REGSIZE * 2); /* Allocate space on the stack. */ - len += align_up (arglen, MIPS32_REGSIZE); + len += align_up (TYPE_LENGTH (arg_type), MIPS32_REGSIZE); } sp -= align_up (len, 16); @@ -5164,13 +5163,13 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (arg_type); + LONGEST len = TYPE_LENGTH (arg_type); enum type_code typecode = TYPE_CODE (arg_type); if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o32_push_dummy_call: %d len=%d type=%d", - argnum + 1, len, (int) typecode); + "mips_o32_push_dummy_call: %d len=%s type=%d", + argnum + 1, plongest (len), (int) typecode); val = value_contents (arg); @@ -5628,8 +5627,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int argreg; int float_argreg; int argnum; - int len = 0; - int stack_offset = 0; + LONGEST len = 0; + LONGEST stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); @@ -5654,10 +5653,9 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (argnum = 0; argnum < nargs; argnum++) { struct type *arg_type = check_typedef (value_type (args[argnum])); - int arglen = TYPE_LENGTH (arg_type); /* Allocate space on the stack. */ - len += align_up (arglen, MIPS64_REGSIZE); + len += align_up (TYPE_LENGTH (arg_type), MIPS64_REGSIZE); } sp -= align_up (len, 16); @@ -5691,13 +5689,13 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (arg_type); + LONGEST len = TYPE_LENGTH (arg_type); enum type_code typecode = TYPE_CODE (arg_type); if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o64_push_dummy_call: %d len=%d type=%d", - argnum + 1, len, (int) typecode); + "mips_o64_push_dummy_call: %d len=%s type=%d", + argnum + 1, plongest (len), (int) typecode); val = value_contents (arg); diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index e292613..7de7aac 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -83,10 +83,11 @@ struct mn10300_prologue /* Compute the alignment required by a type. */ -static int +static LONGEST mn10300_type_align (struct type *type) { - int i, align = 1; + int i; + LONGEST align = 1; switch (TYPE_CODE (type)) { @@ -108,7 +109,7 @@ mn10300_type_align (struct type *type) case TYPE_CODE_UNION: for (i = 0; i < TYPE_NFIELDS (type); i++) { - int falign = mn10300_type_align (TYPE_FIELD_TYPE (type, i)); + LONGEST falign = mn10300_type_align (TYPE_FIELD_TYPE (type, i)); while (align < falign) align <<= 1; } @@ -1228,7 +1229,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); const int push_size = register_size (gdbarch, E_PC_REGNUM); int regs_used; - int len, arg_len; + LONGEST len, arg_len; int stack_offset = 0; int argnum; char *val, valbuf[MAX_REGISTER_SIZE]; diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c index 3e08d60..cb2c59b 100644 --- a/gdb/moxie-tdep.c +++ b/gdb/moxie-tdep.c @@ -124,7 +124,7 @@ moxie_store_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR regval; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); /* Things always get returned in RET1_REGNUM, RET2_REGNUM. */ regval = extract_unsigned_integer (valbuf, len > 4 ? 4 : len, byte_order); @@ -321,7 +321,7 @@ moxie_extract_return_value (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); ULONGEST tmp; /* By using store_unsigned_integer we avoid having to do diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c index ee4b6eb..e3622aa 100644 --- a/gdb/mt-tdep.c +++ b/gdb/mt-tdep.c @@ -783,9 +783,9 @@ mt_push_dummy_call (struct gdbarch *gdbarch, struct value *function, gdb_byte buf[MT_MAX_STRUCT_SIZE]; int argreg = MT_1ST_ARGREG; int split_param_len = 0; - int stack_dest = sp; + LONGEST stack_dest = sp; int slacklen; - int typelen; + LONGEST typelen; int i, j; /* First handle however many args we can fit into MT_1ST_ARGREG thru diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index b58f318..f3aaad1 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -69,10 +69,10 @@ static ptid_t do_attach (ptid_t ptid); static int procfs_can_use_hw_breakpoint (int, int, int); -static int procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type, +static int procfs_insert_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond); -static int procfs_remove_hw_watchpoint (CORE_ADDR addr, int len, int type, +static int procfs_remove_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond); static int procfs_stopped_by_watchpoint (void); @@ -1457,7 +1457,7 @@ _initialize_procfs (void) static int -procfs_hw_watchpoint (int addr, int len, int type) +procfs_hw_watchpoint (int addr, LONGEST len, int type) { procfs_break brk; @@ -1493,14 +1493,14 @@ procfs_can_use_hw_breakpoint (int type, int cnt, int othertype) } static int -procfs_remove_hw_watchpoint (CORE_ADDR addr, int len, int type, +procfs_remove_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { return procfs_hw_watchpoint (addr, -1, type); } static int -procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type, +procfs_insert_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { return procfs_hw_watchpoint (addr, len, type); diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 15bf792..f0462f8 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -347,7 +347,7 @@ objc_printchar (int c, struct type *type, struct ui_file *stream) static void objc_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index 54075a4..69833b5 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -80,11 +80,11 @@ builtin_opencl_type (struct gdbarch *gdbarch) static struct type * lookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code, - unsigned int el_length, unsigned int flag_unsigned, + ULONGEST el_length, unsigned int flag_unsigned, int n) { int i; - unsigned int length; + ULONGEST length; struct type *type = NULL; struct type **types = builtin_opencl_type (gdbarch); @@ -174,9 +174,9 @@ lval_func_read (struct value *v) struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); struct type *type = check_typedef (value_type (v)); struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); - int offset = value_offset (v); - int elsize = TYPE_LENGTH (eltype); - int n, i, j = 0; + LONGEST offset = value_offset (v); + LONGEST elsize = TYPE_LENGTH (eltype); + LONGEST n, i, j = 0; LONGEST lowb = 0; LONGEST highb = 0; @@ -203,9 +203,9 @@ lval_func_write (struct value *v, struct value *fromval) struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); struct type *type = check_typedef (value_type (v)); struct type *eltype = TYPE_TARGET_TYPE (check_typedef (value_type (c->val))); - int offset = value_offset (v); - int elsize = TYPE_LENGTH (eltype); - int n, i, j = 0; + LONGEST offset = value_offset (v); + LONGEST elsize = TYPE_LENGTH (eltype); + LONGEST n, i, j = 0; LONGEST lowb = 0; LONGEST highb = 0; @@ -243,17 +243,18 @@ lval_func_write (struct value *v, struct value *fromval) /* Return nonzero if all bits in V within OFFSET and LENGTH are valid. */ static int -lval_func_check_validity (const struct value *v, int offset, int length) +lval_func_check_validity (const struct value *v, LONGEST offset, + LONGEST length) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); /* Size of the target type in bits. */ - int elsize = - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; + LONGEST elsize = + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; int startrest = offset % elsize; - int start = offset / elsize; + LONGEST start = offset / elsize; int endrest = (offset + length) % elsize; - int end = (offset + length) / elsize; - int i; + LONGEST end = (offset + length) / elsize; + LONGEST i; if (endrest) end++; @@ -281,8 +282,8 @@ lval_func_check_any_valid (const struct value *v) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); /* Size of the target type in bits. */ - int elsize = - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; + LONGEST elsize = + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; int i; for (i = 0; i < c->n; i++) @@ -297,17 +298,17 @@ lval_func_check_any_valid (const struct value *v) static int lval_func_check_synthetic_pointer (const struct value *v, - int offset, int length) + LONGEST offset, LONGEST length) { struct lval_closure *c = (struct lval_closure *) value_computed_closure (v); /* Size of the target type in bits. */ - int elsize = - TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; + LONGEST elsize = + TYPE_LENGTH (TYPE_TARGET_TYPE (check_typedef (value_type (c->val)))) * 8; int startrest = offset % elsize; - int start = offset / elsize; + LONGEST start = offset / elsize; int endrest = (offset + length) % elsize; - int end = (offset + length) / elsize; - int i; + LONGEST end = (offset + length) / elsize; + LONGEST i; if (endrest) end++; diff --git a/gdb/p-lang.c b/gdb/p-lang.c index c59ba0b..b72f5c4 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -96,8 +96,8 @@ pascal_main_name (void) are not multiple of TARGET_CHAR_BIT then the results are wrong but this does not happen for Free Pascal nor for GPC. */ int -is_pascal_string_type (struct type *type,int *length_pos, - int *length_size, int *string_pos, +is_pascal_string_type (struct type *type, LONGEST *length_pos, + LONGEST *length_size, LONGEST *string_pos, struct type **char_type, const char **arrayname) { @@ -217,7 +217,7 @@ pascal_printchar (int c, struct type *type, struct ui_file *stream) void pascal_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, const struct value_print_options *options) { diff --git a/gdb/p-lang.h b/gdb/p-lang.h index b1e218c..b160f53 100644 --- a/gdb/p-lang.h +++ b/gdb/p-lang.h @@ -35,7 +35,7 @@ extern void pascal_print_type (struct type *, const char *, struct ui_file *, extern void pascal_print_typedef (struct type *, struct symbol *, struct ui_file *); -extern void pascal_val_print (struct type *, const gdb_byte *, int, +extern void pascal_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); @@ -49,13 +49,13 @@ extern void pascal_type_print_method_args (const char *, const char *, /* These are in p-lang.c: */ extern int - is_pascal_string_type (struct type *, int *, int *, int *, + is_pascal_string_type (struct type *, LONGEST *, LONGEST *, LONGEST *, struct type **, const char **); extern void pascal_printchar (int, struct type *, struct ui_file *); extern void pascal_printstr (struct ui_file *, struct type *, const gdb_byte *, - unsigned int, const char *, int, + ULONGEST, const char *, int, const struct value_print_options *); extern struct type **const (pascal_builtin_types[]); @@ -69,7 +69,7 @@ extern void pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int); extern void pascal_object_print_value_fields (struct type *, const gdb_byte *, - int, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index a00f5b3..828b0ce 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -442,7 +442,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, { int i; int len; - int lastval; + LONGEST lastval; enum { s_none, s_public, s_private, s_protected diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index b8434ed..6974ab4 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -58,7 +58,7 @@ static const struct generic_val_print_decorations p_decorations = void pascal_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) @@ -69,8 +69,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, unsigned len; LONGEST low_bound, high_bound; struct type *elttype; - unsigned eltlen; - int length_pos, length_size, string_pos; + ULONGEST eltlen; + LONGEST length_pos, string_pos; + LONGEST length_size; struct type *char_type; CORE_ADDR addr; int want_space = 0; @@ -477,7 +478,7 @@ static void pascal_object_print_static_field (struct value *, const struct value_print_options *); static void pascal_object_print_value (struct type *, const gdb_byte *, - int, + LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -536,7 +537,7 @@ pascal_object_is_vtbl_member (struct type *type) void pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -731,7 +732,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, static void pascal_object_print_value (struct type *type, const gdb_byte *valaddr, - int offset, + LONGEST offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -754,11 +755,11 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr, for (i = 0; i < n_baseclasses; i++) { - int boffset = 0; + LONGEST boffset = 0; struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); const char *basename = type_name_no_tag (baseclass); const gdb_byte *base_valaddr = NULL; - int thisoffset; + LONGEST thisoffset; volatile struct gdb_exception ex; int skip = 0; diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 45cdd73..f2dcbad 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -1930,7 +1930,7 @@ num_memory_accesses (struct value *v) of the constant. */ static int check_condition (CORE_ADDR watch_addr, struct expression *cond, - CORE_ADDR *data_value, int *len) + CORE_ADDR *data_value, LONGEST *len) { int pc = 1, num_accesses_left, num_accesses_right; struct value *left_val, *right_val, *left_chain, *right_chain; @@ -1997,7 +1997,7 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond, the condition expression, thus only triggering the watchpoint when it is true. */ static int -ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, +ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { CORE_ADDR data_value; @@ -2014,7 +2014,7 @@ ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, static void create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, - int len, int rw, struct expression *cond, + LONGEST len, int rw, struct expression *cond, int insert) { if (len == 1 @@ -2059,7 +2059,7 @@ create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, } static int -ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +ppc_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { struct lwp_info *lp; @@ -2127,7 +2127,7 @@ ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, } static int -ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw, +ppc_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { struct lwp_info *lp; diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index a221b70..bdbcfd3 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -100,9 +100,9 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Next available vector register for vector arguments. */ int vreg = 2; /* Arguments start above the "LR save word" and "Back chain". */ - int argoffset = 2 * tdep->wordsize; + LONGEST argoffset = 2 * tdep->wordsize; /* Structures start after the arguments. */ - int structoffset = argoffset + argspace; + LONGEST structoffset = argoffset + argspace; /* If the function is returning a `struct', then the first word (which will be passed in r3) is used for struct return @@ -121,7 +121,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[argno]; struct type *type = check_typedef (value_type (arg)); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); const bfd_byte *val = value_contents (arg); if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8 @@ -353,7 +353,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* OpenCL vectors shorter than 16 bytes are passed as if a series of independent scalars. */ struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); - int i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); + LONGEST i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); for (i = 0; i < nelt; i++) { @@ -841,11 +841,11 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, && opencl_abi) { struct type *eltype = check_typedef (TYPE_TARGET_TYPE (type)); - int i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); + LONGEST i, nelt = TYPE_LENGTH (type) / TYPE_LENGTH (eltype); for (i = 0; i < nelt; i++) { - int offset = i * TYPE_LENGTH (eltype); + LONGEST offset = i * TYPE_LENGTH (eltype); if (TYPE_CODE (eltype) == TYPE_CODE_FLT) { @@ -1592,7 +1592,7 @@ ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, register. Work around this by always writing the value to memory. Fortunately, doing this simplifies the code. */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len < tdep->wordsize) write_memory (gparam + tdep->wordsize - len, val, len); else @@ -1842,12 +1842,12 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, && TYPE_LENGTH (valtype) >= 16 && opencl_abi) { - int n_regs = TYPE_LENGTH (valtype) / 16; - int i; + LONGEST n_regs = TYPE_LENGTH (valtype) / 16; + LONGEST i; for (i = 0; i < n_regs; i++) { - int offset = i * 16; + LONGEST offset = i * 16; int regnum = tdep->ppc_vr0_regnum + 2 + i; if (writebuf != NULL) diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 030a4f2..4704777 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -296,7 +296,7 @@ print_formatted (struct value *val, int size, struct ui_file *stream) { struct type *type = check_typedef (value_type (val)); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (VALUE_LVAL (val) == lval_memory) next_address = value_address (val) + len; @@ -352,7 +352,7 @@ float_type_from_length (struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); const struct builtin_type *builtin = builtin_type (gdbarch); - unsigned int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); if (len == TYPE_LENGTH (builtin->builtin_float)) type = builtin->builtin_float; @@ -375,7 +375,7 @@ print_scalar_formatted (const void *valaddr, struct type *type, { struct gdbarch *gdbarch = get_type_arch (type); LONGEST val_long = 0; - unsigned int len = TYPE_LENGTH (type); + ULONGEST len = TYPE_LENGTH (type); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* String printing should go through val_print_scalar_formatted. */ diff --git a/gdb/procfs.c b/gdb/procfs.c index 774df2e..3286540 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -4815,7 +4815,7 @@ procfs_pid_to_str (struct target_ops *ops, ptid_t ptid) /* Insert a watchpoint. */ static int -procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag, +procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, LONGEST len, int rwflag, int after) { #ifndef UNIXWARE @@ -4937,7 +4937,7 @@ procfs_stopped_data_address (struct target_ops *targ, CORE_ADDR *addr) } static int -procfs_insert_watchpoint (CORE_ADDR addr, int len, int type, +procfs_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { if (!target_have_steppable_watchpoint @@ -4959,14 +4959,14 @@ procfs_insert_watchpoint (CORE_ADDR addr, int len, int type, } static int -procfs_remove_watchpoint (CORE_ADDR addr, int len, int type, +procfs_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { return procfs_set_watchpoint (inferior_ptid, addr, 0, 0, 0); } static int -procfs_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +procfs_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { /* The man page for proc(4) on Solaris 2.6 and up says that the system can support "thousands" of hardware watchpoints, but gives diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index 86d4f2c..1ceb23b 100644 --- a/gdb/python/py-prettyprint.c +++ b/gdb/python/py-prettyprint.c @@ -676,7 +676,7 @@ print_children (PyObject *printer, const char *hint, int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -824,7 +824,7 @@ gdbpy_default_visualizer (PyObject *self, PyObject *args) int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, diff --git a/gdb/python/python.h b/gdb/python/python.h index dd7066f..2a57409 100644 --- a/gdb/python/python.h +++ b/gdb/python/python.h @@ -31,7 +31,7 @@ void eval_python_from_control_command (struct command_line *); void source_python_script (FILE *file, const char *filename); int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, diff --git a/gdb/regcache.c b/gdb/regcache.c index c716280..12ed8fa 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -902,7 +902,7 @@ typedef void (regcache_write_ftype) (struct regcache *regcache, int regnum, static enum register_status regcache_xfer_part (struct regcache *regcache, int regnum, - int offset, int len, void *in, const void *out, + LONGEST offset, int len, void *in, const void *out, enum register_status (*read) (struct regcache *regcache, int regnum, gdb_byte *buf), @@ -968,7 +968,7 @@ regcache_raw_write_part (struct regcache *regcache, int regnum, enum register_status regcache_cooked_read_part (struct regcache *regcache, int regnum, - int offset, int len, gdb_byte *buf) + LONGEST offset, int len, gdb_byte *buf) { struct regcache_descr *descr = regcache->descr; @@ -979,7 +979,7 @@ regcache_cooked_read_part (struct regcache *regcache, int regnum, void regcache_cooked_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf) + LONGEST offset, int len, const gdb_byte *buf) { struct regcache_descr *descr = regcache->descr; diff --git a/gdb/regcache.h b/gdb/regcache.h index 93b4499..81ccda6 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -129,10 +129,10 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache, write style operations. */ enum register_status regcache_cooked_read_part (struct regcache *regcache, - int regnum, int offset, + int regnum, LONGEST offset, int len, gdb_byte *buf); void regcache_cooked_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf); + LONGEST offset, int len, const gdb_byte *buf); /* Special routines to read/write the PC. */ diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index 47f4405..0209ed8 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -1416,14 +1416,14 @@ m32r_can_use_hw_watchpoint (int type, int cnt, int othertype) watchpoint. */ static int -m32r_insert_watchpoint (CORE_ADDR addr, int len, int type, +m32r_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int i; if (remote_debug) - fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%d,%d)\n", - paddress (target_gdbarch, addr), len, type); + fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%s,%d)\n", + paddress (target_gdbarch, addr), plongest (len), type); for (i = 0; i < MAX_ACCESS_BREAKS; i++) { @@ -1441,14 +1441,14 @@ m32r_insert_watchpoint (CORE_ADDR addr, int len, int type, } static int -m32r_remove_watchpoint (CORE_ADDR addr, int len, int type, +m32r_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int i; if (remote_debug) - fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%d,%d)\n", - paddress (target_gdbarch, addr), len, type); + fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%s,%d)\n", + paddress (target_gdbarch, addr), plongest (len), type); for (i = 0; i < MAX_ACCESS_BREAKS; i++) { diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index babbf19..a712b86 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -133,9 +133,10 @@ static void mips_load (char *file, int from_tty); static int mips_make_srec (char *buffer, int type, CORE_ADDR memaddr, unsigned char *myaddr, int len); -static int mips_set_breakpoint (CORE_ADDR addr, int len, enum break_type type); +static int mips_set_breakpoint (CORE_ADDR addr, LONGEST len, + enum break_type type); -static int mips_clear_breakpoint (CORE_ADDR addr, int len, +static int mips_clear_breakpoint (CORE_ADDR addr, LONGEST len, enum break_type type); static int mips_common_breakpoint (int set, CORE_ADDR addr, int len, @@ -402,7 +403,7 @@ struct lsi_breakpoint_info { enum break_type type; /* type of breakpoint */ CORE_ADDR addr; /* address of breakpoint */ - int len; /* length of region being watched */ + LONGEST len; /* length of region being watched */ unsigned long value; /* value to watch */ } lsi_breakpoints[MAX_LSI_BREAKPOINTS]; @@ -2393,7 +2394,7 @@ mips_can_use_watchpoint (int type, int cnt, int othertype) This is used for memory ref breakpoints. */ static unsigned long -calculate_mask (CORE_ADDR addr, int len) +calculate_mask (CORE_ADDR addr, LONGEST len) { unsigned long mask; int i; @@ -2417,7 +2418,7 @@ calculate_mask (CORE_ADDR addr, int len) watchpoint. */ static int -mips_insert_watchpoint (CORE_ADDR addr, int len, int type, +mips_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { if (mips_set_breakpoint (addr, len, type)) @@ -2429,7 +2430,7 @@ mips_insert_watchpoint (CORE_ADDR addr, int len, int type, /* Remove a watchpoint. */ static int -mips_remove_watchpoint (CORE_ADDR addr, int len, int type, +mips_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { if (mips_clear_breakpoint (addr, len, type)) @@ -2451,7 +2452,7 @@ mips_stopped_by_watchpoint (void) /* Insert a breakpoint. */ static int -mips_set_breakpoint (CORE_ADDR addr, int len, enum break_type type) +mips_set_breakpoint (CORE_ADDR addr, LONGEST len, enum break_type type) { return mips_common_breakpoint (1, addr, len, type); } @@ -2460,7 +2461,7 @@ mips_set_breakpoint (CORE_ADDR addr, int len, enum break_type type) /* Clear a breakpoint. */ static int -mips_clear_breakpoint (CORE_ADDR addr, int len, enum break_type type) +mips_clear_breakpoint (CORE_ADDR addr, LONGEST len, enum break_type type) { return mips_common_breakpoint (0, addr, len, type); } diff --git a/gdb/remote.c b/gdb/remote.c index 38ecd08..84dc030 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -7953,7 +7953,7 @@ watchpoint_to_Z_packet (int type) } static int -remote_insert_watchpoint (CORE_ADDR addr, int len, int type, +remote_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct remote_state *rs = get_remote_state (); @@ -7968,7 +7968,7 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); - xsnprintf (p, endbuf - p, ",%x", len); + xsnprintf (p, endbuf - p, ",%s", phex_nz (len, 8)); putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); @@ -7997,7 +7997,7 @@ remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, static int -remote_remove_watchpoint (CORE_ADDR addr, int len, int type, +remote_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct remote_state *rs = get_remote_state (); @@ -8012,7 +8012,7 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type, p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); - xsnprintf (p, endbuf - p, ",%x", len); + xsnprintf (p, endbuf - p, ",%s", phex_nz (len, 8)); putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); @@ -8034,7 +8034,7 @@ int remote_hw_watchpoint_length_limit = -1; int remote_hw_breakpoint_limit = -1; static int -remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { if (remote_hw_watchpoint_length_limit == 0) return 0; diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c index acd36c2..97afb36 100644 --- a/gdb/rl78-tdep.c +++ b/gdb/rl78-tdep.c @@ -1019,8 +1019,8 @@ rl78_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); - int len = TYPE_LENGTH (value_type); - int container_len = (len + 1) & ~1; + LONGEST len = TYPE_LENGTH (value_type); + LONGEST container_len = (len + 1) & ~1; sp -= container_len; write_memory (rl78_make_data_address (sp), diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c index 59cfa73..d13bfe6 100644 --- a/gdb/rs6000-aix-tdep.c +++ b/gdb/rs6000-aix-tdep.c @@ -197,7 +197,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int ii; - int len = 0; + LONGEST len = 0; int argno; /* current argument number */ int argbytes; /* current argument byte */ gdb_byte tmp_buffer[50]; @@ -327,7 +327,7 @@ ran_out_of_registers_for_arguments: if ((argno < nargs) || argbytes) { - int space = 0, jj; + LONGEST space = 0, jj; if (argbytes) { diff --git a/gdb/s390-nat.c b/gdb/s390-nat.c index bad1b43..3f41519 100644 --- a/gdb/s390-nat.c +++ b/gdb/s390-nat.c @@ -517,7 +517,7 @@ s390_fix_watch_points (struct lwp_info *lp) } static int -s390_insert_watchpoint (CORE_ADDR addr, int len, int type, +s390_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct lwp_info *lp; @@ -538,7 +538,7 @@ s390_insert_watchpoint (CORE_ADDR addr, int len, int type, } static int -s390_remove_watchpoint (CORE_ADDR addr, int len, int type, +s390_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { struct lwp_info *lp; @@ -572,7 +572,7 @@ s390_can_use_hw_breakpoint (int type, int cnt, int othertype) } static int -s390_region_ok_for_hw_watchpoint (CORE_ADDR addr, int cnt) +s390_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST cnt) { return 1; } diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 620eaea..671921d 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -376,7 +376,7 @@ s390_value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct value *value = default_value_from_register (type, regnum, frame); - int len = TYPE_LENGTH (check_typedef (type)); + LONGEST len = TYPE_LENGTH (check_typedef (type)); if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM && len < 8) set_value_offset (value, 0); @@ -2489,8 +2489,7 @@ is_power_of_two (unsigned int n) static int s390_function_arg_pass_by_reference (struct type *type) { - unsigned length = TYPE_LENGTH (type); - if (length > 8) + if (TYPE_LENGTH (type) > 8) return 1; return (is_struct_like (type) && !is_power_of_two (TYPE_LENGTH (type))) @@ -2503,8 +2502,7 @@ s390_function_arg_pass_by_reference (struct type *type) static int s390_function_arg_float (struct type *type) { - unsigned length = TYPE_LENGTH (type); - if (length > 8) + if (TYPE_LENGTH (type) > 8) return 0; return is_float_like (type); @@ -2616,11 +2614,10 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); - unsigned length = TYPE_LENGTH (type); if (s390_function_arg_pass_by_reference (type)) { - sp -= length; + sp -= TYPE_LENGTH (type); sp = align_down (sp, alignment_of (type)); copy_addr[i] = sp; } @@ -2669,7 +2666,7 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); - unsigned length = TYPE_LENGTH (type); + ULONGEST length = TYPE_LENGTH (type); if (s390_function_arg_pass_by_reference (type)) { @@ -2799,8 +2796,7 @@ s390_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr) static enum return_value_convention s390_return_value_convention (struct gdbarch *gdbarch, struct type *type) { - int length = TYPE_LENGTH (type); - if (length > 8) + if (TYPE_LENGTH (type) > 8) return RETURN_VALUE_STRUCT_CONVENTION; switch (TYPE_CODE (type)) @@ -2824,7 +2820,7 @@ s390_return_value (struct gdbarch *gdbarch, struct value *function, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int word_size = gdbarch_ptr_bit (gdbarch) / 8; enum return_value_convention rvc; - int length; + LONGEST length; type = check_typedef (type); rvc = s390_return_value_convention (gdbarch, type); diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c index fb25806..5711d99 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -515,7 +515,7 @@ score_push_dummy_call (struct gdbarch *gdbarch, struct value *function, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argnum; int argreg; - int arglen = 0; + LONGEST arglen = 0; CORE_ADDR stack_offset = 0; CORE_ADDR addr = 0; diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index a8e31b1..6b66903 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -1306,7 +1306,7 @@ sh_extract_return_value_nofpu (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int return_register = R0_REGNUM; int offset; @@ -1360,7 +1360,7 @@ sh_store_return_value_nofpu (struct type *type, struct regcache *regcache, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= 4) { diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index 4e6f262..1b64ceb 100644 --- a/gdb/sh64-tdep.c +++ b/gdb/sh64-tdep.c @@ -1058,7 +1058,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int stack_offset, stack_alloc; + LONGEST stack_offset, stack_alloc; int int_argreg; int float_argreg; int double_argreg; @@ -1069,7 +1069,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR regval; char *val; char valbuf[8]; - int len; + LONGEST len; int argreg_size; int fp_args[12]; @@ -1228,7 +1228,7 @@ sh64_extract_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_FLT) { @@ -1290,7 +1290,7 @@ sh64_store_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); char buf[64]; /* more than enough... */ - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (TYPE_CODE (type) == TYPE_CODE_FLT) { diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 6da2297..0cacfd7 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -470,7 +470,7 @@ sparc32_store_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (sparc_structure_or_union_p (type) || (sparc_floating_p (type) && len == 16) diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index 28c9ca4..e5e5b84 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -639,7 +639,8 @@ sparc64_16_byte_align_p (struct type *type) static void sparc64_store_floating_fields (struct regcache *regcache, struct type *type, - const gdb_byte *valbuf, int element, int bitpos) + const gdb_byte *valbuf, int element, + LONGEST bitpos) { int len = TYPE_LENGTH (type); @@ -681,7 +682,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); sparc64_store_floating_fields (regcache, subtype, valbuf, element, subpos); @@ -713,7 +714,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type, static void sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, - gdb_byte *valbuf, int bitpos) + gdb_byte *valbuf, LONGEST bitpos) { if (sparc64_floating_p (type)) { @@ -750,7 +751,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type, for (i = 0; i < TYPE_NFIELDS (type); i++) { struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i)); - int subpos = bitpos + TYPE_FIELD_BITPOS (type, i); + LONGEST subpos = bitpos + TYPE_FIELD_BITPOS (type, i); sparc64_extract_floating_fields (regcache, subtype, valbuf, subpos); } @@ -783,7 +784,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs, for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (sparc64_structure_or_union_p (type) || (sparc64_complex_floating_p (type) && len == 32)) diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c index 8d4ef57..2ab3327 100644 --- a/gdb/spu-multiarch.c +++ b/gdb/spu-multiarch.c @@ -118,7 +118,7 @@ spu_thread_architecture (struct target_ops *ops, ptid_t ptid) /* Override the to_region_ok_for_hw_watchpoint routine. */ static int -spu_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +spu_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { struct target_ops *ops_beneath = find_target_beneath (&spu_ops); while (ops_beneath && !ops_beneath->to_region_ok_for_hw_watchpoint) diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index f05a26b..f628d30 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -316,7 +316,7 @@ spu_value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct value *value = default_value_from_register (type, regnum, frame); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (regnum < SPU_NUM_GPRS && len < 16) { diff --git a/gdb/stack.c b/gdb/stack.c index 02e36ca..e71c56b 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -354,7 +354,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame, if (val && entryval && !ui_out_is_mi_like_p (current_uiout)) { - unsigned len = TYPE_LENGTH (value_type (val)); + ULONGEST len = TYPE_LENGTH (value_type (val)); if (!value_optimized_out (val) && value_lazy (val)) value_fetch_lazy (val); @@ -373,7 +373,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame, TRY_CATCH (except, RETURN_MASK_ERROR) { - unsigned len_deref; + ULONGEST len_deref; val_deref = coerce_ref (val); if (value_lazy (val_deref)) @@ -532,8 +532,8 @@ print_frame_args (struct symbol *func, struct frame_info *frame, case LOC_ARG: case LOC_REF_ARG: { - long current_offset = SYMBOL_VALUE (sym); - int arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); + LONGEST current_offset = SYMBOL_VALUE (sym); + LONGEST arg_size = TYPE_LENGTH (SYMBOL_TYPE (sym)); /* Compute address of next argument by adding the size of this argument and rounding to an int boundary. */ diff --git a/gdb/symmisc.c b/gdb/symmisc.c index d5a737b..cb94cb4 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -517,11 +517,11 @@ print_symbol (void *args) case LOC_CONST_BYTES: { - unsigned i; + ULONGEST i; struct type *type = check_typedef (SYMBOL_TYPE (symbol)); - fprintf_filtered (outfile, "const %u hex bytes:", - TYPE_LENGTH (type)); + fprintf_filtered (outfile, "const %s hex bytes:", + pulongest (TYPE_LENGTH (type))); for (i = 0; i < TYPE_LENGTH (type); i++) fprintf_filtered (outfile, " %02x", (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]); diff --git a/gdb/target.c b/gdb/target.c index fe1f9a1..d8b1236 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -51,7 +51,7 @@ static void default_terminal_info (char *, int); static int default_watchpoint_addr_within_range (struct target_ops *, CORE_ADDR, CORE_ADDR, int); -static int default_region_ok_for_hw_watchpoint (CORE_ADDR, int); +static int default_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); static void tcomplain (void) ATTRIBUTE_NORETURN; @@ -114,10 +114,10 @@ static int debug_to_insert_hw_breakpoint (struct gdbarch *, static int debug_to_remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *); -static int debug_to_insert_watchpoint (CORE_ADDR, int, int, +static int debug_to_insert_watchpoint (CORE_ADDR, LONGEST, int, struct expression *); -static int debug_to_remove_watchpoint (CORE_ADDR, int, int, +static int debug_to_remove_watchpoint (CORE_ADDR, LONGEST, int, struct expression *); static int debug_to_stopped_by_watchpoint (void); @@ -127,9 +127,9 @@ static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); static int debug_to_watchpoint_addr_within_range (struct target_ops *, CORE_ADDR, CORE_ADDR, int); -static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, int); +static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); -static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, int, int, +static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, LONGEST, int, struct expression *); static void debug_to_terminal_init (void); @@ -750,10 +750,10 @@ update_current_target (void) (int (*) (struct gdbarch *, struct bp_target_info *)) return_minus_one); de_fault (to_insert_watchpoint, - (int (*) (CORE_ADDR, int, int, struct expression *)) + (int (*) (CORE_ADDR, LONGEST, int, struct expression *)) return_minus_one); de_fault (to_remove_watchpoint, - (int (*) (CORE_ADDR, int, int, struct expression *)) + (int (*) (CORE_ADDR, LONGEST, int, struct expression *)) return_minus_one); de_fault (to_stopped_by_watchpoint, (int (*) (void)) @@ -766,7 +766,7 @@ update_current_target (void) de_fault (to_region_ok_for_hw_watchpoint, default_region_ok_for_hw_watchpoint); de_fault (to_can_accel_watchpoint_condition, - (int (*) (CORE_ADDR, int, int, struct expression *)) + (int (*) (CORE_ADDR, LONGEST, int, struct expression *)) return_zero); de_fault (to_terminal_init, (void (*) (void)) @@ -3542,7 +3542,7 @@ target_fileio_read_stralloc (const char *filename) static int -default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +default_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { return (len <= gdbarch_ptr_bit (target_gdbarch) / TARGET_CHAR_BIT); } @@ -4193,7 +4193,7 @@ debug_to_can_use_hw_breakpoint (int type, int cnt, int from_tty) } static int -debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { CORE_ADDR retval; @@ -4207,7 +4207,7 @@ debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) } static int -debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, +debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { int retval; @@ -4217,8 +4217,8 @@ debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, fprintf_unfiltered (gdb_stdlog, "target_can_accel_watchpoint_condition " - "(%s, %d, %d, %s) = %ld\n", - core_addr_to_string (addr), len, rw, + "(%s, %s, %d, %s) = %ld\n", + core_addr_to_string (addr), plongest (len), rw, host_address_to_string (cond), (unsigned long) retval); return retval; } @@ -4298,7 +4298,7 @@ debug_to_remove_hw_breakpoint (struct gdbarch *gdbarch, } static int -debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type, +debug_to_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int retval; @@ -4306,14 +4306,14 @@ debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type, retval = debug_target.to_insert_watchpoint (addr, len, type, cond); fprintf_unfiltered (gdb_stdlog, - "target_insert_watchpoint (%s, %d, %d, %s) = %ld\n", - core_addr_to_string (addr), len, type, + "target_insert_watchpoint (%s, %s, %d, %s) = %ld\n", + core_addr_to_string (addr), plongest (len), type, host_address_to_string (cond), (unsigned long) retval); return retval; } static int -debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type, +debug_to_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, struct expression *cond) { int retval; @@ -4321,8 +4321,8 @@ debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type, retval = debug_target.to_remove_watchpoint (addr, len, type, cond); fprintf_unfiltered (gdb_stdlog, - "target_remove_watchpoint (%s, %d, %d, %s) = %ld\n", - core_addr_to_string (addr), len, type, + "target_remove_watchpoint (%s, %s, %d, %s) = %ld\n", + core_addr_to_string (addr), plongest (len), type, host_address_to_string (cond), (unsigned long) retval); return retval; } diff --git a/gdb/target.h b/gdb/target.h index 233d355..3352756 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -462,8 +462,8 @@ struct target_ops /* Documentation of what the two routines below are expected to do is provided with the corresponding target_* macros. */ - int (*to_remove_watchpoint) (CORE_ADDR, int, int, struct expression *); - int (*to_insert_watchpoint) (CORE_ADDR, int, int, struct expression *); + int (*to_remove_watchpoint) (CORE_ADDR, LONGEST, int, struct expression *); + int (*to_insert_watchpoint) (CORE_ADDR, LONGEST, int, struct expression *); int (*to_insert_mask_watchpoint) (struct target_ops *, CORE_ADDR, CORE_ADDR, int); @@ -478,9 +478,9 @@ struct target_ops /* Documentation of this routine is provided with the corresponding target_* macro. */ - int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, int); + int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, LONGEST); - int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int, + int (*to_can_accel_watchpoint_condition) (CORE_ADDR, LONGEST, int, struct expression *); int (*to_masked_watch_num_registers) (struct target_ops *, CORE_ADDR, CORE_ADDR); diff --git a/gdb/testsuite/gdb.base/structs-longest-bitpos.c b/gdb/testsuite/gdb.base/structs-longest-bitpos.c new file mode 100644 index 0000000..1394c08 --- /dev/null +++ b/gdb/testsuite/gdb.base/structs-longest-bitpos.c @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2012 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +struct foo +{ + char buf[0xffff000000]; + char buf2[2]; +} *f; + +int +main (void) +{ + return 0; +} diff --git a/gdb/testsuite/gdb.base/structs-longest-bitpos.exp b/gdb/testsuite/gdb.base/structs-longest-bitpos.exp new file mode 100644 index 0000000..fa03f64 --- /dev/null +++ b/gdb/testsuite/gdb.base/structs-longest-bitpos.exp @@ -0,0 +1,30 @@ +# This testcase is part of GDB, the GNU debugger. + +# Copyright 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set testfile "structs-longest-bitpos" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} + +if { [prepare_for_testing ${testfile}.exp ${testfile}] } { + return -1 +} + +# The array size should not overflow +gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0} + +# The offset should not overflow +gdb_test "print &f->buf2" {= \(char \(\*\)\[2\]\) 0xffff000000} diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 6d76f4b..01716ae 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -967,7 +967,7 @@ collect_symbol (struct collection_list *collect, long frame_regno, long frame_offset, CORE_ADDR scope) { - unsigned long len; + ULONGEST len; unsigned int reg; bfd_signed_vma offset; int treat_as_expr = 0; @@ -991,8 +991,8 @@ collect_symbol (struct collection_list *collect, char tmp[40]; sprintf_vma (tmp, offset); - printf_filtered ("LOC_STATIC %s: collect %ld bytes at %s.\n", - SYMBOL_PRINT_NAME (sym), len, + printf_filtered ("LOC_STATIC %s: collect %s bytes at %s.\n", + SYMBOL_PRINT_NAME (sym), pulongest (len), tmp /* address */); } /* A struct may be a C++ class with static fields, go to general @@ -1024,8 +1024,8 @@ collect_symbol (struct collection_list *collect, offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { - printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset ", - SYMBOL_PRINT_NAME (sym), len); + printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset ", + SYMBOL_PRINT_NAME (sym), pulongest (len)); printf_vma (offset); printf_filtered (" from frame ptr reg %d\n", reg); } @@ -1036,8 +1036,8 @@ collect_symbol (struct collection_list *collect, offset = 0; if (info_verbose) { - printf_filtered ("LOC_REGPARM_ADDR %s: Collect %ld bytes at offset ", - SYMBOL_PRINT_NAME (sym), len); + printf_filtered ("LOC_REGPARM_ADDR %s: Collect %s bytes at offset ", + SYMBOL_PRINT_NAME (sym), pulongest (len)); printf_vma (offset); printf_filtered (" from reg %d\n", reg); } @@ -1048,8 +1048,8 @@ collect_symbol (struct collection_list *collect, offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { - printf_filtered ("LOC_LOCAL %s: Collect %ld bytes at offset ", - SYMBOL_PRINT_NAME (sym), len); + printf_filtered ("LOC_LOCAL %s: Collect %s bytes at offset ", + SYMBOL_PRINT_NAME (sym), pulongest (len)); printf_vma (offset); printf_filtered (" from frame ptr reg %d\n", reg); } @@ -1448,7 +1448,8 @@ encode_actions_1 (struct command_line *action, } else { - unsigned long addr, len; + CORE_ADDR addr; + ULONGEST len; struct cleanup *old_chain = NULL; struct cleanup *old_chain1 = NULL; @@ -2613,7 +2614,8 @@ scope_info (char *args, int from_tty) const char *symname; char *save_args = args; struct block_iterator iter; - int j, count = 0; + int count = 0; + LONGEST j; struct gdbarch *gdbarch; int regno; @@ -2743,8 +2745,11 @@ scope_info (char *args, int from_tty) break; } if (SYMBOL_TYPE (sym)) - printf_filtered (", length %d.\n", - TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym)))); + { + ULONGEST len = TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))); + + printf_filtered (", length %s.\n", pulongest (len)); + } } if (BLOCK_FUNCTION (block)) break; diff --git a/gdb/typeprint.c b/gdb/typeprint.c index c25e705..4bbf8a7 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -118,7 +118,7 @@ whatis_exp (char *exp, int show) struct type *real_type = NULL; struct type *type; int full = 0; - int top = -1; + LONGEST top = -1; int using_enc = 0; struct value_print_options opts; diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index e374df8..4775ab6 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -809,7 +809,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argreg; int argnum; - int len = 0; + LONGEST len = 0; int stack_offset; /* The offset onto the stack at which we will start copying parameters @@ -890,7 +890,7 @@ v850_extract_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= v850_reg_size) { @@ -917,7 +917,7 @@ v850_store_return_value (struct type *type, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); if (len <= v850_reg_size) regcache_cooked_write_unsigned diff --git a/gdb/valarith.c b/gdb/valarith.c index 96d5411..113cfd8 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -196,8 +196,8 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) { struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); - unsigned int elt_size = TYPE_LENGTH (elt_type); - unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound); + ULONGEST elt_size = TYPE_LENGTH (elt_type); + ULONGEST elt_offs = elt_size * (index - lowerbound); struct value *v; if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) @@ -1474,7 +1474,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) int value_logical_not (struct value *arg1) { - int len; + LONGEST len; const gdb_byte *p; struct type *type1; @@ -1505,8 +1505,8 @@ value_logical_not (struct value *arg1) static int value_strcmp (struct value *arg1, struct value *arg2) { - int len1 = TYPE_LENGTH (value_type (arg1)); - int len2 = TYPE_LENGTH (value_type (arg2)); + LONGEST len1 = TYPE_LENGTH (value_type (arg1)); + LONGEST len2 = TYPE_LENGTH (value_type (arg2)); const gdb_byte *s1 = value_contents (arg1); const gdb_byte *s2 = value_contents (arg2); int i, len = len1 < len2 ? len1 : len2; diff --git a/gdb/valops.c b/gdb/valops.c index 5002272..4c729be 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -53,11 +53,11 @@ static int typecmp (int staticp, int varargs, int nargs, struct field t1[], struct value *t2[]); static struct value *search_struct_field (const char *, struct value *, - int, struct type *, int); + LONGEST, struct type *, int); static struct value *search_struct_method (const char *, struct value **, struct value **, - int, int *, struct type *); + LONGEST, int *, struct type *); static int find_oload_champ_namespace (struct value **, int, const char *, const char *, @@ -85,7 +85,7 @@ oload_classification classify_oload_match (struct badness_vector *, int, int); static struct value *value_struct_elt_for_reference (struct type *, - int, struct type *, + LONGEST, struct type *, char *, struct type *, int, enum noside); @@ -102,8 +102,8 @@ static CORE_ADDR allocate_space_in_inferior (int); static struct value *cast_into_complex (struct type *, struct value *); static struct fn_field *find_method_list (struct value **, const char *, - int, struct type *, int *, - struct type **, int *); + LONGEST, struct type *, int *, + struct type **, LONGEST *); void _initialize_valops (void); @@ -188,7 +188,7 @@ find_function_in_inferior (const char *name, struct objfile **objf_p) space. */ struct value * -value_allocate_space_in_inferior (int len) +value_allocate_space_in_inferior (LONGEST len) { struct objfile *objf; struct value *val = find_function_in_inferior ("malloc", &objf); @@ -261,7 +261,8 @@ value_cast_structs (struct type *type, struct value *v2) if (TYPE_NAME (t2) != NULL) { /* Try downcasting using the run-time type of the value. */ - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct type *real_type; real_type = value_rtti_type (v2, &full, &top, &using_enc); @@ -400,12 +401,12 @@ value_cast (struct type *type, struct value *arg2) if (code1 == TYPE_CODE_ARRAY) { struct type *element_type = TYPE_TARGET_TYPE (type); - unsigned element_length = TYPE_LENGTH (check_typedef (element_type)); + ULONGEST element_length = TYPE_LENGTH (check_typedef (element_type)); if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) { struct type *range_type = TYPE_INDEX_TYPE (type); - int val_length = TYPE_LENGTH (type2); + LONGEST val_length = TYPE_LENGTH (type2); LONGEST low_bound, high_bound, new_length; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) @@ -655,7 +656,7 @@ value_reinterpret_cast (struct type *type, struct value *arg) static int dynamic_cast_check_1 (struct type *desired_type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct value *val, struct type *search_type, @@ -667,8 +668,8 @@ dynamic_cast_check_1 (struct type *desired_type, for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) { - int offset = baseclass_offset (search_type, i, valaddr, embedded_offset, - address, val); + LONGEST offset = baseclass_offset (search_type, i, valaddr, + embedded_offset, address, val); if (class_types_same_p (desired_type, TYPE_BASECLASS (search_type, i))) { @@ -702,7 +703,7 @@ dynamic_cast_check_1 (struct type *desired_type, static int dynamic_cast_check_2 (struct type *desired_type, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, CORE_ADDR address, struct value *val, struct type *search_type, @@ -712,7 +713,7 @@ dynamic_cast_check_2 (struct type *desired_type, for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) { - int offset; + LONGEST offset; if (! BASETYPE_VIA_PUBLIC (search_type, i)) continue; @@ -743,7 +744,8 @@ dynamic_cast_check_2 (struct type *desired_type, struct value * value_dynamic_cast (struct type *type, struct value *arg) { - int full, top, using_enc; + int full, using_enc; + LONGEST top; struct type *resolved_type = check_typedef (type); struct type *arg_type = check_typedef (value_type (arg)); struct type *class_type, *rtti_type; @@ -994,7 +996,7 @@ value_fetch_lazy (struct value *val) struct value *parent = value_parent (val); LONGEST offset = value_offset (val); LONGEST num; - int length = TYPE_LENGTH (type); + LONGEST length = TYPE_LENGTH (type); if (!value_bits_valid (val, TARGET_CHAR_BIT * offset + value_bitpos (val), @@ -1016,7 +1018,8 @@ value_fetch_lazy (struct value *val) else if (VALUE_LVAL (val) == lval_memory) { CORE_ADDR addr = value_address (val); - int length = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); + struct type *enclosing_type = value_enclosing_type (val); + LONGEST length = TYPE_LENGTH (check_typedef (enclosing_type)); if (length) read_value_memory (val, 0, value_stack (val), @@ -1260,7 +1263,7 @@ value_assign (struct value *toval, struct value *fromval) { const gdb_byte *dest_buffer; CORE_ADDR changed_addr; - int changed_len; + LONGEST changed_len; gdb_byte buffer[sizeof (LONGEST)]; if (value_bitsize (toval)) @@ -1333,7 +1336,7 @@ value_assign (struct value *toval, struct value *fromval) if (value_bitsize (toval)) { struct value *parent = value_parent (toval); - int offset = value_offset (parent) + value_offset (toval); + LONGEST offset = value_offset (parent) + value_offset (toval); int changed_len; gdb_byte buffer[sizeof (LONGEST)]; int optim, unavail; @@ -1798,7 +1801,7 @@ value_array (int lowbound, int highbound, struct value **elemvec) { int nelem; int idx; - unsigned int typelength; + ULONGEST typelength; struct value *val; struct type *arraytype; @@ -2010,7 +2013,7 @@ update_search_result (struct value **result_ptr, struct value *v, lookup is ambiguous. */ static void -do_search_struct_field (const char *name, struct value *arg1, int offset, +do_search_struct_field (const char *name, struct value *arg1, LONGEST offset, struct type *type, int looking_for_baseclass, struct value **result_ptr, int *last_boffset, @@ -2068,7 +2071,7 @@ do_search_struct_field (const char *name, struct value *arg1, int offset, <variant field>. */ struct value *v = NULL; - int new_offset = offset; + LONGEST new_offset = offset; /* This is pretty gross. In G++, the offset in an anonymous union is relative to the beginning of the @@ -2107,7 +2110,7 @@ do_search_struct_field (const char *name, struct value *arg1, int offset, && (strcmp_iw (name, TYPE_BASECLASS_NAME (type, i)) == 0)); - int boffset = value_embedded_offset (arg1) + offset; + LONGEST boffset = value_embedded_offset (arg1) + offset; if (BASETYPE_VIA_VIRTUAL (type, i)) { @@ -2182,7 +2185,7 @@ do_search_struct_field (const char *name, struct value *arg1, int offset, fields, look for a baseclass named NAME. */ static struct value * -search_struct_field (const char *name, struct value *arg1, int offset, +search_struct_field (const char *name, struct value *arg1, LONGEST offset, struct type *type, int looking_for_baseclass) { struct value *result = NULL; @@ -2203,7 +2206,7 @@ search_struct_field (const char *name, struct value *arg1, int offset, static struct value * search_struct_method (const char *name, struct value **arg1p, - struct value **args, int offset, + struct value **args, LONGEST offset, int *static_memfuncp, struct type *type) { int i; @@ -2267,9 +2270,9 @@ search_struct_method (const char *name, struct value **arg1p, for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { - int base_offset; + LONGEST base_offset; int skip = 0; - int this_offset; + LONGEST this_offset; if (BASETYPE_VIA_VIRTUAL (type, i)) { @@ -2445,8 +2448,8 @@ value_struct_elt (struct value **argp, struct value **args, static struct fn_field * find_method_list (struct value **argp, const char *method, - int offset, struct type *type, int *num_fns, - struct type **basetype, int *boffset) + LONGEST offset, struct type *type, int *num_fns, + struct type **basetype, LONGEST *boffset) { int i; struct fn_field *f; @@ -2479,7 +2482,7 @@ find_method_list (struct value **argp, const char *method, /* Not found in object, check in base subobjects. */ for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { - int base_offset; + LONGEST base_offset; if (BASETYPE_VIA_VIRTUAL (type, i)) { @@ -2515,7 +2518,7 @@ find_method_list (struct value **argp, const char *method, static struct fn_field * value_find_oload_method_list (struct value **argp, const char *method, int offset, int *num_fns, - struct type **basetype, int *boffset) + struct type **basetype, LONGEST *boffset) { struct type *t; @@ -2607,7 +2610,7 @@ find_overload_match (struct value **args, int nargs, /* Number of overloaded instances being considered. */ int num_fns = 0; struct type *basetype = NULL; - int boffset; + LONGEST boffset; struct cleanup *all_cleanups = make_cleanup (null_cleanup, NULL); @@ -3313,7 +3316,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) the form "DOMAIN::NAME". */ static struct value * -value_struct_elt_for_reference (struct type *domain, int offset, +value_struct_elt_for_reference (struct type *domain, LONGEST offset, struct type *curtype, char *name, struct type *intype, int want_address, @@ -3350,7 +3353,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, if (want_address) return value_from_longest (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), - offset + (LONGEST) (TYPE_FIELD_BITPOS (t, i) >> 3)); + offset + (TYPE_FIELD_BITPOS (t, i) >> 3)); else if (noside == EVAL_AVOID_SIDE_EFFECTS) return allocate_value (TYPE_FIELD_TYPE (t, i)); else @@ -3493,7 +3496,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; - int base_offset; + LONGEST base_offset; if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; @@ -3583,7 +3586,7 @@ value_maybe_namespace_elt (const struct type *curtype, struct type * value_rtti_indirect_type (struct value *v, int *full, - int *top, int *using_enc) + LONGEST *top, int *using_enc) { struct value *target; struct type *type, *real_type, *target_type; @@ -3633,12 +3636,12 @@ value_rtti_indirect_type (struct value *v, int *full, struct value * value_full_object (struct value *argp, struct type *rtype, - int xfull, int xtop, + int xfull, LONGEST xtop, int xusing_enc) { struct type *real_type; int full = 0; - int top = -1; + LONGEST top = -1; int using_enc = 0; struct value *new_val; diff --git a/gdb/valprint.c b/gdb/valprint.c index fc5942d..17b1316 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -264,7 +264,7 @@ scalar_type_p (struct type *type) int valprint_check_validity (struct ui_file *stream, struct type *type, - int embedded_offset, + LONGEST embedded_offset, const struct value *val) { CHECK_TYPEDEF (type); @@ -328,7 +328,7 @@ val_print_invalid_address (struct ui_file *stream) void generic_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, @@ -691,7 +691,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr, RECURSE. */ void -val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +val_print (struct type *type, const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -903,7 +903,7 @@ val_print_type_code_flags (struct type *type, const gdb_byte *valaddr, void val_print_scalar_formatted (struct type *type, - const gdb_byte *valaddr, int embedded_offset, + const gdb_byte *valaddr, LONGEST embedded_offset, const struct value *val, const struct value_print_options *options, int size, @@ -1444,7 +1444,7 @@ print_decimal_chars (struct ui_file *stream, const gdb_byte *valaddr, void print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr, - unsigned len, enum bfd_endian byte_order) + ULONGEST len, enum bfd_endian byte_order) { const gdb_byte *p; @@ -1561,7 +1561,7 @@ maybe_print_array_index (struct type *index_type, LONGEST index, void val_print_array_elements (struct type *type, - const gdb_byte *valaddr, int embedded_offset, + const gdb_byte *valaddr, LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, @@ -1569,9 +1569,9 @@ val_print_array_elements (struct type *type, unsigned int i) { unsigned int things_printed = 0; - unsigned len; + ULONGEST len; struct type *elttype, *index_type; - unsigned eltlen; + ULONGEST eltlen; /* Position of the array element we are examining to see whether it is repeated. */ unsigned int rep1; @@ -2058,7 +2058,7 @@ generic_emit_char (int c, struct type *type, struct ui_file *stream, void generic_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options) diff --git a/gdb/valprint.h b/gdb/valprint.h index b853b1a..dc5d329 100644 --- a/gdb/valprint.h +++ b/gdb/valprint.h @@ -117,7 +117,7 @@ extern void maybe_print_array_index (struct type *index_type, LONGEST index, struct ui_file *stream, const struct value_print_options *); -extern void val_print_array_elements (struct type *, const gdb_byte *, int, +extern void val_print_array_elements (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, @@ -131,7 +131,7 @@ extern void val_print_type_code_flags (struct type *type, struct ui_file *stream); extern void val_print_scalar_formatted (struct type *, - const gdb_byte *, int, + const gdb_byte *, LONGEST, const struct value *, const struct value_print_options *, int, @@ -147,7 +147,7 @@ extern void print_decimal_chars (struct ui_file *, const gdb_byte *, unsigned int, enum bfd_endian); extern void print_hex_chars (struct ui_file *, const gdb_byte *, - unsigned int, enum bfd_endian); + ULONGEST, enum bfd_endian); extern void print_char_chars (struct ui_file *, struct type *, const gdb_byte *, unsigned int, enum bfd_endian); @@ -191,7 +191,7 @@ struct generic_val_print_decorations extern void generic_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, @@ -201,7 +201,7 @@ extern void generic_emit_char (int c, struct type *type, struct ui_file *stream, int quoter, const char *encoding); extern void generic_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, + const gdb_byte *string, ULONGEST length, const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options); diff --git a/gdb/value.c b/gdb/value.c index a6bb718..3fddba0 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -67,10 +67,10 @@ struct internal_function struct range { /* Lowest offset in the range. */ - int offset; + LONGEST offset; /* Length of the range. */ - int length; + LONGEST length; }; typedef struct range range_s; @@ -81,8 +81,8 @@ DEF_VEC_O(range_s); [offset2, offset2+len2) overlap. */ static int -ranges_overlap (int offset1, int len1, - int offset2, int len2) +ranges_overlap (LONGEST offset1, LONGEST len1, + LONGEST offset2, LONGEST len2) { ULONGEST h, l; @@ -106,7 +106,7 @@ range_lessthan (const range_s *r1, const range_s *r2) OFFSET+LENGTH). */ static int -ranges_contain (VEC(range_s) *ranges, int offset, int length) +ranges_contain (VEC(range_s) *ranges, LONGEST offset, LONGEST length) { range_s what; int i; @@ -239,7 +239,7 @@ struct value lval == lval_register, this is a further offset from location.address within the registers structure. Note also the member embedded_offset below. */ - int offset; + LONGEST offset; /* Only used for bitfields; number of bits contained in them. */ int bitsize; @@ -309,8 +309,8 @@ struct value `type', and `embedded_offset' is zero, so everything works normally. */ struct type *enclosing_type; - int embedded_offset; - int pointed_to_offset; + LONGEST embedded_offset; + LONGEST pointed_to_offset; /* Values are stored in a chain, so that they can be deleted easily over calls to the inferior. Values assigned to internal @@ -332,7 +332,8 @@ struct value }; int -value_bytes_available (const struct value *value, int offset, int length) +value_bytes_available (const struct value *value, LONGEST offset, + LONGEST length) { gdb_assert (!value->lazy); @@ -353,7 +354,8 @@ value_entirely_available (struct value *value) } void -mark_value_bytes_unavailable (struct value *value, int offset, int length) +mark_value_bytes_unavailable (struct value *value, LONGEST offset, + LONGEST length) { range_s newr; int i; @@ -524,7 +526,7 @@ mark_value_bytes_unavailable (struct value *value, int offset, int length) static int find_first_range_overlap (VEC(range_s) *ranges, int pos, - int offset, int length) + LONGEST offset, LONGEST length) { range_s *r; int i; @@ -537,9 +539,9 @@ find_first_range_overlap (VEC(range_s) *ranges, int pos, } int -value_available_contents_eq (const struct value *val1, int offset1, - const struct value *val2, int offset2, - int length) +value_available_contents_eq (const struct value *val1, LONGEST offset1, + const struct value *val2, LONGEST offset2, + LONGEST length) { int idx1 = 0, idx2 = 0; @@ -767,13 +769,13 @@ deprecated_set_value_type (struct value *value, struct type *type) value->type = type; } -int +LONGEST value_offset (const struct value *value) { return value->offset; } void -set_value_offset (struct value *value, int offset) +set_value_offset (struct value *value, LONGEST offset) { value->offset = offset; } @@ -923,8 +925,9 @@ value_contents_all (struct value *value) DST_OFFSET+LENGTH) range are wholly available. */ void -value_contents_copy_raw (struct value *dst, int dst_offset, - struct value *src, int src_offset, int length) +value_contents_copy_raw (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, + LONGEST length) { range_s *r; int i; @@ -972,8 +975,8 @@ value_contents_copy_raw (struct value *dst, int dst_offset, DST_OFFSET+LENGTH) range are wholly available. */ void -value_contents_copy (struct value *dst, int dst_offset, - struct value *src, int src_offset, int length) +value_contents_copy (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, LONGEST length) { require_not_optimized_out (src); @@ -1033,7 +1036,7 @@ value_contents_equal (struct value *val1, struct value *val2) { struct type *type1; struct type *type2; - int len; + LONGEST len; type1 = check_typedef (value_type (val1)); type2 = check_typedef (value_type (val2)); @@ -1068,7 +1071,7 @@ value_entirely_optimized_out (const struct value *value) } int -value_bits_valid (const struct value *value, int offset, int length) +value_bits_valid (const struct value *value, LONGEST offset, LONGEST length) { if (!value->optimized_out) return 1; @@ -1081,7 +1084,7 @@ value_bits_valid (const struct value *value, int offset, int length) int value_bits_synthetic_pointer (const struct value *value, - int offset, int length) + LONGEST offset, LONGEST length) { if (value->lval != lval_computed || !value->location.computed.funcs->check_synthetic_pointer) @@ -1091,26 +1094,26 @@ value_bits_synthetic_pointer (const struct value *value, length); } -int +LONGEST value_embedded_offset (struct value *value) { return value->embedded_offset; } void -set_value_embedded_offset (struct value *value, int val) +set_value_embedded_offset (struct value *value, LONGEST val) { value->embedded_offset = val; } -int +LONGEST value_pointed_to_offset (struct value *value) { return value->pointed_to_offset; } void -set_value_pointed_to_offset (struct value *value, int val) +set_value_pointed_to_offset (struct value *value, LONGEST val) { value->pointed_to_offset = val; } @@ -1936,7 +1939,7 @@ get_internalvar_function (struct internalvar *var, } void -set_internalvar_component (struct internalvar *var, int offset, int bitpos, +set_internalvar_component (struct internalvar *var, LONGEST offset, int bitpos, int bitsize, struct value *newval) { gdb_byte *addr; @@ -2605,7 +2608,7 @@ set_value_enclosing_type (struct value *val, struct type *new_encl_type) FIELDNO says which field. */ struct value * -value_primitive_field (struct value *arg1, int offset, +value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type) { struct value *v; @@ -2635,8 +2638,8 @@ value_primitive_field (struct value *arg1, int offset, bit. Assume that the address, offset, and embedded offset are sufficiently aligned. */ - int bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); - int container_bitsize = TYPE_LENGTH (type) * 8; + LONGEST bitpos = TYPE_FIELD_BITPOS (arg_type, fieldno); + LONGEST container_bitsize = TYPE_LENGTH (type) * 8; v = allocate_value_lazy (type); v->bitsize = TYPE_FIELD_BITSIZE (arg_type, fieldno); @@ -2658,7 +2661,7 @@ value_primitive_field (struct value *arg1, int offset, /* This field is actually a base subobject, so preserve the entire object's contents for later references to virtual bases, etc. */ - int boffset; + LONGEST boffset; /* Lazy register values with offsets are not supported. */ if (VALUE_LVAL (arg1) == lval_register && value_lazy (arg1)) @@ -2735,7 +2738,7 @@ value_field (struct value *arg1, int fieldno) struct value * value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *type, - int offset) + LONGEST offset) { struct value *v; struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); @@ -2795,8 +2798,8 @@ value_fn_field (struct value **arg1p, struct fn_field *f, static int unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, int bitsize, - const struct value *original_value, + LONGEST embedded_offset, LONGEST bitpos, + int bitsize, const struct value *original_value, LONGEST *result) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (field_type)); @@ -2804,7 +2807,7 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, ULONGEST valmask; int lsbcount; int bytes_read; - int read_offset; + LONGEST read_offset; /* Read the minimum number of bytes required; there may not be enough bytes to read an entire ULONGEST. */ @@ -2874,7 +2877,7 @@ unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, int bitsize, + LONGEST embedded_offset, int bitpos, int bitsize, const struct value *original_value, LONGEST *result) { @@ -2892,10 +2895,10 @@ unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, static int unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result) { - int bitpos = TYPE_FIELD_BITPOS (type, fieldno); + LONGEST bitpos = TYPE_FIELD_BITPOS (type, fieldno); int bitsize = TYPE_FIELD_BITSIZE (type, fieldno); struct type *field_type = TYPE_FIELD_TYPE (type, fieldno); @@ -2911,7 +2914,7 @@ unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result) { gdb_assert (val != NULL); @@ -2943,7 +2946,7 @@ unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno) struct value * value_field_bitfield (struct type *type, int fieldno, const gdb_byte *valaddr, - int embedded_offset, const struct value *val) + LONGEST embedded_offset, const struct value *val) { LONGEST l; @@ -2970,12 +2973,12 @@ value_field_bitfield (struct type *type, int fieldno, void modify_field (struct type *type, gdb_byte *addr, - LONGEST fieldval, int bitpos, int bitsize) + LONGEST fieldval, LONGEST bitpos, int bitsize) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); ULONGEST oword; ULONGEST mask = (ULONGEST) -1 >> (8 * sizeof (ULONGEST) - bitsize); - int bytesize; + LONGEST bytesize; /* Normalize BITPOS. */ addr += bitpos / 8; diff --git a/gdb/value.h b/gdb/value.h index d8b157f..178628a 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -82,8 +82,8 @@ extern void set_value_parent (struct value *value, struct value *parent); within the registers structure. Note also the member embedded_offset below. */ -extern int value_offset (const struct value *); -extern void set_value_offset (struct value *, int offset); +extern LONGEST value_offset (const struct value *); +extern void set_value_offset (struct value *, LONGEST offset); /* The comment from "struct value" reads: ``Is it modifiable? Only relevant if lval != not_lval.''. Shouldn't the value instead be @@ -154,10 +154,10 @@ extern struct type *value_actual_type (struct value *value, int resolve_simple_types, int *real_type_found); -extern int value_pointed_to_offset (struct value *value); -extern void set_value_pointed_to_offset (struct value *value, int val); -extern int value_embedded_offset (struct value *value); -extern void set_value_embedded_offset (struct value *value, int val); +extern LONGEST value_pointed_to_offset (struct value *value); +extern void set_value_pointed_to_offset (struct value *value, LONGEST val); +extern LONGEST value_embedded_offset (struct value *value); +extern void set_value_embedded_offset (struct value *value, LONGEST val); /* For lval_computed values, this structure holds functions used to retrieve and set the value (or portions of the value). @@ -185,7 +185,8 @@ struct lval_funcs /* Check the validity of some bits in VALUE. This should return 1 if all the bits starting at OFFSET and extending for LENGTH bits are valid, or 0 if any bit is invalid. */ - int (*check_validity) (const struct value *value, int offset, int length); + int (*check_validity) (const struct value *value, LONGEST offset, + LONGEST length); /* Return 1 if any bit in VALUE is valid, 0 if they are all invalid. */ int (*check_any_valid) (const struct value *value); @@ -203,7 +204,7 @@ struct lval_funcs /* If non-NULL, this is used to determine whether the indicated bits of VALUE are a synthetic pointer. */ int (*check_synthetic_pointer) (const struct value *value, - int offset, int length); + LONGEST offset, LONGEST length); /* Return a duplicate of VALUE's closure, for use in a new value. This may simply return the same closure, if VALUE's is @@ -240,7 +241,7 @@ extern struct value *allocate_computed_value (struct type *type, Otherwise, return 1. */ extern int valprint_check_validity (struct ui_file *stream, struct type *type, - int embedded_offset, + LONGEST embedded_offset, const struct value *val); extern struct value *allocate_optimized_out_value (struct type *type); @@ -411,13 +412,13 @@ extern struct value *coerce_array (struct value *value); bits in the given range are valid, zero if any bit is invalid. */ extern int value_bits_valid (const struct value *value, - int offset, int length); + LONGEST offset, LONGEST length); /* Given a value, determine whether the bits starting at OFFSET and extending for LENGTH bits are a synthetic pointer. */ extern int value_bits_synthetic_pointer (const struct value *value, - int offset, int length); + LONGEST offset, LONGEST length); /* Given a value, determine whether the contents bytes starting at OFFSET and extending for LENGTH bytes are available. This returns @@ -425,7 +426,7 @@ extern int value_bits_synthetic_pointer (const struct value *value, byte is unavailable. */ extern int value_bytes_available (const struct value *value, - int offset, int length); + LONGEST offset, LONGEST length); /* Like value_bytes_available, but return false if any byte in the whole object is unavailable. */ @@ -435,7 +436,7 @@ extern int value_entirely_available (struct value *value); LENGTH bytes as unavailable. */ extern void mark_value_bytes_unavailable (struct value *value, - int offset, int length); + LONGEST offset, LONGEST length); /* Compare LENGTH bytes of VAL1's contents starting at OFFSET1 with LENGTH bytes of VAL2's contents starting at OFFSET2. @@ -445,7 +446,7 @@ extern void mark_value_bytes_unavailable (struct value *value, example, to compare a complete object value with itself, including its enclosing type chunk, you'd do: - int len = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); + ULONGEST len = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); value_available_contents (val, 0, val, 0, len); Returns true iff the set of available contents match. Unavailable @@ -467,9 +468,10 @@ extern void mark_value_bytes_unavailable (struct value *value, value_available_contents_eq(val, 3, val, 4, 4) => 0 */ -extern int value_available_contents_eq (const struct value *val1, int offset1, - const struct value *val2, int offset2, - int length); +extern int value_available_contents_eq (const struct value *val1, + LONGEST offset1, + const struct value *val2, + LONGEST offset2, LONGEST length); /* Read LENGTH bytes of memory starting at MEMADDR into BUFFER, which is (or will be copied to) VAL's contents buffer offset by @@ -506,7 +508,7 @@ extern CORE_ADDR unpack_pointer (struct type *type, const gdb_byte *valaddr); extern int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, - int embedded_offset, int bitpos, + LONGEST embedded_offset, int bitpos, int bitsize, const struct value *original_value, LONGEST *result); @@ -515,12 +517,12 @@ extern LONGEST unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno); extern int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, - int embedded_offset, int fieldno, + LONGEST embedded_offset, int fieldno, const struct value *val, LONGEST *result); extern struct value *value_field_bitfield (struct type *type, int fieldno, const gdb_byte *valaddr, - int embedded_offset, + LONGEST embedded_offset, const struct value *val); extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); @@ -574,12 +576,12 @@ extern struct value *default_read_var_value (struct symbol *var, extern struct value *allocate_value (struct type *type); extern struct value *allocate_value_lazy (struct type *type); extern void allocate_value_contents (struct value *value); -extern void value_contents_copy (struct value *dst, int dst_offset, - struct value *src, int src_offset, - int length); -extern void value_contents_copy_raw (struct value *dst, int dst_offset, - struct value *src, int src_offset, - int length); +extern void value_contents_copy (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, + LONGEST length); +extern void value_contents_copy_raw (struct value *dst, LONGEST dst_offset, + struct value *src, LONGEST src_offset, + LONGEST length); extern struct value *allocate_repeat_value (struct type *type, int count); @@ -653,16 +655,16 @@ extern int find_overload_match (struct value **args, int nargs, extern struct value *value_field (struct value *arg1, int fieldno); -extern struct value *value_primitive_field (struct value *arg1, int offset, +extern struct value *value_primitive_field (struct value *arg1, LONGEST offset, int fieldno, struct type *arg_type); -extern struct type *value_rtti_indirect_type (struct value *, int *, int *, +extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *, int *); extern struct value *value_full_object (struct value *, struct type *, int, - int, int); + LONGEST, int); extern struct value *value_cast_pointers (struct type *, struct value *, int); @@ -752,7 +754,7 @@ extern void set_internalvar_string (struct internalvar *var, extern void clear_internalvar (struct internalvar *var); extern void set_internalvar_component (struct internalvar *var, - int offset, + LONGEST offset, int bitpos, int bitsize, struct value *newvalue); @@ -834,7 +836,7 @@ extern struct value *value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside); extern struct value *value_fn_field (struct value **arg1p, struct fn_field *f, - int j, struct type *type, int offset); + int j, struct type *type, LONGEST offset); extern int binop_types_user_defined_p (enum exp_opcode op, struct type *type1, @@ -862,7 +864,8 @@ extern void release_value_or_incref (struct value *val); extern int record_latest_value (struct value *val); extern void modify_field (struct type *type, gdb_byte *addr, - LONGEST fieldval, int bitpos, int bitsize); + LONGEST fieldval, LONGEST bitpos, + int bitsize); extern void type_print (struct type *type, const char *varstring, struct ui_file *stream, int show); @@ -892,7 +895,7 @@ extern void value_print_array_elements (struct value *val, extern struct value *value_release_to_mark (struct value *mark); extern void val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, @@ -943,7 +946,7 @@ extern struct value *value_literal_complex (struct value *, struct value *, extern struct value *find_function_in_inferior (const char *, struct objfile **); -extern struct value *value_allocate_space_in_inferior (int); +extern struct value *value_allocate_space_in_inferior (LONGEST); extern struct value *value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound); diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index 550b56b..f3870c9 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -116,7 +116,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); gdb_byte buf[4]; - int count = 0; + LONGEST count = 0; int i; /* We create an argument list on the stack, and make the argument @@ -125,7 +125,7 @@ vax_store_arguments (struct regcache *regcache, int nargs, /* Push arguments in reverse order. */ for (i = nargs - 1; i >= 0; i--) { - int len = TYPE_LENGTH (value_enclosing_type (args[i])); + LONGEST len = TYPE_LENGTH (value_enclosing_type (args[i])); sp -= (len + 3) & ~3; count += (len + 3) / 4; @@ -208,7 +208,7 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); gdb_byte buf[8]; if (TYPE_CODE (type) == TYPE_CODE_STRUCT diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 47fc86b..d73e2d6 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -162,8 +162,9 @@ static void xstormy16_extract_return_value (struct type *type, struct regcache *regcache, void *valbuf) { - int len = TYPE_LENGTH (type); - int i, regnum = E_1ST_ARG_REGNUM; + LONGEST len = TYPE_LENGTH (type); + LONGEST i; + int regnum = E_1ST_ARG_REGNUM; for (i = 0; i < len; i += xstormy16_reg_size) regcache_raw_read (regcache, regnum++, (char *) valbuf + i); @@ -188,8 +189,9 @@ xstormy16_store_return_value (struct type *type, struct regcache *regcache, } else { - int len = TYPE_LENGTH (type); - int i, regnum = E_1ST_ARG_REGNUM; + LONGEST len = TYPE_LENGTH (type); + LONGEST i; + int regnum = E_1ST_ARG_REGNUM; for (i = 0; i < len; i += xstormy16_reg_size) regcache_raw_write (regcache, regnum++, (char *) valbuf + i); @@ -235,8 +237,9 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR stack_dest = sp; int argreg = E_1ST_ARG_REGNUM; - int i, j; - int typelen, slacklen; + int i, slacklen; + LONGEST j; + LONGEST typelen; const gdb_byte *val; char buf[xstormy16_pc_size]; diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index b2a0617..9539059 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -1580,7 +1580,7 @@ xtensa_extract_return_value (struct type *type, { struct gdbarch *gdbarch = get_regcache_arch (regcache); bfd_byte *valbuf = dst; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); ULONGEST pc, wb; int callsize, areg; int offset = 0; @@ -1598,8 +1598,8 @@ xtensa_extract_return_value (struct type *type, /* On Xtensa, we can return up to 4 words (or 2 for call12). */ if (len > (callsize > 8 ? 8 : 16)) internal_error (__FILE__, __LINE__, - _("cannot extract return value of %d bytes long"), - len); + _("cannot extract return value of %s bytes long"), + plongest (len)); /* Get the register offset of the return register (A2) in the caller window. */ @@ -1614,7 +1614,8 @@ xtensa_extract_return_value (struct type *type, areg = gdbarch_tdep (gdbarch)->a0_base + C0_ARGS; } - DEBUGINFO ("[xtensa_extract_return_value] areg %d len %d\n", areg, len); + DEBUGINFO ("[xtensa_extract_return_value] areg %d len %s\n", areg, + plongest (len)); if (len < 4 && gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) offset = 4 - len; @@ -1639,7 +1640,7 @@ xtensa_store_return_value (struct type *type, unsigned int areg; ULONGEST pc, wb; int callsize; - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); int offset = 0; DEBUGTRACE ("xtensa_store_return_value (...)\n"); @@ -1653,8 +1654,8 @@ xtensa_store_return_value (struct type *type, if (len > (callsize > 8 ? 8 : 16)) internal_error (__FILE__, __LINE__, - _("unimplemented for this length: %d"), - TYPE_LENGTH (type)); + _("unimplemented for this length: %s"), + pulongest (TYPE_LENGTH (type))); areg = arreg_number (gdbarch, gdbarch_tdep (gdbarch)->a0_base + 2 + callsize, wb); @@ -1728,18 +1729,18 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int i; - int size, onstack_size; + LONGEST size, onstack_size; gdb_byte *buf = (gdb_byte *) alloca (16); CORE_ADDR ra, ps; struct argument_info { const bfd_byte *contents; - int length; + LONGEST length; int onstack; /* onstack == 0 => in reg */ int align; /* alignment */ union { - int offset; /* stack offset if on stack. */ + LONGEST offset; /* stack offset if on stack. */ int regno; /* regno if in register. */ } u; }; @@ -1763,9 +1764,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); - fprintf_unfiltered (gdb_stdlog, "%2d: %s %3d ", i, - host_address_to_string (arg), - TYPE_LENGTH (arg_type)); + const char *arg_type_len_s = pulongest (TYPE_LENGTH (arg_type)); + + fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i, + host_address_to_string (arg), arg_type_len_s); switch (TYPE_CODE (arg_type)) { case TYPE_CODE_INT: ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [1/2][PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-18 10:31 ` [1/2][PATCH " Siddhesh Poyarekar @ 2012-06-20 15:47 ` Jan Kratochvil 2012-06-20 16:32 ` Siddhesh Poyarekar 2012-06-23 1:59 ` Siddhesh Poyarekar 0 siblings, 2 replies; 70+ messages in thread From: Jan Kratochvil @ 2012-06-20 15:47 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey On Mon, 18 Jun 2012 12:30:27 +0200, Siddhesh Poyarekar wrote: > * Remove blocks that do not record changes, i.e. of the type: > > --- 8< ----- > LOC... | > foo... |=> Remove this. > bar... | > --- 8< ----- > [ -+]LOC... BTW these are already removed by "locdiff" itself, why another pass? > If these changes are OK, then I'll record my review on the resultant > locdiff.processed.out, which is 2330 lines now. I have difficulties to say anything specific about that file as we have different source files (particularly the "files" list of GDB source files). Therefore I packaged it all as: http://people.redhat.com/jkratoch/splint.tar.xz Particularly I tried to convince splint to process also these two files: interps.c.out:*** Segmentation Violation symtab.c.out:*** Segmentation Violation But there isn't anything LONGEST-interesting there anyway. But I find my "files" files is slightly more rich with several files needing an update (such as linux-record.c from a brief check). Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [1/2][PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-20 15:47 ` Jan Kratochvil @ 2012-06-20 16:32 ` Siddhesh Poyarekar 2012-06-20 17:25 ` Jan Kratochvil 2012-06-23 1:59 ` Siddhesh Poyarekar 1 sibling, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-06-20 16:32 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey On Wed, 20 Jun 2012 17:47:20 +0200, Jan wrote: > On Mon, 18 Jun 2012 12:30:27 +0200, Siddhesh Poyarekar wrote: > > * Remove blocks that do not record changes, i.e. of the type: > > > > --- 8< ----- > > LOC... | > > foo... |=> Remove this. > > bar... | > > --- 8< ----- > > [ -+]LOC... > > BTW these are already removed by "locdiff" itself, why another pass? There still were many such instances I found. > > If these changes are OK, then I'll record my review on the resultant > > locdiff.processed.out, which is 2330 lines now. > > I have difficulties to say anything specific about that file as we > have different source files (particularly the "files" list of GDB > source files). > > Therefore I packaged it all as: > http://people.redhat.com/jkratoch/splint.tar.xz Oh right, I took files as the list of files that got changed in the patch since I simply assumed that that was what you were using -- I should have asked. > Particularly I tried to convince splint to process also these two > files: interps.c.out:*** Segmentation Violation > symtab.c.out:*** Segmentation Violation > But there isn't anything LONGEST-interesting there anyway. > > But I find my "files" files is slightly more rich with several files > needing an update (such as linux-record.c from a brief check). > I'll look through this again. Thanks, Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [1/2][PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-20 16:32 ` Siddhesh Poyarekar @ 2012-06-20 17:25 ` Jan Kratochvil 0 siblings, 0 replies; 70+ messages in thread From: Jan Kratochvil @ 2012-06-20 17:25 UTC (permalink / raw) To: Siddhesh Poyarekar; +Cc: gdb-patches, Tom Tromey On Wed, 20 Jun 2012 18:32:52 +0200, Siddhesh Poyarekar wrote: > On Wed, 20 Jun 2012 17:47:20 +0200, Jan wrote: > > On Mon, 18 Jun 2012 12:30:27 +0200, Siddhesh Poyarekar wrote: > > > * Remove blocks that do not record changes, i.e. of the type: [...] > > BTW these are already removed by "locdiff" itself, why another pass? > > There still were many such instances I found. OK, those were before the previous unprocessed final message: Finished checking --- 3668 code warnings Thanks, Jan ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [1/2][PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-20 15:47 ` Jan Kratochvil 2012-06-20 16:32 ` Siddhesh Poyarekar @ 2012-06-23 1:59 ` Siddhesh Poyarekar 1 sibling, 0 replies; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-06-23 1:59 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey On Wed, 20 Jun 2012 17:47:20 +0200, Jan wrote: > I have difficulties to say anything specific about that file as we > have different source files (particularly the "files" list of GDB > source files). > > Therefore I packaged it all as: > http://people.redhat.com/jkratoch/splint.tar.xz > I'm using splint-bitpos2.locdiff.processed from the above tarball for the review. Will post once I'm done. Regards, Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [2/2][PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST 2012-06-12 14:35 ` Jan Kratochvil 2012-06-18 10:31 ` [1/2][PATCH " Siddhesh Poyarekar @ 2012-06-18 10:31 ` Siddhesh Poyarekar 1 sibling, 0 replies; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-06-18 10:31 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey [-- Attachment #1: Type: text/plain, Size: 105 bytes --] This is part 2/2, which has the script and output that I will be using for the review. regards, Siddhesh [-- Attachment #2: process-locdiff --] [-- Type: application/octet-stream, Size: 7752 bytes --] #! /usr/bin/perl use strict; use warnings; @ARGV==1 or die; sub readfile($) { my($fname)=@_; local *F; open F,$fname or die $fname; my $F=do { local $/; <F>; }; defined $F or die $fname; close F or die $fname; return $F; } # Figure out which changes are safe based on the warnings before and after the # change. We could simply check $f[1] and $t[1] for compatibility of types, # but checking both the old and new changes allows us to retain places where we # have accidentally changed signs. sub safe_change($$) { my($ref_from, $ref_to) = @_; my @f = @{$ref_from}; my @t = @{$ref_to}; # It is OK if the warnings before and after were only for the sign of # the assignment or comparison. if ($f[0] eq "int" && $f[1] eq "LONGEST" && $t[0] eq "UINT" && $t[1] eq "ULONGEST") { return 1; } # Likewise for reverse sign. if ($f[0] eq "UINT" && $f[1] eq "ULONGEST" && $t[0] eq "int" && $t[1] eq "LONGEST") { return 1; } # If the earlier the target was larger but with a different sign and # now we have the same size but different sign, then we're still OK. if ($f[0] eq "int" && $f[1] eq "LONGEST" && $t[0] eq "ULONGEST" && $t[1] eq "ULONGEST") { return 1; } # Likewise for reverse sign. if ($f[0] eq "UINT" && $f[1] eq "ULONGEST" && $t[0] eq "LONGEST" && $t[1] eq "LONGEST") { return 1; } # If the earlier the target was smaller but with a different sign and # now we have the same size but different sign then we have actually # fixed something. if ($f[0] eq "LONGEST" && $f[1] eq "LONGEST" && $t[0] eq "UINT" && $t[1] eq "ULONGEST") { return 1; } # Likewise for reverse sign. if ($f[0] eq "ULONGEST" && $f[1] eq "ULONGEST" && $t[0] eq "int" && $t[1] eq "LONGEST") { return 1; } # If we simply grew the target type without changing the sign, we're # fine there too. if ($f[0] eq "UINT" && $f[1] eq "UINT" && $t[0] eq "int" && $t[1] eq "LONGEST") { return 1; } # Likewise for reverse sign. if ($f[0] eq "int" && $f[1] eq "int" && $t[0] eq "UINT" && $t[1] eq "ULONGEST") { return 1; } # Similar logic for (s)size_t. size_t will always be smaller than or # equal to LONGEST/ULONGEST, so treat it as if it were smaller and use # the same logic as above. if ($f[0] eq "size_t" && $f[1] eq "size_t" && $t[0] eq "int" && $t[1] eq "LONGEST") { return 1; } if ($f[0] eq "size_t" && $f[1] eq "ULONGEST" && $t[0] eq "LONGEST" && $t[1] eq "LONGEST") { return 1; } if ($f[0] eq "ssize_t" && $f[1] eq "ssize_t" && $t[0] eq "UINT" && $t[1] eq "ULONGEST") { return 1; } if ($f[0] eq "ssize_t" && $f[1] eq "LONGEST" && $t[0] eq "ULONGEST" && $t[1] eq "ULONGEST") { return 1; } return 0; } # Read in the file and prepare it so that we can run our future regexes easily. my $f = readfile $ARGV[0]; $f=~s{unsigned long int}{"ULONGEST";}egm; $f=~s{long int}{"LONGEST";}egm; $f=~s{unsigned int}{"UINT";}egm; # 0 = Assignment of... # 1 = Function <func> expects arg <num>... # 2 = Function *signed_integer expects arg 2... # 3 = Variable <var> initialized to type ... my $match = -1; my $look = -1; my @savelines; my @from; my @to; my @expr; my @var; my @argnum; # Walk through the file. LINE: for(split /^/, $f) { my $line = $_; # Skip blank lines next LINE if /^\s*$/; # Skip summary lines next LINE if /^[-+]Finished checking/; # Skip command warnings. next LINE if /^ Command Line: Setting/; next LINE if /^ Splint 3\.1\.2 ---/; # Found a LOC. We look at the next lines. if ($look < 0 && /^\s+LOC/) { push @savelines, $_; $look = 0; next LINE; } # We're looking at the next lines. elsif ($look >= 0) { my $l = $_; # Make sure that the type promotions are safe. See safe_change # for details if (($look == 0 || $match == 0) && /Assignment of (\w+) to (\w+):(.*)$/) { push @from, $1; push @to, $2; push @expr, $3; push @savelines, $l; $line = ""; $look += 1; $match = 0; next LINE if $look == 1; # only if we're talking about the same expression if (($expr[0] eq $expr[1]) && safe_change (\@from, \@to)) { # Skip the changeset. $#savelines = -1; } goto done; } # The (store|extract)_(un)?signed_integer functions always have # a primitive size in arg 2 and hence this warning is moot for # this change.. if (($look == 0 || $match == 2) && /Function ((extract)|(store))?_(long_)?(un)?signed_integer expects arg 2 to be int/) { $line = ""; push @savelines, $l; $look += 1; $match = 2; next LINE if $look == 1; $#savelines = -1; goto done; } # Analogous change to the Assignment change above. Again, see # safe_change function for details. if (($look == 0 || $match == 1) && /Function (\w+) expects arg (\d) to be (\w+) gets (\w+): (.*)$/) { push @var, $1; push @argnum, $2; push @to, $3; push @from, $4; push @expr, $5; push @savelines, $l; $line = ""; $look += 1; $match = 1; next LINE if $look == 1; # only if we're talking about the same expression if (($expr[0] eq $expr[1]) && ($var[0] eq $var[1]) && ($argnum[0] eq $argnum[1]) && (safe_change (\@from, \@to))) { # Skip the changeset. $#savelines = -1; } goto done; } # Analogous change to the Function change above. if (($look == 0 || $match == 3) && /Variable (\w+) initialized to type (\w+), expects (\w+): (.*)$/) { push @var, $1; push @to, $3; push @from, $2; push @expr, $4; push @savelines, $l; $line = ""; $look += 1; $match = 3; next LINE if $look == 1; # only if we're talking about the same expression if (($expr[0] eq $expr[1]) && ($var[0] eq $var[1]) && (safe_change (\@from, \@to))) { # Skip the changeset. $#savelines = -1; } goto done; } # Skip non-boolean warnings. if (($look == 0 || $match == 4) && /Test expression for (\w+) not boolean/) { $line = ""; push @savelines, $l; $look += 1; $match = 4; next LINE if $look == 1; $#savelines = -1; goto done; } # These warnings are again not a result of our change. if (($look == 0 || $match == 5) && /New fresh storage \(type (\w+) \*\) passed as implicitly temp/) { $line = ""; push @savelines, $l; $look += 1; $match = 5; next LINE if $look == 1; $#savelines = -1; goto done; } if (($look == 0 || $match == 6) && /Operands of ([^\s]+) have incompatible types \((\w+), (\w+)\): (.*)$/) { push @var, $1; push @to, $2; push @from, $3; push @expr, $4; push @savelines, $l; $line = ""; $look += 1; $match = 6; next LINE if $look == 1; # ULONGEST to LONGEST comparisons are safe. if (($expr[0] eq $expr[1]) && (($from[1] eq "LONGEST" && $to[1] eq "ULONGEST") || ($from[1] eq "ULONGEST" && $to[1] eq "LONGEST")) ) { # Skip the changeset. $#savelines = -1; } goto done; } # Remove blocks that are not really changes at all # We only drop complete blocks, i.e. something that is nested by # two LOC lines and the first LOC is preceded by a space. if ($look == 0 || $match == 7) { # Got the next LOC. if (/^([ -+])\s*LOC/) { $#savelines = -1; push @savelines, $l; if ($1 eq " ") { $look = 0; $match = -1; next LINE; } } # Anything else, we just schedule to remove. elsif (/^ /) { $line = ""; push @savelines, $l; $look += 1; $match = 7; next LINE; } goto done; } } # The next lines didn't work out as expected, so clear and print # everything out as if nothing happened. done: $look = -1; foreach(@savelines) { print $_; } print $line; $#savelines = -1; $#var = -1; $#argnum = -1; $#from = -1; $#to = -1; $#expr = -1; } [-- Attachment #3: locdiff.processed.out --] [-- Type: application/octet-stream, Size: 137942 bytes --] --- /tmp/locdiff.9926.a 2012-06-18 14:55:12.760242020 +0530 +++ /tmp/locdiff.9926.b 2012-06-18 14:55:13.402242035 +0530 @@ -1,384543 +1,384866 @@ LOC ada-lang.c:579 (ada-lang.c:578) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC ada-lang.c:670 (ada-lang.c:669) - Function umax_of_size expects arg 1 to be int gets UINT: (t)->length + Function umax_of_size expects arg 1 to be int gets ULONGEST: (t)->length LOC ada-lang.c:672 (ada-lang.c:671) - Function max_of_size expects arg 1 to be int gets UINT: (t)->length + Function max_of_size expects arg 1 to be int gets ULONGEST: (t)->length ada-lang.c: (in function min_of_type) LOC ada-lang.c:682 (ada-lang.c:681) - Function min_of_size expects arg 1 to be int gets UINT: (t)->length + Function min_of_size expects arg 1 to be int gets ULONGEST: (t)->length ada-lang.c: (in function ada_discrete_type_high_bound) LOC ada-lang.c:1622 (ada-lang.c:1621) - Return value type UINT does not match declared type int: 8 * (ada_check_typedef((((type)->main_type->flds_bnds.fields[1]).type)))->length + Return value type ULONGEST does not match declared type int: 8 * (ada_check_typedef((((type)->main_type->flds_bnds.fields[1]).type)))->length LOC ada-lang.c:1688 (ada-lang.c:1687) - Return value type UINT does not match declared type int: 8 * ((((type)->main_type->flds_bnds.fields[0]).type))->length + Return value type ULONGEST does not match declared type int: 8 * ((((type)->main_type->flds_bnds.fields[0]).type))->length LOC ada-lang.c:1724 (ada-lang.c:1723) - Return value type UINT does not match declared type int: 8 * ((((type)->main_type->flds_bnds.fields[2 * i + which - 2]).type))->length + Return value type ULONGEST does not match declared type int: 8 * ((((type)->main_type->flds_bnds.fields[2 * i + which - 2]).type))->length LOC ada-lang.c:1899 (ada-lang.c:1896) - Variable array_bitsize initialized to type LONGEST, expects int: (hi - lo + 1) * (((elt_type)->main_type->flds_bnds.fields[0]).bitsize) -LOC ada-lang.c:1898 - Assignment of int to UINT: (array_type)->length = (array_bitsize + 7) / 8 + Assignment of LONGEST to ULONGEST: (array_type)->length = (array_bitsize + 7) / 8 +LOC ada-lang.c:2185 + Function ada_value_primitive_packed_val expects arg 4 to be int gets LONGEST: bit_pos % 8 LOC ada-lang.c:2338 (ada-lang.c:2322) - Function set_value_offset expects arg 2 to be int gets LONGEST: new_offset -LOC ada-lang.c:2335 - Assignment of UINT to int: ntarg = (type)->length + Assignment of ULONGEST to LONGEST: ntarg = (type)->length LOC ada-lang.c:2342 (ada-lang.c:2339) - Function memset expects arg 3 to be size_t gets UINT: (type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (type)->length +LOC ada-lang.c:2379 + Assignment of LONGEST to int: src = targ = 0 LOC ada-lang.c:2445 (ada-lang.c:2448) + Assignment of LONGEST to int: accum_bits = 8 - src_offset +LOC ada-lang.c:2451 Incompatible types for + (UINT, unsigned char): (accum << 8) + (unsigned char)*source LOC ada-lang.c:2455 + Operands of > have incompatible types (int, LONGEST): chunk_size > n +LOC ada-lang.c:2456 + Assignment of LONGEST to int: chunk_size = n +LOC ada-lang.c:2458 Right operand of << may be negative (int): 1 << chunk_size LOC ada-lang.c:2470 (ada-lang.c:2467) - Right operand of >> may be negative (int): (unsigned char)*source >> src_offset + Right operand of >> may be negative (LONGEST): (unsigned char)*source >> src_offset LOC ada-lang.c:2470 (ada-lang.c:2467) - Assignment of unsigned char to UINT: accum = (unsigned char)*source >> src_offset + Assignment of LONGEST to UINT: accum = (unsigned char)*source >> src_offset +LOC ada-lang.c:2472 + Assignment of LONGEST to int: accum_bits = 8 - src_offset LOC ada-lang.c:2480 (ada-lang.c:2479) + Operands of > have incompatible types (int, LONGEST): chunk_size > n +LOC ada-lang.c:2481 + Assignment of LONGEST to int: chunk_size = n +LOC ada-lang.c:2482 Right operand of << may be negative (int): 1 << chunk_size LOC ada-lang.c:2545 (ada-lang.c:2542) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC ada-lang.c:4094 (ada-lang.c:4091) - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ada-lang.c:4138 (ada-lang.c:4135) - Function memcpy expects arg 3 to be size_t gets UINT: (actual_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (actual_type)->length LOC ada-lang.c:4163 (ada-lang.c:4160) - Function C_alloca expects arg 1 to be size_t gets UINT: len + Function C_alloca expects arg 1 to be size_t gets ULONGEST: len LOC ada-lang.c:6431 (ada-lang.c:6426) + Function ada_value_primitive_packed_val expects arg 4 to be int gets LONGEST: bit_pos % 8 +LOC ada-lang.c:6429 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents(arg1) LOC ada-lang.c:6489 + Assignment of LONGEST to int: *bit_offset_p = bit_pos % 8 +LOC ada-lang.c:6492 Fresh storage type not released before return LOC ada-lang.c:7430 (ada-lang.c:7427) - Assignment of UINT to LONGEST: off = align_value(off, field_alignment(type, f)) + ((((type)->main_type->flds_bnds.fields[f]).loc.bitpos) + 0) -LOC ada-lang.c:7429 - Assignment of LONGEST to int: (((rtype)->main_type->flds_bnds.fields[f]).loc.bitpos) = (off) + Assignment of ULONGEST to LONGEST: off = align_value(off, field_alignment(type, f)) + ((((type)->main_type->flds_bnds.fields[f]).loc.bitpos) + 0) LOC ada-lang.c:7524 (ada-lang.c:7521) - Assignment of UINT to int: fld_bit_len = (((rtype)->main_type->flds_bnds.fields[f]).bitsize) = (((type)->main_type->flds_bnds.fields[f]).bitsize) -LOC ada-lang.c:7524 - Assignment of UINT to int: fld_bit_len = (ada_check_typedef(field_type))->length * 8 + Assignment of UINT to LONGEST: fld_bit_len = (((rtype)->main_type->flds_bnds.fields[f]).bitsize) = (((type)->main_type->flds_bnds.fields[f]).bitsize) LOC ada-lang.c:7527 (ada-lang.c:7528) - Assignment of LONGEST to int: bit_len = off + fld_bit_len + Assignment of ULONGEST to LONGEST: fld_bit_len = (ada_check_typedef(field_type))->length * 8 LOC ada-lang.c:7573 (ada-lang.c:7568) - Assignment of LONGEST to int: bit_len = off + fld_bit_len -LOC ada-lang.c:7570 - Function align_value expects arg 1 to be UINT gets int: bit_len + Function align_value expects arg 1 to be ULONGEST gets LONGEST: bit_len LOC ada-lang.c:7927 (ada-lang.c:7924) - Variable len initialized to type UINT, expects int: (result)->length / ((result)->main_type->target_type)->length + Variable len initialized to type ULONGEST, expects LONGEST: ((result)->length / ((result)->main_type->target_type)->length) LOC ada-lang.c:8739 (ada-lang.c:8735) - Function memcmp expects arg 3 to be size_t gets UINT: (value_type(arg1))->length + Function memcmp expects arg 3 to be size_t gets ULONGEST: (value_type(arg1))->length LOC ada-lang.c:8794 (ada-lang.c:8790) - Function ada_index_struct_field expects arg 1 to be int gets LONGEST: index -LOC ada-lang.c:8790 New fresh storage (type struct type *) passed as implicitly temp (not released): value_type(lhs) LOC ada-valprint.c:376 - Function ada_emit_char expects arg 5 to be int gets UINT: (type)->length + Function ada_emit_char expects arg 5 to be int gets ULONGEST: (type)->length ada-valprint.c: (in function ada_print_scalar) LOC ada-valprint.c:483 (ada-valprint.c:491) + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC ada-valprint.c:491 Test expression for if not boolean, type int: quit_flag LOC ada-valprint.c:501 (ada-valprint.c:502) - Function char_at expects arg 2 to be int gets UINT: rep1 + Operands of < have incompatible types (UINT, ULONGEST): rep1 < length +LOC ada-valprint.c:502 + Function char_at expects arg 2 to be LONGEST gets UINT: rep1 LOC ada-valprint.c:553 + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC ada-valprint.c:553 Left operand of || is non-boolean (int): force_ellipses || i < length ada-valprint.c: (in function ada_printstr) LOC ada-valprint.c:563 - Function printstr expects arg 6 to be int gets UINT: (type)->length + Function printstr expects arg 6 to be int gets ULONGEST: (type)->length LOC ada-valprint.c:629 - Operands of < have incompatible types (int, UINT): temp_len < options->print_max + Operands of < have incompatible types (LONGEST, UINT): temp_len < options->print_max LOC ada-valprint.c:631 - Function char_at expects arg 3 to be int gets UINT: eltlen + Function char_at expects arg 3 to be int gets ULONGEST: eltlen LOC ada-valprint.c:636 - Function printstr expects arg 6 to be int gets UINT: eltlen + Function printstr expects arg 6 to be int gets ULONGEST: eltlen LOC ada-valprint.c:964 - Operands of != have incompatible types (UINT, size_t): ((type)->main_type->target_type)->length != sizeof(char) + Operands of != have incompatible types (ULONGEST, size_t): ((type)->main_type->target_type)->length != sizeof(char) LOC ada-valprint.c:1132 (ada-valprint.c:1130) + Function ada_value_primitive_packed_val expects arg 4 to be int gets LONGEST: bit_pos % 8 +LOC ada-valprint.c:1130 Null storage passed as non-null param: ada_value_primitive_packed_val (NULL, ...) +LOC alpha-tdep.c:402 + Assignment of LONGEST to int: accumulate_size = (accumulate_size + m_arg->len + 7) & ~7 LOC alpha-tdep.c:432 - Operands of <= have incompatible types (int, size_t): offset + len <= sizeof((arg_reg_buffer)) + Operands of <= have incompatible types (LONGEST, size_t): offset + len <= sizeof((arg_reg_buffer)) LOC alpha-tdep.c:434 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC alpha-tdep.c:448 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC alpha-tdep.c:534 (alpha-tdep.c:537) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: length +LOC alpha-tdep.c:537 Fresh storage gdbarch not released before return LOC alpha-tdep.c:630 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length amd64-tdep.c: (in function amd64_return_value) LOC amd64-tdep.c:635 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC amd64-tdep.c:698 + Function regcache_raw_read_part expects arg 4 to be int gets LONGEST: ((len) < (8) ? (len) : (8)) +LOC amd64-tdep.c:698 Return value (type enum register_status) ignored: regcache_raw_rea... LOC amd64-tdep.c:701 (amd64-tdep.c:705) + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: ((len) < (8) ? (len) : (8)) +LOC amd64-tdep.c:705 Fresh storage tdep not released before return LOC amd64-tdep.c:824 - Function memcpy expects arg 3 to be size_t gets int: ((len) < (8) ? (len) : (8)) + Function memcpy expects arg 3 to be size_t gets LONGEST: ((len) < (8) ? (len) : (8)) LOC amd64-tdep.c:845 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC amd64-tdep.c:2777 - Function target_read_memory expects arg 3 to be ssize_t gets int: len + Function target_read_memory expects arg 3 to be ssize_t gets LONGEST: len LOC amd64-windows-tdep.c:111 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length +LOC amd64-windows-tdep.c:119 + Function regcache_raw_read_part expects arg 4 to be int gets LONGEST: len LOC amd64-windows-tdep.c:121 (amd64-windows-tdep.c:77) + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len +LOC amd64-windows-tdep.c:77 Parameter gdbarch not used LOC arm-linux-nat.c:932 - Right operand of << may be negative (int): 1 << len + Right operand of << may be negative (LONGEST): 1 << len LOC arm-linux-nat.c:932 - Assignment of int to UINT: mask = (1 << len) - 1 + Assignment of LONGEST to UINT: mask = (1 << len) - 1 LOC arm-tdep.c:3289 - Return value type UINT does not match declared type int: (t)->length + Return value type ULONGEST does not match declared type int: (t)->length LOC arm-tdep.c:3422 - Return value type UINT does not match declared type int: (t)->length / unitlen + Return value type ULONGEST does not match declared type int: (t)->length / unitlen LOC arm-tdep.c:3689 (arm-tdep.c:3690) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC arm-tdep.c:3690 Test expression for if not boolean, type int: arm_pc_is_thumb(gdbarch, regval) LOC arm-tdep.c:3692 - Function C_alloca expects arg 1 to be size_t gets int: len + Function C_alloca expects arg 1 to be size_t gets LONGEST: len +LOC arm-tdep.c:3693 + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len LOC arm-tdep.c:3704 (arm-tdep.c:3706) + Variable partial_len initialized to type LONGEST, expects int: len < 4 ? len : 4 +LOC arm-tdep.c:3706 Left operand of && is non-boolean (int): may_use_core_reg && argreg <= ARM_LAST_ARG_REGNUM avr-tdep.c: (in function avr_pointer_to_address) LOC avr-tdep.c:932 (avr-tdep.c:937) - Operands of < have incompatible types (int, UINT): i < (valtype)->length + Function regcache_cooked_write expects arg 2 to be int gets LONGEST: lsb_reg + i +LOC avr-tdep.c:937 + Operands of < have incompatible types (LONGEST, ULONGEST): i < (valtype)->length LOC avr-tdep.c:938 + Function regcache_cooked_read expects arg 2 to be int gets LONGEST: lsb_reg + i +LOC avr-tdep.c:938 Return value (type enum register_status) ignored: regcache_cooked_... LOC avr-tdep.c:1184 (avr-tdep.c:1183) - Function xmalloc expects arg 1 to be size_t gets int: len + Function xmalloc expects arg 1 to be size_t gets LONGEST: len LOC avr-tdep.c:1185 + Assignment of LONGEST to int: si->len = len +LOC avr-tdep.c:1186 Implicitly only storage si->prev (type struct stack_item *) not released before assignment: si->prev = prev LOC avr-tdep.c:1187 (avr-tdep.c:1186) - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len avr-tdep.c: (in function avr_push_dummy_call) +LOC avr-tdep.c:1286 + Test expression for if not boolean, type LONGEST: len & 1 LOC avr-tdep.c:1289 (avr-tdep.c:1285) - Test expression for if not boolean, type int: len & 1 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len LOC avr-tdep.c:1290 (avr-tdep.c:1291) - Right operand of >> may be negative (int): val >> (8 * (len - j - 1)) + Operands of < have incompatible types (int, LONGEST): j < len +LOC avr-tdep.c:1292 + Right operand of >> may be negative (LONGEST): val >> (8 * (len - j - 1)) LOC ax-gdb.c:486 (ax-gdb.c:485) - Function ax_ext expects arg 2 to be int gets UINT: (type)->length * 8 + Function ax_ext expects arg 2 to be int gets ULONGEST: (type)->length * 8 ax-gdb.c: (in function gen_extend) LOC ax-gdb.c:496 (ax-gdb.c:495) - Variable bits initialized to type UINT, expects int: (type)->length * 8 + Variable bits initialized to type ULONGEST, expects int: (type)->length * 8 LOC ax-gdb.c:512 (ax-gdb.c:511) - Function ax_trace_quick expects arg 2 to be int gets UINT: (type)->length + Function ax_trace_quick expects arg 2 to be int gets ULONGEST: (type)->length -LOC ax-gdb.c:597 - Function gen_offset expects arg 2 to be int gets LONGEST: frame_offset ax-gdb.c: (in function gen_frame_locals_address) -LOC ax-gdb.c:612 - Function gen_offset expects arg 2 to be int gets LONGEST: frame_offset -ax-gdb.c: (in function gen_sym_offset) -LOC ax-gdb.c:646 - Function gen_offset expects arg 2 to be int gets LONGEST: (var)->ginfo.value.ivalue ax-gdb.c: (in function gen_var_ref) ax-gdb.c: (in function gen_ptradd) LOC ax-gdb.c:1424 (ax-gdb.c:1427) + Function expects arg 2 to be int gets LONGEST: end - start +LOC ax-gdb.c:1428 Implicitly only storage value->type (type struct type *) not released before assignment: value->type = type ax-gdb.c: (in function gen_primitive_field) LOC bfin-tdep.c:538 - Function write_memory expects arg 3 to be ssize_t gets int: container_len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: container_len LOC breakpoint.c:2169 (breakpoint.c:2175) + Assignment of LONGEST to int: bl->target_info.length = bl->length +LOC breakpoint.c:2176 Test expression for if not boolean, type int: is_breakpoint(bl->owner) LOC breakpoint.c:4390 (breakpoint.c:4387) + Function expects arg 4 to be int gets LONGEST: loc->length +LOC breakpoint.c:4388 Test expression for if not boolean, type int: (*¤t_target.to_watchpoint_addr_within_range)(¤t_target, addr, loc->address, loc->length) LOC breakpoint.c:6365 (breakpoint.c:6362) - Operands of && are non-boolean (int): bl->length && breakpoint_address_match_range(bl->pspace->aspace, bl->address, bl->length, aspace, addr) + Function breakpoint_address_match_range expects arg 3 to be int gets LONGEST: bl->length +LOC breakpoint.c:6363 + Operands of && are non-booleans (LONGEST, int): bl->length && breakpoint_address_match_range(bl->pspace->aspace, bl->address, bl->length, aspace, addr) LOC breakpoint.c:9486 (breakpoint.c:9485) Return value (type int) ignored: create_breakpoin... +breakpoint.c: (in function breakpoint_hit_ranged_breakpoint) +LOC breakpoint.c:9513 + Function breakpoint_address_match_range expects arg 3 to be int gets LONGEST: bl->length breakpoint.c: (in function resources_needed_ranged_breakpoint) LOC breakpoint.c:15558 (breakpoint.c:15557) - Function observer_attach_memory_changed expects arg 1 to be observer_memory_changed_ftype * gets [function (CORE_ADDR, int, bfd_byte *) returns void]: invalidate_bp_value_on_memory_change + Function observer_attach_memory_changed expects arg 1 to be observer_memory_changed_ftype * gets [function (CORE_ADDR, LONGEST, bfd_byte *) returns void]: invalidate_bp_value_on_memory_change LOC c-lang.c:205 - Variable width initialized to type UINT, expects int: (type)->length + Variable width initialized to type ULONGEST, expects int: (type)->length LOC c-lang.c:292 - Assignment of UINT to int: width = (element_type)->length + Assignment of ULONGEST to int: width = (element_type)->length LOC c-lang.c:418 - Function C_alloca expects arg 1 to be size_t gets UINT: (type)->length + Function C_alloca expects arg 1 to be size_t gets ULONGEST: (type)->length LOC c-lang.c:674 (c-lang.c:675) + Operands of != have incompatible types (UINT, ULONGEST): (UINT)((&output)->next_free - (&output)->object_base) != (type)->length +LOC c-lang.c:675 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Could not convert character " "constant to target character set") LOC c-lang.c:697 - Assignment of UINT to LONGEST: high_bound = ((expect_type)->length / element_size) - 1 -LOC c-lang.c:699 - Operands of > have incompatible types (UINT, LONGEST): (UINT)((&output)->next_free - (&output)->object_base) / element_size > (high_bound - low_bound + 1) + Assignment of ULONGEST to LONGEST: high_bound = ((expect_type)->length / element_size) - 1 LOC cp-abi.c:96 - Path with no return in function declared to return int + Path with no return in function declared to return LONGEST LOC cp-valprint.c:363 (cp-valprint.c:366) + Variable i_offset initialized to type LONGEST, expects int: offset + ((((type)->main_type->flds_bnds.fields[i]).loc.bitpos) + 0) / 8 +LOC cp-valprint.c:366 Test expression for if not boolean, type int: valprint_check_validity(stream, i_type, i_offset, val) LOC cp-valprint.c:560 (cp-valprint.c:559) - Function C_alloca expects arg 1 to be size_t gets UINT: (baseclass)->length + Function C_alloca expects arg 1 to be size_t gets ULONGEST: (baseclass)->length LOC cp-valprint.c:563 (cp-valprint.c:562) - Function target_read_memory expects arg 3 to be ssize_t gets UINT: (baseclass)->length + Function target_read_memory expects arg 3 to be ssize_t gets ULONGEST: (baseclass)->length LOC cris-tdep.c:683 - Function xmalloc expects arg 1 to be size_t gets int: len + Function xmalloc expects arg 1 to be size_t gets LONGEST: len LOC cris-tdep.c:684 (cris-tdep.c:685) + Assignment of LONGEST to int: si->len = len +LOC cris-tdep.c:685 Implicitly only storage si->prev (type struct stack_item *) not released before assignment: si->prev = prev LOC cris-tdep.c:686 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len cris-tdep.c: (in function cris_frame_unwind_cache) LOC cris-tdep.c:899 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len +LOC cris-tdep.c:1670 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len LOC cris-tdep.c:1678 (cris-tdep.c:1682) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len - 4 +LOC cris-tdep.c:1682 New fresh storage (type char *) passed as implicitly temp (not released): gettext("cris_store_return_value: type length too large.") LOC cris-tdep.c:1842 (cris-tdep.c:1847) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC cris-tdep.c:1847 Passed storage &val not completely defined: regcache_cooked_read_unsigned (..., &val) LOC cris-tdep.c:1850 (cris-tdep.c:1853) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len - 4 +LOC cris-tdep.c:1853 New fresh storage (type char *) passed as implicitly temp (not released): gettext("cris_extract_return_value: type length too large") LOC doublest.c:794 - Operands of == have incompatible types (int, UINT): len * 8 == gdbarch_long_double_format(gdbarch)[0]->totalsize + Operands of == have incompatible types (LONGEST, UINT): len * 8 == gdbarch_long_double_format(gdbarch)[0]->totalsize LOC doublest.c:857 - Function memset expects arg 3 to be size_t gets UINT: (type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (type)->length LOC doublest.c:883 - Function memset expects arg 3 to be size_t gets UINT: (to_type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (to_type)->length LOC doublest.c:893 - Function memset expects arg 3 to be size_t gets UINT: (to_type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (to_type)->length LOC doublest.c:894 - Function memcpy expects arg 3 to be size_t gets UINT: (((from_type)->length) < ((to_type)->length) ? ((from_type)->length) : ((to_type)->length)) + Function memcpy expects arg 3 to be size_t gets ULONGEST: (((from_type)->length) < ((to_type)->length) ? ((from_type)->length) : ((to_type)->length)) LOC dwarf2loc.c:1279 - Function memcpy expects arg 3 to be size_t gets UINT: (checked_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (checked_type)->length LOC dwarf2loc.c:1496 (dwarf2loc.c:1503) + Assignment of ULONGEST to UINT: source_offset_bits = source_offset % 8 +LOC dwarf2loc.c:1498 + Assignment of ULONGEST to UINT: dest_avail = 8 - dest_offset_bits % 8 +LOC dwarf2loc.c:1501 + Operands of < have incompatible types (UINT, ULONGEST): dest_avail < bit_count +LOC dwarf2loc.c:1503 Function extract_bits expects arg 3 to be int gets UINT: dest_avail LOC dwarf2loc.c:1505 + Function insert_bits expects arg 3 to be UINT gets ULONGEST: dest_offset_bits +LOC dwarf2loc.c:1505 Function insert_bits expects arg 4 to be int gets UINT: dest_avail LOC dwarf2loc.c:1524 - Function extract_bits expects arg 3 to be int gets UINT: bit_count + Function extract_bits expects arg 3 to be int gets ULONGEST: bit_count LOC dwarf2loc.c:1526 - Function insert_bits expects arg 4 to be int gets UINT: bit_count + Function insert_bits expects arg 3 to be UINT gets ULONGEST: dest_offset_bits +LOC dwarf2loc.c:1526 + Function insert_bits expects arg 4 to be int gets ULONGEST: bit_count dwarf2loc.c: (in function read_pieced_value) LOC dwarf2loc.c:1559 - Assignment of int to size_t: type_len = value_bitsize(v) -LOC dwarf2loc.c:1562 - Assignment of UINT to size_t: type_len = 8 * (value_type(v))->length + Assignment of int to ULONGEST: type_len = value_bitsize(v) LOC dwarf2loc.c:1584 (dwarf2loc.c:1573) - Assignment of ULONGEST to size_t: this_size_bits = p->size + Assignment of ULONGEST to LONGEST: source_offset_bits = bits_to_skip LOC dwarf2loc.c:1596 (dwarf2loc.c:1574) - Operands of >= have incompatible types (ULONGEST, size_t): bits_to_skip >= this_size_bits + Operands of < have incompatible types (size_t, ULONGEST): buffer_size < this_size LOC dwarf2loc.c:1598 (dwarf2loc.c:1584) - Assignment of ULONGEST to LONGEST: source_offset_bits = bits_to_skip + Assignment of ULONGEST to size_t: buffer_size = this_size LOC dwarf2loc.c:1613 - Operands of < have incompatible types (size_t, int): this_size < register_size(arch, gdb_regnum) + Operands of < have incompatible types (ULONGEST, int): this_size < register_size(arch, gdb_regnum) LOC dwarf2loc.c:1616 - Assignment of arbitrary UINTegral type to int: reg_offset = register_size(arch, gdb_regnum) - this_size + Assignment of ULONGEST to int: reg_offset = register_size(arch, gdb_regnum) - this_size LOC dwarf2loc.c:1627 - Function get_frame_register_bytes expects arg 4 to be int gets size_t: this_size + Function get_frame_register_bytes expects arg 4 to be int gets ULONGEST: this_size LOC dwarf2loc.c:1631 (dwarf2loc.c:1633) + Function memset expects arg 3 to be size_t gets ULONGEST: this_size +LOC dwarf2loc.c:1633 Test expression for if not boolean, type int: optim LOC dwarf2loc.c:1636 - Function mark_value_bytes_unavailable expects arg 2 to be int gets LONGEST: offset -LOC dwarf2loc.c:1636 - Function mark_value_bytes_unavailable expects arg 3 to be int gets size_t: this_size + Function mark_value_bytes_unavailable expects arg 3 to be LONGEST gets ULONGEST: this_size LOC dwarf2loc.c:1651 + Function read_value_memory expects arg 6 to be size_t gets ULONGEST: this_size +LOC dwarf2loc.c:1651 Null storage buffer passed as non-null param: read_value_memory (..., buffer, ...) LOC dwarf2loc.c:1656 (dwarf2loc.c:1658) + Variable n initialized to type ULONGEST, expects size_t: this_size +LOC dwarf2loc.c:1658 Operands of > have incompatible types (size_t, LONGEST): n > c->addr_size - source_offset LOC dwarf2loc.c:1677 (dwarf2loc.c:1679) + Variable n initialized to type ULONGEST, expects size_t: this_size +LOC dwarf2loc.c:1679 Operands of > have incompatible types (size_t, ULONGEST): n > p->v.literal.length - source_offset LOC dwarf2loc.c:1704 - Function copy_bitwise expects arg 4 to be UINT gets LONGEST: source_offset_bits % 8 -LOC dwarf2loc.c:1705 - Function copy_bitwise expects arg 5 to be UINT gets size_t: this_size_bits + Function copy_bitwise expects arg 4 to be ULONGEST gets LONGEST: source_offset_bits % 8 LOC dwarf2loc.c:1743 - Assignment of int to size_t: type_len = value_bitsize(to) -LOC dwarf2loc.c:1746 - Assignment of UINT to size_t: type_len = 8 * (value_type(to))->length + Assignment of int to ULONGEST: type_len = value_bitsize(to) LOC dwarf2loc.c:1766 (dwarf2loc.c:1756) - Assignment of ULONGEST to size_t: this_size_bits = p->size + Assignment of ULONGEST to LONGEST: dest_offset_bits = bits_to_skip LOC dwarf2loc.c:1787 (dwarf2loc.c:1757) - Operands of >= have incompatible types (ULONGEST, size_t): bits_to_skip >= this_size_bits + Operands of < have incompatible types (size_t, ULONGEST): buffer_size < this_size LOC dwarf2loc.c:1789 (dwarf2loc.c:1766) - Assignment of ULONGEST to LONGEST: dest_offset_bits = bits_to_skip + Assignment of ULONGEST to size_t: buffer_size = this_size LOC dwarf2loc.c:1805 - Operands of <= have incompatible types (size_t, int): this_size <= register_size(arch, gdb_regnum) + Operands of <= have incompatible types (ULONGEST, int): this_size <= register_size(arch, gdb_regnum) LOC dwarf2loc.c:1807 - Assignment of arbitrary UINTegral type to int: reg_offset = register_size(arch, gdb_regnum) - this_size + Assignment of ULONGEST to int: reg_offset = register_size(arch, gdb_regnum) - this_size LOC dwarf2loc.c:1816 - Function get_frame_register_bytes expects arg 4 to be int gets size_t: this_size + Function get_frame_register_bytes expects arg 4 to be int gets ULONGEST: this_size LOC dwarf2loc.c:1829 - Function copy_bitwise expects arg 2 to be UINT gets LONGEST: dest_offset_bits -LOC dwarf2loc.c:1830 - Function copy_bitwise expects arg 4 to be UINT gets LONGEST: source_offset_bits + Function copy_bitwise expects arg 2 to be ULONGEST gets LONGEST: dest_offset_bits LOC dwarf2loc.c:1830 (dwarf2loc.c:1831) - Function copy_bitwise expects arg 5 to be UINT gets size_t: this_size_bits + Function copy_bitwise expects arg 4 to be ULONGEST gets LONGEST: source_offset_bits LOC dwarf2loc.c:1836 - Function put_frame_register_bytes expects arg 4 to be int gets size_t: this_size + Function put_frame_register_bytes expects arg 4 to be int gets ULONGEST: this_size LOC dwarf2loc.c:1853 - Function copy_bitwise expects arg 2 to be UINT gets LONGEST: dest_offset_bits -LOC dwarf2loc.c:1854 - Function copy_bitwise expects arg 4 to be UINT gets LONGEST: source_offset_bits + Function copy_bitwise expects arg 2 to be ULONGEST gets LONGEST: dest_offset_bits LOC dwarf2loc.c:1854 (dwarf2loc.c:1855) - Function copy_bitwise expects arg 5 to be UINT gets size_t: this_size_bits + Function copy_bitwise expects arg 4 to be ULONGEST gets LONGEST: source_offset_bits LOC dwarf2loc.c:1860 - Function write_memory expects arg 3 to be ssize_t gets size_t: this_size + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: this_size LOC dwarf2loc.c:1902 - Operands of >= have incompatible types (int, size_t): bit_offset >= this_size_bits + Operands of >= have incompatible types (LONGEST, size_t): bit_offset >= this_size_bits dwarf2loc.c: (in function indirect_pieced_value) LOC dwarf2loc.c:2002 (dwarf2loc.c:2001) - Operands of >= have incompatible types (int, size_t): bit_offset >= this_size_bits + Operands of >= have incompatible types (LONGEST, size_t): bit_offset >= this_size_bits LOC dwarf2loc.c:2190 (dwarf2loc.c:2188) - Function set_value_offset expects arg 2 to be int gets LONGEST: byte_offset -LOC dwarf2loc.c:2189 Fresh storage c not released before scope exit LOC dwarf2loc.c:2233 (dwarf2loc.c:2230) - Variable n initialized to type UINT, expects size_t: (value_type(value))->length -LOC dwarf2loc.c:2232 - Operands of > have incompatible types (LONGEST, size_t): byte_offset + (type)->length > n + Operands of > have incompatible types (LONGEST, ULONGEST): byte_offset + (type)->length > n LOC dwarf2loc.c:2256 (dwarf2loc.c:2248) - Operands of > have incompatible types (size_t, UINT): n > (type)->length -LOC dwarf2loc.c:2254 - Assignment of UINT to size_t: n = (type)->length -LOC dwarf2loc.c:2255 Fresh storage objfile_gdbarch not released before scope exit LOC dwarf2loc.c:2257 + Function memcpy expects arg 3 to be size_t gets ULONGEST: n +LOC dwarf2loc.c:2258 Fresh storage value not released before scope exit LOC dwarf2loc.c:2277 (dwarf2loc.c:2276) - Operands of > have incompatible types (size_t, UINT): n > (type)->length + Operands of > have incompatible types (size_t, ULONGEST): n > (type)->length LOC dwarf2loc.c:2283 (dwarf2loc.c:2282) - Assignment of UINT to size_t: n = (type)->length + Assignment of ULONGEST to size_t: n = (type)->length dwarf2read.c: (in function dwarf2_section_buffer_overflow_complaint) LOC dwarf2read.c:6117 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC dwarf2read.c:7763 (dwarf2read.c:7764) + Assignment of size_t to ULONGEST: dlbaton->size = ((attr)->u.blk)->size +LOC dwarf2read.c:7764 Implicitly only storage dlbaton->per_cu (type struct dwarf2_per_cu_data *) not released before assignment: dlbaton->per_cu = cu->per_cu LOC dwarf2read.c:7885 (dwarf2read.c:7882) - Assignment of UINT to size_t: parameter->value_size = ((attr)->u.blk)->size -LOC dwarf2read.c:7885 Implicitly only storage parameter->data_value (type gdb_byte *) not released before assignment: parameter->data_value = NULL LOC dwarf2read.c:7903 (dwarf2read.c:7900) - Assignment of UINT to size_t: parameter->data_value_size = ((attr)->u.blk)->size -LOC dwarf2read.c:7903 Fresh storage loc not released before scope exit LOC dwarf2read.c:8525 (dwarf2read.c:8524) - Assignment of LONGEST to int: ((*fp).loc.bitpos) = (offset * bits_per_byte) -LOC dwarf2read.c:8525 Fresh storage attr (type struct attribute *) not released before assignment: attr = dwarf2_attr(die, DW_AT_bit_offset, cu) LOC dwarf2read.c:8546 (dwarf2read.c:8535) - Assignment of ULONGEST to int: ((*fp).loc.bitpos) = ((((*fp).loc.bitpos) + 0) + ((attr)->u.unsnd)) -LOC dwarf2read.c:8546 Variable bit_offset initialized to type ULONGEST, expects int: ((attr)->u.unsnd) LOC dwarf2read.c:8635 (dwarf2read.c:8633) - Assignment of LONGEST to int: ((*fp).loc.bitpos) = (offset * bits_per_byte) -LOC dwarf2read.c:8635 Implicitly only storage fp->type (type struct type *) not released before assignment: ((*fp).type) = die_type(die, cu) LOC dwarf2read.c:9184 (dwarf2read.c:9177) - Assignment of ULONGEST to UINT: (type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:9184 Test expression for if not boolean, type int: producer_is_icc(cu) LOC dwarf2read.c:9472 (dwarf2read.c:9460) - Assignment of ULONGEST to UINT: (type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:9472 Test expression for if not boolean, type int: die_is_declaration(die, cu) LOC dwarf2read.c:9685 (dwarf2read.c:9682) - Assignment of ULONGEST to UINT: (type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:9685 New fresh storage (type char *) passed as implicitly temp (not released): gettext("DW_AT_byte_size for array type smaller " "than the total size of elements") LOC dwarf2read.c:9758 (dwarf2read.c:9756) - Assignment of ULONGEST to UINT: (set_type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:9758 Fresh storage domain_type not released before return LOC dwarf2read.c:9997 - Operands of != have incompatible types (UINT, int): (type)->length != byte_size + Operands of != have incompatible types (ULONGEST, int): (type)->length != byte_size LOC dwarf2read.c:10009 - Operands of != have incompatible types (UINT, int): (type)->length != byte_size + Operands of != have incompatible types (ULONGEST, int): (type)->length != byte_size LOC dwarf2read.c:10075 (dwarf2read.c:10071) - Assignment of ULONGEST to UINT: (type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:10075 - Assignment of unsigned char to UINT: (type)->length = cu_header->addr_size + Assignment of unsigned char to ULONGEST: (type)->length = cu_header->addr_size LOC dwarf2read.c:10587 - Operands of >= have incompatible types (UINT, int): (int_type)->length >= addr_size + Operands of >= have incompatible types (ULONGEST, int): (int_type)->length >= addr_size LOC dwarf2read.c:10592 - Operands of >= have incompatible types (UINT, int): (int_type)->length >= addr_size + Operands of >= have incompatible types (ULONGEST, int): (int_type)->length >= addr_size LOC dwarf2read.c:10597 - Operands of >= have incompatible types (UINT, int): (int_type)->length >= addr_size + Operands of >= have incompatible types (ULONGEST, int): (int_type)->length >= addr_size LOC dwarf2read.c:10630 (dwarf2read.c:10628) - Assignment of ULONGEST to UINT: (range_type)->length = ((attr)->u.unsnd) -LOC dwarf2read.c:10630 Return value (type struct type *) ignored: set_die_type(die... LOC dwarf2read.c:11686 (dwarf2read.c:11688) + Assignment of UINT to size_t: blk->size = read_2_bytes(abfd, info_ptr) +LOC dwarf2read.c:11688 + Function read_n_bytes expects arg 3 to be UINT gets size_t: blk->size +LOC dwarf2read.c:11688 Implicitly only storage blk->data (type gdb_byte *) not released before assignment: blk->data = read_n_bytes(abfd, info_ptr, blk->size) LOC dwarf2read.c:11694 (dwarf2read.c:11696) + Assignment of UINT to size_t: blk->size = read_4_bytes(abfd, info_ptr) +LOC dwarf2read.c:11696 + Function read_n_bytes expects arg 3 to be UINT gets size_t: blk->size +LOC dwarf2read.c:11696 Implicitly only storage blk->data (type gdb_byte *) not released before assignment: blk->data = read_n_bytes(abfd, info_ptr, blk->size) LOC dwarf2read.c:11730 - Assignment of ULONGEST to UINT: blk->size = read_unsigned_leb128(abfd, info_ptr, &bytes_read) + Assignment of ULONGEST to size_t: blk->size = read_unsigned_leb128(abfd, info_ptr, &bytes_read) +LOC dwarf2read.c:11732 + Function read_n_bytes expects arg 3 to be UINT gets size_t: blk->size LOC dwarf2read.c:11738 (dwarf2read.c:11740) + Assignment of UINT to size_t: blk->size = read_1_byte(abfd, info_ptr) +LOC dwarf2read.c:11740 + Function read_n_bytes expects arg 3 to be UINT gets size_t: blk->size +LOC dwarf2read.c:11740 Implicitly only storage blk->data (type gdb_byte *) not released before assignment: blk->data = read_n_bytes(abfd, info_ptr, blk->size) LOC dwarf2read.c:13295 - Operands of == have incompatible types (UINT, int): ((attr)->u.blk)->size == 1 + leb128_size(&((attr)->u.blk)->data[1]) + Operands of == have incompatible types (size_t, int): ((attr)->u.blk)->size == 1 + leb128_size(&((attr)->u.blk)->data[1]) LOC dwarf2read.c:13760 - Operands of != have incompatible types (UINT, unsigned char): (type)->length != cu_header->addr_size + Operands of != have incompatible types (ULONGEST, unsigned char): (type)->length != cu_header->addr_size LOC dwarf2read.c:13762 - Function dwarf2_const_value_length_mismatch_complaint expects arg 2 to be int gets unsigned char: cu_header->addr_size + Function dwarf2_const_value_length_mismatch_complaint expects arg 2 to be LONGEST gets unsigned char: cu_header->addr_size LOC dwarf2read.c:13795 (dwarf2read.c:13796) - Function dwarf2_const_value_length_mismatch_complaint expects arg 2 to be int gets UINT: blk->size + Operands of != have incompatible types (ULONGEST, size_t): (type)->length != blk->size LOC dwarf2read.c:13796 (dwarf2read.c:13797) - Function dwarf2_const_value_length_mismatch_complaint expects arg 3 to be int gets UINT: (type)->length + Function dwarf2_const_value_length_mismatch_complaint expects arg 2 to be LONGEST gets size_t: blk->size +LOC dwarf2read.c:13797 + Function dwarf2_const_value_length_mismatch_complaint expects arg 3 to be LONGEST gets ULONGEST: (type)->length LOC dwarf2read.c:14734 (dwarf2read.c:14742) + Function pulongest expects arg 1 to be ULONGEST gets size_t: ((&die->attrs[i])->u.blk)->size +LOC dwarf2read.c:14738 + Function pulongest expects arg 1 to be ULONGEST gets size_t: ((&die->attrs[i])->u.blk)->size +LOC dwarf2read.c:14742 Function hex_string expects arg 1 to be LONGEST gets ULONGEST: ((&die->attrs[i])->u.unsnd) LOC dwarf2read.c:15115 (dwarf2read.c:15121) + Assignment of size_t to ULONGEST: retval.size = ((attr)->u.blk)->size +LOC dwarf2read.c:15121 Null storage retval.data returned as non-null: retval LOC dwarf2read.c:15318 - Variable size initialized to type UINT, expects int: blk->size + Variable size initialized to type size_t, expects int: blk->size LOC dwarf2read.c:16577 (dwarf2read.c:16578) + Assignment of size_t to ULONGEST: baton->size = ((attr)->u.blk)->size +LOC dwarf2read.c:16578 Implicitly only storage baton->data (type gdb_byte *) not released before assignment: baton->data = ((attr)->u.blk)->data LOC eval.c:446 (eval.c:445) - Function memcpy expects arg 3 to be size_t gets UINT: (value_type(val))->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (value_type(val))->length LOC eval.c:489 (eval.c:488) - Function memcpy expects arg 3 to be size_t gets int: element_size + Function memcpy expects arg 3 to be size_t gets LONGEST: element_size LOC eval.c:498 (eval.c:497) - Function memcpy expects arg 3 to be size_t gets int: element_size + Function memcpy expects arg 3 to be size_t gets LONGEST: element_size LOC eval.c:611 (eval.c:610) - Operands of > have incompatible types (UINT, int): (type1)->length * 8 > gdbarch_double_bit(gdbarch) + Operands of > have incompatible types (ULONGEST, int): (type1)->length * 8 > gdbarch_double_bit(gdbarch) LOC eval.c:612 (eval.c:611) - Operands of > have incompatible types (UINT, int): (type2)->length * 8 > gdbarch_double_bit(gdbarch) + Operands of > have incompatible types (ULONGEST, int): (type2)->length * 8 > gdbarch_double_bit(gdbarch) LOC eval.c:715 (eval.c:714) - Operands of > have incompatible types (UINT, int): result_len > gdbarch_long_bit(gdbarch) / 8 + Operands of > have incompatible types (ULONGEST, int): result_len > gdbarch_long_bit(gdbarch) / 8 LOC eval.c:722 (eval.c:721) - Operands of > have incompatible types (UINT, int): result_len > gdbarch_long_bit(gdbarch) / 8 + Operands of > have incompatible types (ULONGEST, int): result_len > gdbarch_long_bit(gdbarch) / 8 LOC eval.c:979 (eval.c:978) - Function memset expects arg 3 to be size_t gets UINT: (type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (type)->length LOC eval.c:998 (eval.c:997) - Function memset expects arg 3 to be size_t gets UINT: (expect_type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (expect_type)->length LOC eval.c:1029 (eval.c:1028) - Function memcpy expects arg 3 to be size_t gets int: element_size + Function memcpy expects arg 3 to be size_t gets LONGEST: element_size LOC eval.c:1052 (eval.c:1051) - Function memset expects arg 3 to be size_t gets UINT: (type)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (type)->length LOC findcmd.c:182 - Operands of > have incompatible types (int, size_t): (val_bytes) > (sizeof(int64_t)) + Operands of > have incompatible types (LONGEST, size_t): (val_bytes) > (sizeof(int64_t)) LOC findcmd.c:182 - Conditional clauses are not of same type: (val_bytes) (int), (sizeof(int64_t)) (size_t) + Conditional clauses are not of same type: (val_bytes) (LONGEST), (sizeof(int64_t)) (size_t) LOC findcmd.c:216 - Function memcpy expects arg 3 to be size_t gets int: val_bytes + Function memcpy expects arg 3 to be size_t gets LONGEST: val_bytes findvar.c: (in function signed_pointer_to_address) findvar.c: (in function address_to_signed_pointer) LOC findvar.c:468 + Function store_signed_integer expects arg 2 to be int gets LONGEST: len +LOC findvar.c:468 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents_raw(v) LOC findvar.c:493 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC frv-tdep.c:1129 (frv-tdep.c:1135) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC frv-tdep.c:1135 Passed storage ®val not completely defined: regcache_cooked_read_unsigned (..., ®val) LOC frv-tdep.c:1282 (frv-tdep.c:1286) + Variable partial_len initialized to type LONGEST, expects int: (len < 4 ? len : 4) +LOC frv-tdep.c:1286 Function extract_unsigned_integer expects arg 1 to be gdb_byte * gets char *: val LOC frv-tdep.c:1337 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len frv-tdep.c: (in function frv_return_value) LOC f-valprint.c:85 Return value type LONGEST does not match declared type int: ((((((type))->main_type->flds_bnds.fields[0]).type))->main_type->flds_bnds.bounds->high) -f-valprint.c: (in function f77_get_dynamic_length_of_aggregate) -LOC f-valprint.c:115 - Assignment of int to UINT: (type)->length = (upper_bound - lower_bound + 1) * (check_typedef((type)->main_type->target_type))->length f-valprint.c: (in function f77_create_arrayprint_offset_tbl) LOC f-valprint.c:178 + Operands of < have incompatible types (int, LONGEST): i < (f77_array_offset_tbl[nss][1]) +LOC f-valprint.c:178 Operands of < have incompatible types (int, UINT): (*elts) < options->print_max LOC f-valprint.c:189 (f-valprint.c:194) + Operands of < have incompatible types (int, LONGEST): i < (f77_array_offset_tbl[nss][1]) +LOC f-valprint.c:194 + Operands of < have incompatible types (int, LONGEST): i < (f77_array_offset_tbl[nss][1]) +LOC f-valprint.c:194 Operands of < have incompatible types (int, UINT): (*elts) < options->print_max LOC f-valprint.c:203 (f-valprint.c:206) + Operands of != have incompatible types (int, LONGEST): i != ((f77_array_offset_tbl[nss][1]) - 1) +LOC f-valprint.c:206 Operands of == have incompatible types (int, UINT): *elts == options->print_max - 1 +LOC f-valprint.c:207 + Operands of != have incompatible types (int, LONGEST): i != ((f77_array_offset_tbl[nss][1]) - 1) f-valprint.c: (in function f77_print_array) LOC gdbtypes.c:804 - Operands of > have incompatible types (UINT, size_t): (type)->length > sizeof(LONGEST) + Operands of > have incompatible types (ULONGEST, size_t): (type)->length > sizeof(LONGEST) LOC gdbtypes.c:906 (gdbtypes.c:902) - Assignment of LONGEST to UINT: (result_type)->length = (element_type)->length * (high_bound - low_bound + 1) -LOC gdbtypes.c:906 Test expression for conditional not boolean, type UINT: ((result_type)->main_type->flag_objfile_owned) gdbtypes.c: (in function smash_to_methodptr_type) LOC gdbtypes.c:1653 (gdbtypes.c:1645) - Assignment of ULONGEST to UINT: (type)->length = len -LOC gdbtypes.c:1653 Fresh storage target_type not released before scope exit LOC gdbtypes.c:3681 (gdbtypes.c:3683) + Assignment of LONGEST to int: left = (((f[0]).loc.bitpos) + 0) % alignment +LOC gdbtypes.c:3683 Test expression for if not boolean, type int: left LOC gnu-v2-abi.c:168 (gnu-v2-abi.c:165) - Function set_value_offset expects arg 2 to be int gets LONGEST: value_offset(arg1) + value_as_long(value_field(entry, 0)) -LOC gnu-v2-abi.c:168 Operand of ! is non-boolean (int): !value_lazy(arg1) LOC gnu-v2-abi.c:272 (gnu-v2-abi.c:271) - Left operand of && is non-boolean (int *): top && ((*top) > 0) + Left operand of && is non-boolean (LONGEST *): top && ((*top) > 0) LOC gnu-v2-abi.c:382 (gnu-v2-abi.c:381) - Return value type ULONGEST does not match declared type int: addr - (LONGEST)address + embedded_offset + Return value type ULONGEST does not match declared type LONGEST: addr - (LONGEST)address + embedded_offset LOC gnu-v3-abi.c:346 (gnu-v3-abi.c:345) - Assignment of LONGEST to int: *top_p = -offset_to_top -LOC gnu-v3-abi.c:346 Fresh storage gdbarch not released before return LOC gnu-v3-abi.c:456 - Return value type LONGEST does not match declared type int: base_offset -LOC gnu-v3-abi.c:456 Fresh storage gdbarch not released before return LOC gnu-v3-abi.c:645 - Return value type UINT does not match declared type int: 2 * (builtin_type(gdbarch)->builtin_data_ptr)->length + Return value type ULONGEST does not match declared type int: 2 * (builtin_type(gdbarch)->builtin_data_ptr)->length LOC gnu-v3-abi.c:655 - Variable size initialized to type UINT, expects int: (builtin_type(gdbarch)->builtin_data_ptr)->length + Variable size initialized to type ULONGEST, expects int: (builtin_type(gdbarch)->builtin_data_ptr)->length LOC go-valprint.c:107 (go-valprint.c:109) + Function print_go_string expects arg 3 to be int gets LONGEST: embedded_offset +LOC go-valprint.c:109 Fresh storage type not released before return LOC h8300-tdep.c:675 - Function C_alloca expects arg 1 to be size_t gets int: padded_len + Function C_alloca expects arg 1 to be size_t gets LONGEST: padded_len LOC h8300-tdep.c:677 - Function memset expects arg 3 to be size_t gets int: padded_len + Function memset expects arg 3 to be size_t gets LONGEST: padded_len LOC h8300-tdep.c:679 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC h8300-tdep.c:686 - Right operand of && is non-boolean (int): len > wordsize && len % wordsize + Right operand of && is non-boolean (LONGEST): len > wordsize && len % wordsize LOC h8300-tdep.c:689 - Function write_memory expects arg 3 to be ssize_t gets int: padded_len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: padded_len LOC h8300-tdep.c:716 - Function write_memory expects arg 3 to be ssize_t gets int: padded_len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: padded_len LOC h8300-tdep.c:747 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC h8300-tdep.c:784 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC h8300-tdep.c:851 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC h8300-tdep.c:881 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC h8300-tdep.c:928 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC hppa-tdep.c:740 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC hppa-tdep.c:766 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC hppa-tdep.c:867 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC hppa-tdep.c:889 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC hppa-tdep.c:1026 + Function regcache_cooked_write_part expects arg 4 to be int gets LONGEST: len +LOC hppa-tdep.c:1026 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents(arg) LOC hppa-tdep.c:1062 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len +LOC hppa-tdep.c:1068 + Function regcache_cooked_write_part expects arg 4 to be int gets LONGEST: ((len) < (8) ? (len) : (8)) LOC hppa-tdep.c:1126 - Variable part initialized to type UINT, expects int: (type)->length % 4 + Variable part initialized to type ULONGEST, expects int: (type)->length % 4 LOC hppa-tdep.c:1141 - Operands of < have incompatible types (int, UINT): b < (type)->length + Operands of < have incompatible types (int, ULONGEST): b < (type)->length LOC hppa-tdep.c:1181 (hppa-tdep.c:1183) + Assignment of LONGEST to int: offset = 8 - len +LOC hppa-tdep.c:1183 Test expression for if not boolean, type int: hppa64_floating_p(type) LOC hppa-tdep.c:1203 (hppa-tdep.c:1224) + Assignment of LONGEST to int: offset = 8 - len +LOC hppa-tdep.c:1225 + Function regcache_cooked_read_part expects arg 4 to be int gets LONGEST: ((len) < (8) ? (len) : (8)) +LOC hppa-tdep.c:1224 Return value (type enum register_status) ignored: regcache_cooked_... LOC hppa-tdep.c:1237 (hppa-tdep.c:1156) + Function regcache_cooked_write_part expects arg 4 to be int gets LONGEST: ((len) < (8) ? (len) : (8)) +LOC hppa-tdep.c:1156 Parameter gdbarch not used LOC i386-darwin-tdep.c:132 - Return value type UINT does not match declared type int: (type)->length + Return value type ULONGEST does not match declared type LONGEST: (type)->length LOC i386-darwin-tdep.c:202 - Assignment of ULONGEST to int: args_space = align_up(args_space, align) + Function align_up expects arg 2 to be int gets LONGEST: align +LOC i386-darwin-tdep.c:202 + Assignment of ULONGEST to LONGEST: args_space = align_up(args_space, align) LOC i386-darwin-tdep.c:205 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC i386-nat.c:325 - Operands of || are non-booleans (CORE_ADDR, int): addr || len + Operands of || are non-booleans (CORE_ADDR, LONGEST): addr || len i386-nat.c: (in function i386_length_and_rw_bits) LOC i386-nat.c:531 (i386-nat.c:553) + Conditional clauses are not of same type: (max_wp_len - 1) (int), len - 1 (LONGEST) +LOC i386-nat.c:553 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Invalid value %d of operation in i386_handle_nonaligned_watchpoint.\n") LOC i386-nat.c:613 (i386-nat.c:622) + Function i386_length_and_rw_bits expects arg 1 to be int gets LONGEST: len +LOC i386-nat.c:622 Test expression for if not boolean, type int: maint_show_dr LOC i386-nat.c:647 (i386-nat.c:656) + Function i386_length_and_rw_bits expects arg 1 to be int gets LONGEST: len +LOC i386-nat.c:656 Test expression for if not boolean, type int: maint_show_dr LOC i386-tdep.c:2378 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC i386-tdep.c:2454 - Function memset expects arg 3 to be size_t gets int: len + Function memset expects arg 3 to be size_t gets LONGEST: len LOC i386-tdep.c:2473 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC i386-tdep.c:2480 - Function memcpy expects arg 3 to be size_t gets int: len - low_size + Function memcpy expects arg 3 to be size_t gets LONGEST: len - low_size LOC i386-tdep.c:2540 (i386-tdep.c:2549) - New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot store return value of %d bytes long.") + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len +LOC i386-tdep.c:2545 + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len - low_size +LOC i386-tdep.c:2549 + New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot store return value of %s bytes long.") LOC i386-tdep.c:2578 (i386-tdep.c:2577) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC i386-tdep.c:2643 (i386-tdep.c:2642) - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC i386-tdep.c:3030 (i386-tdep.c:3029) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length i386-tdep.c: (in function i386_register_to_value) LOC i386-tdep.c:3063 (i386-tdep.c:3062) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC i386-tdep.c:3099 (i386-tdep.c:3098) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC ia64-tdep.c:3234 - Variable n initialized to type UINT, expects int: (type)->length / (float_elt_type)->length + Variable n initialized to type ULONGEST, expects int: (type)->length / (float_elt_type)->length LOC ia64-tdep.c:3265 - Variable reglen initialized to type UINT, expects int: (register_type(gdbarch, (0 + 8)))->length + Variable reglen initialized to type ULONGEST, expects int: (register_type(gdbarch, (0 + 8)))->length LOC ia64-tdep.c:3267 - Variable m initialized to type UINT, expects int: (type)->length % reglen + Variable m initialized to type ULONGEST, expects int: (type)->length % reglen LOC ia64-tdep.c:3299 - Variable n initialized to type UINT, expects int: (type)->length / (float_elt_type)->length + Variable n initialized to type ULONGEST, expects int: (type)->length / (float_elt_type)->length LOC ia64-tdep.c:3315 - Variable reglen initialized to type UINT, expects int: (register_type(gdbarch, (0 + 8)))->length + Variable reglen initialized to type ULONGEST, expects int: (register_type(gdbarch, (0 + 8)))->length LOC ia64-tdep.c:3317 - Variable m initialized to type UINT, expects int: (type)->length % reglen + Variable m initialized to type ULONGEST, expects int: (type)->length % reglen LOC ia64-tdep.c:3740 (ia64-tdep.c:3738) - Operands of && are non-boolean (int): (nslots & 1) && slot_alignment_is_next_even(type) + Operands of && are non-booleans (LONGEST, int): (nslots & 1) && slot_alignment_is_next_even(type) LOC ia64-tdep.c:3822 (ia64-tdep.c:3820) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC ia64-tdep.c:3822 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents(arg) LOC infcall.c:1018 - Function read_value_memory expects arg 6 to be size_t gets UINT: (values_type)->length + Function read_value_memory expects arg 6 to be size_t gets ULONGEST: (values_type)->length LOC infcall.c:1035 - Function read_value_memory expects arg 6 to be size_t gets UINT: (values_type)->length + Function read_value_memory expects arg 6 to be size_t gets ULONGEST: (values_type)->length LOC infrun.c:6672 (infrun.c:6669) - Variable len initialized to type UINT, expects size_t: (type)->length + Function xmalloc expects arg 1 to be size_t gets ULONGEST: len LOC infrun.c:6733 (infrun.c:6730) - Variable len initialized to type UINT, expects size_t: (type)->length -LOC infrun.c:6734 - Function target_write expects arg 6 to be LONGEST gets size_t: len + Function target_write expects arg 6 to be LONGEST gets ULONGEST: (type)->length iq2000-tdep.c: (in function iq2000_register_name) +LOC iq2000-tdep.c:513 + Variable size initialized to type LONGEST, expects int: len % 4 ? : 4 +LOC iq2000-tdep.c:564 + Test expression for conditional not boolean, type LONGEST: len % 4 LOC iq2000-tdep.c:564 - Test expression for conditional not boolean, type int: len % 4 + Variable size initialized to type LONGEST, expects int: len % 4 ? : 4 LOC iq2000-tdep.c:581 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length +LOC iq2000-tdep.c:739 + Assignment of LONGEST to int: slacklen = (4 - (typelen % 4)) % 4 LOC iq2000-tdep.c:741 (iq2000-tdep.c:740) - Function memcpy expects arg 3 to be size_t gets int: typelen + Function memcpy expects arg 3 to be size_t gets LONGEST: typelen LOC iq2000-tdep.c:772 (iq2000-tdep.c:771) - Function write_memory expects arg 3 to be ssize_t gets int: typelen + Function write_memory expects arg 3 to be ssize_t gets LONGEST: typelen LOC iq2000-tdep.c:782 (iq2000-tdep.c:781) - Function write_memory expects arg 3 to be ssize_t gets int: typelen + Function write_memory expects arg 3 to be ssize_t gets LONGEST: typelen LOC jv-lang.c:469 (jv-lang.c:467) - Assignment of LONGEST to int: boffset = value_as_long(value_struct_elt(&temp, NULL, "boffset", NULL, "structure")) -LOC jv-lang.c:469 Test expression for if not boolean, type int: accflags & 0x0001 LOC jv-lang.c:482 - Assignment of int to CORE_ADDR: (((type)->main_type->flds_bnds.fields[i]).loc.physaddr) = (boffset) + Assignment of LONGEST to CORE_ADDR: (((type)->main_type->flds_bnds.fields[i]).loc.physaddr) = (boffset) LOC jv-lang.c:611 - Return value type UINT does not match declared type int: (objtype)->length + Return value type ULONGEST does not match declared type int: (objtype)->length LOC lm32-tdep.c:287 (lm32-tdep.c:295) - Function write_memory expects arg 3 to be ssize_t gets int: len + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC lm32-tdep.c:295 + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC lm32-tdep.c:340 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length +LOC lm32-tdep.c:357 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC lm32-tdep.c:364 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len - 4 LOC m2-lang.c:121 (m2-lang.c:129) + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC m2-lang.c:129 Test expression for if not boolean, type int: quit_flag LOC m2-lang.c:139 (m2-lang.c:147) + Operands of < have incompatible types (UINT, ULONGEST): rep1 < length +LOC m2-lang.c:147 Test expression for if not boolean, type int: in_quotes LOC m2-lang.c:185 + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC m2-lang.c:185 Left operand of || is non-boolean (int): force_ellipses || i < length LOC m2-typeprint.c:377 (m2-typeprint.c:374) - Operands of < have incompatible types (UINT, size_t): (type)->length < sizeof(LONGEST) + Operands of < have incompatible types (ULONGEST, size_t): (type)->length < sizeof(LONGEST) LOC m2-typeprint.c:591 (m2-typeprint.c:610) - Operands of != have incompatible types (int, LONGEST): lastval != ((((type)->main_type->flds_bnds.fields[i]).loc.enumval) + 0) -LOC m2-typeprint.c:614 - Assignment of LONGEST to int: lastval = ((((type)->main_type->flds_bnds.fields[i]).loc.enumval) + 0) -LOC m2-typeprint.c:588 Parameter level not used LOC m2-valprint.c:276 (m2-valprint.c:277) - Assignment of UINT to int: eltlen = (type)->length -LOC m2-valprint.c:278 Test expression for if not boolean, type int: options->prettyprint_arrays LOC m2-valprint.c:319 (m2-valprint.c:320) - Previous definition of i: UINT + Previous definition of i: ULONGEST LOC m32r-tdep.c:260 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC m32r-tdep.c:744 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC m32r-tdep.c:799 (m32r-tdep.c:805) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: (len > 4 ? len - 4 : len) +LOC m32r-tdep.c:805 Return value (type enum register_status) ignored: regcache_cooked_... +LOC m68hc11-tdep.c:1196 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len LOC m68hc11-tdep.c:1222 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len +LOC m68hc11-tdep.c:1275 + Function regcache_raw_write_part expects arg 3 to be int gets LONGEST: 2 - len +LOC m68hc11-tdep.c:1275 + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len +LOC m68hc11-tdep.c:1278 + Function regcache_raw_write_part expects arg 3 to be int gets LONGEST: 4 - len +LOC m68hc11-tdep.c:1279 + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len - 2 LOC m68hc11-tdep.c:1294 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC m68k-tdep.c:225 - Function get_frame_register_bytes expects arg 4 to be int gets UINT: (type)->length + Function get_frame_register_bytes expects arg 4 to be int gets ULONGEST: (type)->length LOC m68k-tdep.c:301 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC m68k-tdep.c:306 - Function memcpy expects arg 3 to be size_t gets int: len - 4 + Function memcpy expects arg 3 to be size_t gets LONGEST: len - 4 m68k-tdep.c: (in function m68k_svr4_extract_return_value) LOC m68k-tdep.c:323 (m68k-tdep.c:318) - Variable len initialized to type UINT, expects int: (type)->length -LOC m68k-tdep.c:323 Left operand of && is non-boolean (int): tdep->float_return && (type)->main_type->code == TYPE_CODE_FLT LOC m68k-tdep.c:344 (m68k-tdep.c:353) - New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot store return value of %d bytes long.") -m68k-tdep.c: (in function m68k_svr4_store_return_value) + Function regcache_raw_write_part expects arg 3 to be int gets LONGEST: 4 - len +LOC m68k-tdep.c:344 + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len +LOC m68k-tdep.c:347 + Function regcache_raw_write_part expects arg 3 to be int gets LONGEST: 8 - len LOC m68k-tdep.c:348 (m68k-tdep.c:360) - Variable len initialized to type UINT, expects int: (type)->length + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len - 4 +LOC m68k-tdep.c:353 + New fresh storage (type char *) passed as implicitly temp (not released): gettext("Cannot store return value of %s bytes long.") +m68k-tdep.c: (in function m68k_svr4_store_return_value) LOC m68k-tdep.c:389 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC m68k-tdep.c:426 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC m68k-tdep.c:465 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC m68k-tdep.c:532 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC m88k-tdep.c:165 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC m88k-tdep.c:192 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC m88k-tdep.c:311 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length +LOC m88k-tdep.c:312 + Variable stack_word initialized to type LONGEST, expects int: num_stack_words LOC m88k-tdep.c:316 (m88k-tdep.c:318) + Variable register_word initialized to type LONGEST, expects int: num_register_words +LOC m88k-tdep.c:318 Right operand of && is non-boolean (int): register_word % 2 == 1 && m88k_8_byte_align_p(type) LOC m88k-tdep.c:404 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC m88k-tdep.c:410 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC m88k-tdep.c:426 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC memrange.c:77 - Conditional clauses are not of same type: (ra->length) (int), ((rb->start - ra->start) + rb->length) (ULONGEST) + Conditional clauses are not of same type: (ra->length) (LONGEST), ((rb->start - ra->start) + rb->length) (ULONGEST) LOC mep-tdep.c:1148 - Operands of == have incompatible types (UINT, size_t): (register_type(gdbarch, rawnum))->length == sizeof((buf64)) + Operands of == have incompatible types (ULONGEST, size_t): (register_type(gdbarch, rawnum))->length == sizeof((buf64)) LOC mep-tdep.c:1234 - Operands of == have incompatible types (UINT, size_t): (register_type(gdbarch, rawnum))->length == sizeof((buf64)) + Operands of == have incompatible types (ULONGEST, size_t): (register_type(gdbarch, rawnum))->length == sizeof((buf64)) LOC mep-tdep.c:2149 - Assignment of UINT to int: offset = (4) - (type)->length + Assignment of ULONGEST to int: offset = (4) - (type)->length LOC mep-tdep.c:2155 - Function regcache_cooked_read_part expects arg 4 to be int gets UINT: (type)->length + Function regcache_cooked_read_part expects arg 4 to be int gets ULONGEST: (type)->length LOC mep-tdep.c:2177 - Assignment of UINT to int: offset = (4) - (type)->length + Assignment of ULONGEST to int: offset = (4) - (type)->length LOC mep-tdep.c:2182 - Function regcache_cooked_write_part expects arg 4 to be int gets UINT: (type)->length + Function regcache_cooked_write_part expects arg 4 to be int gets ULONGEST: (type)->length LOC mep-tdep.c:2210 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC mep-tdep.c:2289 - Function write_memory expects arg 3 to be ssize_t gets UINT: arg_len + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: arg_len LOC microblaze-tdep.c:571 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC microblaze-tdep.c:608 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len microblaze-tdep.c: (in function microblaze_return_value) LOC mips-tdep.c:876 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC mips-tdep.c:908 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC mips-tdep.c:1024 (mips-tdep.c:1029) + Operands of == have incompatible types (UINT, ULONGEST): mips_abi_regsize(gdbarch) == (builtin_type(gdbarch)->builtin_data_ptr)->length +LOC mips-tdep.c:1029 Fresh storage rawtype not released before return LOC mips-tdep.c:4312 (mips-tdep.c:4311) + Function extract_signed_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:4311 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents(arg) LOC mips-tdep.c:4317 (mips-tdep.c:4318) + Function store_signed_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:4318 Function store_signed_integer expects arg 4 to be LONGEST gets CORE_ADDR: make_compact_addr(addr) LOC mips-tdep.c:4397 (mips-tdep.c:4398) + Function extract_signed_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:4398 Test expression for if not boolean, type int: mips_debug LOC mips-tdep.c:4400 (mips-tdep.c:4414) + Function phex expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:4414 Variable odd_sized_struct initialized to type boolean, expects int: (len > regsize && len % regsize != 0) LOC mips-tdep.c:4422 (mips-tdep.c:4424) + Variable partial_len initialized to type LONGEST, expects int: (len < regsize ? len : regsize) +LOC mips-tdep.c:4424 Test expression for if not boolean, type int: mips_debug LOC mips-tdep.c:4444 (mips-tdep.c:4447) - Operands of < have incompatible types (UINT, int): (arg_type)->length < regsize + Assignment of LONGEST to int: longword_offset = regsize - len +LOC mips-tdep.c:4447 + Operands of < have incompatible types (ULONGEST, int): (arg_type)->length < regsize +LOC mips-tdep.c:4448 + Assignment of LONGEST to int: longword_offset = regsize - len LOC mips-tdep.c:4565 - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC mips-tdep.c:4569 - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC mips-tdep.c:4570 - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC mips-tdep.c:4701 - Variable len initialized to type UINT, expects int: (arg_type)->length + Variable len initialized to type ULONGEST, expects int: (arg_type)->length LOC mips-tdep.c:4937 - Operands of > have incompatible types (UINT, int): (type)->length > 2 * MIPS64_REGSIZE + Operands of > have incompatible types (ULONGEST, int): (type)->length > 2 * MIPS64_REGSIZE LOC mips-tdep.c:4970 - Function mips_xfer_register expects arg 4 to be int gets UINT: (type)->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: (type)->length LOC mips-tdep.c:5020 - Function mips_xfer_register expects arg 4 to be int gets UINT: ((((type)->main_type->flds_bnds.fields[field]).type))->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: ((((type)->main_type->flds_bnds.fields[field]).type))->length LOC mips-tdep.c:5036 - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC mips-tdep.c:5040 - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC mips-tdep.c:5041 - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC mips-tdep.c:5059 - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC mips-tdep.c:5063 - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC mips-tdep.c:5064 - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC mips-tdep.c:5130 (mips-tdep.c:5128) - Variable arglen initialized to type UINT, expects int: (arg_type)->length -LOC mips-tdep.c:5131 Test expression for if not boolean, type int: mips_type_needs_double_align(arg_type) LOC mips-tdep.c:5131 (mips-tdep.c:5132) - Function align_up expects arg 1 to be ULONGEST gets int: len -LOC mips-tdep.c:5132 - Assignment of ULONGEST to int: len = align_up(len, MIPS32_REGSIZE * 2) + Function align_up expects arg 1 to be ULONGEST gets LONGEST: len LOC mips-tdep.c:5131 (mips-tdep.c:5134) - Function align_up expects arg 1 to be ULONGEST gets int: arglen + Assignment of ULONGEST to LONGEST: len = align_up(len, MIPS32_REGSIZE * 2) LOC mips-tdep.c:5102 - Previous definition of len: int + Previous definition of len: LONGEST LOC mips-tdep.c:5241 (mips-tdep.c:5242) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5241 Variable regval initialized to type ULONGEST, expects LONGEST: extract_unsigned_integer(val, len, byte_order) LOC mips-tdep.c:5244 (mips-tdep.c:5247) + Function phex expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5246 Function regcache_cooked_write_unsigned expects arg 3 to be ULONGEST gets LONGEST: regval LOC mips-tdep.c:5252 (mips-tdep.c:5254) + Function phex expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5253 Function regcache_cooked_write_unsigned expects arg 3 to be ULONGEST gets LONGEST: regval LOC mips-tdep.c:5284 (mips-tdep.c:5287) + Variable partial_len initialized to type LONGEST, expects int: (len < MIPS32_REGSIZE ? len : MIPS32_REGSIZE) +LOC mips-tdep.c:5286 Test expression for if not boolean, type int: mips_debug LOC mips-tdep.c:5444 (mips-tdep.c:5445) - Function mips_xfer_register expects arg 4 to be int gets UINT: (type)->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: (type)->length LOC mips-tdep.c:5450 (mips-tdep.c:5451) - Function mips_xfer_register expects arg 4 to be int gets UINT: (type)->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: (type)->length LOC mips-tdep.c:5599 (mips-tdep.c:5600) - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC mips-tdep.c:5603 (mips-tdep.c:5604) - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC mips-tdep.c:5604 (mips-tdep.c:5605) - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC mips-tdep.c:5659 (mips-tdep.c:5657) - Variable arglen initialized to type UINT, expects int: (arg_type)->length -LOC mips-tdep.c:5660 - Function align_up expects arg 1 to be ULONGEST gets int: arglen -LOC mips-tdep.c:5661 Fresh storage arg_type not released before scope exit LOC mips-tdep.c:5630 (mips-tdep.c:5631) - Previous definition of len: int + Previous definition of len: LONGEST LOC mips-tdep.c:5708 (mips-tdep.c:5709) + Function extract_signed_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5707 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents(arg) LOC mips-tdep.c:5711 (mips-tdep.c:5714) + Function store_signed_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5712 Function store_signed_integer expects arg 4 to be LONGEST gets CORE_ADDR: make_compact_addr(addr) LOC mips-tdep.c:5730 (mips-tdep.c:5732) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5730 Variable regval initialized to type ULONGEST, expects LONGEST: extract_unsigned_integer(val, len, byte_order) LOC mips-tdep.c:5733 (mips-tdep.c:5736) + Function phex expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5734 Function regcache_cooked_write_unsigned expects arg 3 to be ULONGEST gets LONGEST: regval LOC mips-tdep.c:5737 (mips-tdep.c:5740) + Function phex expects arg 2 to be int gets LONGEST: len +LOC mips-tdep.c:5738 Function regcache_cooked_write_unsigned expects arg 3 to be ULONGEST gets LONGEST: regval LOC mips-tdep.c:5758 (mips-tdep.c:5762) + Variable partial_len initialized to type LONGEST, expects int: (len < MIPS64_REGSIZE ? len : MIPS64_REGSIZE) +LOC mips-tdep.c:5760 Test expression for if not boolean, type int: mips_debug LOC mips-tdep.c:5779 (mips-tdep.c:5784) + Assignment of LONGEST to int: longword_offset = MIPS64_REGSIZE - len +LOC mips-tdep.c:5782 Test expression for if not boolean, type int: mips_debug LOC mips-tdep.c:5785 (mips-tdep.c:5787) - Function paddress expects arg 2 to be CORE_ADDR gets int: stack_offset + Function paddress expects arg 2 to be CORE_ADDR gets LONGEST: stack_offset LOC mips-tdep.c:5909 (mips-tdep.c:5911) - Function mips_xfer_register expects arg 4 to be int gets UINT: (type)->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: (type)->length LOC mips-tdep.c:5915 (mips-tdep.c:5917) - Function mips_xfer_register expects arg 4 to be int gets UINT: (type)->length + Function mips_xfer_register expects arg 4 to be int gets ULONGEST: (type)->length LOC mips-tdep.c:5927 (mips-tdep.c:5929) - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC mips-tdep.c:5931 (mips-tdep.c:5933) - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC mips-tdep.c:5932 (mips-tdep.c:5934) - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC mn10300-tdep.c:103 (mn10300-tdep.c:102) - Return value type UINT does not match declared type int: (type)->length + Return value type ULONGEST does not match declared type LONGEST: (type)->length LOC mn10300-tdep.c:106 (mn10300-tdep.c:105) - Return value type UINT does not match declared type int: (type)->length / 2 + Return value type ULONGEST does not match declared type LONGEST: (type)->length / 2 LOC mn10300-tdep.c:114 (mn10300-tdep.c:113) - Left operand of <<= may be negative (int): align <<= 1 + Left operand of <<= may be negative (LONGEST): align <<= 1 LOC mn10300-tdep.c:129 (mn10300-tdep.c:128) - Path with no return in function declared to return int + Path with no return in function declared to return LONGEST mn10300-tdep.c: (in function mn10300_use_struct_convention) LOC mn10300-tdep.c:174 (mn10300-tdep.c:173) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC mn10300-tdep.c:203 (mn10300-tdep.c:202) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length +LOC moxie-tdep.c:135 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len - 4 LOC moxie-tdep.c:330 (moxie-tdep.c:336) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: (len > 4 ? len - 4 : len) +LOC moxie-tdep.c:336 Return value (type enum register_status) ignored: regcache_cooked_... LOC mt-tdep.c:353 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC mt-tdep.c:361 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC mt-tdep.c:386 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC mt-tdep.c:786 - Variable stack_dest initialized to type CORE_ADDR, expects int: sp + Variable stack_dest initialized to type CORE_ADDR, expects LONGEST: sp LOC mt-tdep.c:827 (mt-tdep.c:828) - Function memcpy expects arg 3 to be size_t gets int: typelen + Assignment of LONGEST to int: split_param_len = typelen +LOC mt-tdep.c:828 + Function memcpy expects arg 3 to be size_t gets LONGEST: typelen LOC mt-tdep.c:838 - Function write_memory expects arg 1 to be CORE_ADDR gets int: stack_dest + Function write_memory expects arg 1 to be CORE_ADDR gets LONGEST: stack_dest LOC mt-tdep.c:838 - Function write_memory expects arg 3 to be ssize_t gets int: typelen + Function write_memory expects arg 3 to be ssize_t gets LONGEST: typelen LOC mt-tdep.c:851 (mt-tdep.c:852) - Function C_alloca expects arg 1 to be size_t gets int: typelen + slacklen + Assignment of LONGEST to int: slacklen = (4 - (typelen % 4)) % 4 LOC mt-tdep.c:852 (mt-tdep.c:853) - Function memcpy expects arg 3 to be size_t gets int: typelen + Function C_alloca expects arg 1 to be size_t gets LONGEST: typelen + slacklen +LOC mt-tdep.c:853 + Function memcpy expects arg 3 to be size_t gets LONGEST: typelen LOC mt-tdep.c:857 - Function write_memory expects arg 1 to be CORE_ADDR gets int: stack_dest + Function write_memory expects arg 1 to be CORE_ADDR gets LONGEST: stack_dest LOC mt-tdep.c:857 - Function write_memory expects arg 3 to be ssize_t gets int: typelen + slacklen + Function write_memory expects arg 3 to be ssize_t gets LONGEST: typelen + slacklen LOC mt-tdep.c:865 - Function write_memory expects arg 1 to be CORE_ADDR gets int: stack_dest + Function write_memory expects arg 1 to be CORE_ADDR gets LONGEST: stack_dest LOC mt-tdep.c:882 - Return value type int does not match declared type CORE_ADDR: stack_dest + Return value type LONGEST does not match declared type CORE_ADDR: stack_dest LOC objc-lang.c:371 (objc-lang.c:379) + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC objc-lang.c:379 Test expression for if not boolean, type int: quit_flag LOC objc-lang.c:389 (objc-lang.c:397) + Operands of < have incompatible types (UINT, ULONGEST): rep1 < length +LOC objc-lang.c:397 Test expression for if not boolean, type int: in_quotes LOC objc-lang.c:435 + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC objc-lang.c:435 Left operand of || is non-boolean (int): force_ellipses || i < length LOC opencl-lang.c:191 (opencl-lang.c:190) - Assignment of LONGEST to int: n = offset + highb - lowb + 1 -LOC opencl-lang.c:191 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Assertion `%s' failed.") LOC opencl-lang.c:196 - Function memcpy expects arg 3 to be size_t gets int: elsize + Function memcpy expects arg 3 to be size_t gets LONGEST: elsize LOC opencl-lang.c:236 (opencl-lang.c:219) - Assignment of LONGEST to int: n = offset + highb - lowb + 1 -LOC opencl-lang.c:236 - Function memcpy expects arg 3 to be size_t gets int: elsize + Function memcpy expects arg 3 to be size_t gets LONGEST: elsize +LOC opencl-lang.c:253 + Variable startrest initialized to type LONGEST, expects int: offset % elsize +LOC opencl-lang.c:255 + Variable endrest initialized to type LONGEST, expects int: (offset + length) % elsize LOC opencl-lang.c:268 (opencl-lang.c:269) + Conditional clauses are not of same type: endrest (int), elsize (LONGEST) +LOC opencl-lang.c:270 Operand of ! is non-boolean (int): !value_bits_valid(c->val, c->indices[i] * elsize + comp_offset, comp_length) +LOC opencl-lang.c:307 + Variable startrest initialized to type LONGEST, expects int: offset % elsize +LOC opencl-lang.c:309 + Variable endrest initialized to type LONGEST, expects int: (offset + length) % elsize LOC opencl-lang.c:322 (opencl-lang.c:323) + Conditional clauses are not of same type: endrest (int), elsize (LONGEST) +LOC opencl-lang.c:324 Operand of ! is non-boolean (int): !value_bits_synthetic_pointer(c->val, c->indices[i] * elsize + comp_offset, comp_length) LOC opencl-lang.c:428 (opencl-lang.c:427) - Function memcpy expects arg 3 to be size_t gets UINT: (elm_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (elm_type)->length LOC opencl-lang.c:581 (opencl-lang.c:580) - Function memset expects arg 3 to be size_t gets UINT: (eltype)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (eltype)->length LOC opencl-lang.c:681 (opencl-lang.c:680) - Function memset expects arg 3 to be size_t gets UINT: (eltype1)->length + Function memset expects arg 3 to be size_t gets ULONGEST: (eltype1)->length LOC opencl-lang.c:901 (opencl-lang.c:900) - Function memcpy expects arg 3 to be size_t gets UINT: (eltype2)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (eltype2)->length LOC p-lang.c:233 - Assignment of UINT to int: width = (type)->length + Assignment of ULONGEST to int: width = (type)->length LOC p-lang.c:249 (p-lang.c:258) + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC p-lang.c:258 Test expression for if not boolean, type int: quit_flag LOC p-lang.c:271 (p-lang.c:281) + Operands of < have incompatible types (UINT, ULONGEST): rep1 < length +LOC p-lang.c:281 Test expression for if not boolean, type int: in_quotes LOC p-lang.c:319 + Operands of < have incompatible types (UINT, ULONGEST): i < length +LOC p-lang.c:319 Left operand of || is non-boolean (int): force_ellipses || i < length ppc-linux-nat.c: (in function ppc_linux_can_accel_watchpoint_condition) LOC ppc-linux-nat.c:2030 (ppc-linux-nat.c:2057) + Function calculate_dvc expects arg 2 to be int gets LONGEST: len +LOC ppc-linux-nat.c:2057 Assignment of int to uint32_t: p->trigger_type = get_trigger_type(rw) ppc-linux-nat.c: (in function ppc_linux_insert_watchpoint) +LOC ppc-sysv-tdep.c:162 + Function align_up expects arg 2 to be int gets LONGEST: len LOC ppc-sysv-tdep.c:164 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:193 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:215 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:250 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len +LOC ppc-sysv-tdep.c:304 + Function align_up expects arg 2 to be int gets LONGEST: len LOC ppc-sysv-tdep.c:308 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:380 - Assignment of ULONGEST to int: argoffset = align_up(argoffset, len) + Function align_up expects arg 2 to be int gets LONGEST: len +LOC ppc-sysv-tdep.c:380 + Assignment of ULONGEST to LONGEST: argoffset = align_up(argoffset, len) LOC ppc-sysv-tdep.c:382 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:395 - Function write_memory expects arg 3 to be ssize_t gets UINT: (eltype)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (eltype)->length LOC ppc-sysv-tdep.c:447 (ppc-sysv-tdep.c:453) + Operands of < have incompatible types (int, LONGEST): i < len / 16 +LOC ppc-sysv-tdep.c:453 Test expression for if not boolean, type int: write_pass LOC ppc-sysv-tdep.c:537 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:550 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC ppc-sysv-tdep.c:574 (ppc-sysv-tdep.c:587) + Assignment of LONGEST to int: argspace = argoffset +LOC ppc-sysv-tdep.c:587 Test expression for if not boolean, type int: write_pass LOC ppc-sysv-tdep.c:814 - Operands of <= have incompatible types (UINT, int): (type)->length <= tdep->wordsize + Operands of <= have incompatible types (ULONGEST, int): (type)->length <= tdep->wordsize +LOC ppc-sysv-tdep.c:852 + Variable regnum initialized to type LONGEST, expects int: tdep->ppc_fp0_regnum + 1 + i LOC ppc-sysv-tdep.c:871 (ppc-sysv-tdep.c:876) + Variable regnum initialized to type LONGEST, expects int: tdep->ppc_gp0_regnum + 3 + i +LOC ppc-sysv-tdep.c:876 Assignment of LONGEST to ULONGEST: regval = unpack_long(eltype, writebuf + offset) LOC ppc-sysv-tdep.c:897 - Variable n_regs initialized to type UINT, expects int: (type)->length / 16 + Variable n_regs initialized to type ULONGEST, expects int: (type)->length / 16 LOC ppc-sysv-tdep.c:984 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC ppc-sysv-tdep.c:1019 - Operands of > have incompatible types (UINT, int): (type)->length > tdep->wordsize + Operands of > have incompatible types (ULONGEST, int): (type)->length > tdep->wordsize LOC ppc-sysv-tdep.c:1022 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1031 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1034 - Operands of > have incompatible types (UINT, int): (type)->length > tdep->wordsize + Operands of > have incompatible types (ULONGEST, int): (type)->length > tdep->wordsize LOC ppc-sysv-tdep.c:1304 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1360 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1375 - Variable nelt initialized to type UINT, expects int: (type)->length / (eltype)->length + Variable nelt initialized to type ULONGEST, expects int: (type)->length / (eltype)->length LOC ppc-sysv-tdep.c:1448 - Operands of < have incompatible types (int, UINT): i < (type)->length / 16 + Operands of < have incompatible types (int, ULONGEST): i < (type)->length / 16 LOC ppc-sysv-tdep.c:1487 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1502 - Function write_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length LOC ppc-sysv-tdep.c:1561 - Operands of < have incompatible types (int, UINT): byte < (type)->length + Operands of < have incompatible types (int, ULONGEST): byte < (type)->length LOC ppc-sysv-tdep.c:1567 - Variable len initialized to type UINT, expects int: (type)->length - byte + Variable len initialized to type ULONGEST, expects int: (type)->length - byte LOC ppc-sysv-tdep.c:1597 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:1599 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC ppc-sysv-tdep.c:1792 - Variable nelt initialized to type UINT, expects int: (valtype)->length / (eltype)->length + Variable nelt initialized to type ULONGEST, expects int: (valtype)->length / (eltype)->length +LOC ppc-sysv-tdep.c:1796 + Variable offset initialized to type ULONGEST, expects int: i * (eltype)->length +LOC ppc-sysv-tdep.c:1851 + Variable regnum initialized to type LONGEST, expects int: tdep->ppc_vr0_regnum + 2 + i LOC ppc-sysv-tdep.c:1869 (ppc-sysv-tdep.c:1873) - Function regcache_cooked_write_part expects arg 4 to be int gets UINT: (valtype)->length + Variable offset initialized to type ULONGEST, expects int: (register_size(gdbarch, tdep->ppc_gp0_regnum + 3) - (valtype)->length) LOC ppc-sysv-tdep.c:1873 (ppc-sysv-tdep.c:1876) - Function regcache_cooked_read_part expects arg 4 to be int gets UINT: (valtype)->length + Function regcache_cooked_write_part expects arg 4 to be int gets ULONGEST: (valtype)->length +LOC ppc-sysv-tdep.c:1876 + Function regcache_cooked_read_part expects arg 4 to be int gets ULONGEST: (valtype)->length LOC ppc-sysv-tdep.c:1900 - Operands of < have incompatible types (int, UINT): i < (valtype)->length / 8 + Operands of < have incompatible types (int, ULONGEST): i < (valtype)->length / 8 LOC printcmd.c:384 - Operands of > have incompatible types (UINT, size_t): len > sizeof(LONGEST) + Operands of > have incompatible types (ULONGEST, size_t): len > sizeof(LONGEST) +LOC printcmd.c:391 + Function print_octal_chars expects arg 3 to be UINT gets ULONGEST: len LOC printcmd.c:395 (printcmd.c:396) + Function print_decimal_chars expects arg 3 to be UINT gets ULONGEST: len +LOC printcmd.c:396 Fresh storage gdbarch not released before return LOC printcmd.c:398 (printcmd.c:399) + Function print_binary_chars expects arg 3 to be UINT gets ULONGEST: len +LOC printcmd.c:399 Fresh storage gdbarch not released before return LOC printcmd.c:404 (printcmd.c:405) + Function print_char_chars expects arg 4 to be UINT gets ULONGEST: len +LOC printcmd.c:405 Fresh storage gdbarch not released before return LOC printcmd.c:425 - Operands of < have incompatible types (UINT, size_t): len < sizeof(LONGEST) + Operands of < have incompatible types (ULONGEST, size_t): len < sizeof(LONGEST) LOC printcmd.c:2395 - Variable wcwidth initialized to type UINT, expects int: (wctype)->length + Variable wcwidth initialized to type ULONGEST, expects int: (wctype)->length LOC printcmd.c:2454 (printcmd.c:2455) - Function convert_between_encodings expects arg 5 to be int gets UINT: (valtype)->length + Function convert_between_encodings expects arg 4 to be UINT gets ULONGEST: (valtype)->length +LOC printcmd.c:2455 + Function convert_between_encodings expects arg 5 to be int gets ULONGEST: (valtype)->length LOC printcmd.c:2547 (printcmd.c:2609) + Variable param_len initialized to type ULONGEST, expects UINT: (param_type)->length +LOC printcmd.c:2609 Function decimal_convert expects arg 2 to be int gets UINT: param_len LOC p-typeprint.c:821 (p-typeprint.c:753) - Operands of != have incompatible types (int, LONGEST): lastval != ((((type)->main_type->flds_bnds.fields[i]).loc.enumval) + 0) -LOC p-typeprint.c:758 - Assignment of LONGEST to int: lastval = ((((type)->main_type->flds_bnds.fields[i]).loc.enumval) + 0) -LOC p-typeprint.c:821 Fresh storage type not released before return LOC p-valprint.c:212 (p-valprint.c:211) - Function xmalloc expects arg 1 to be size_t gets int: length_size + Function xmalloc expects arg 1 to be size_t gets LONGEST: length_size LOC p-valprint.c:213 (p-valprint.c:212) - Function read_memory expects arg 3 to be ssize_t gets int: length_size + Function read_memory expects arg 3 to be ssize_t gets LONGEST: length_size +LOC p-valprint.c:214 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: length_size LOC p-valprint.c:324 (p-valprint.c:322) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: length_size +LOC p-valprint.c:323 Assignment of ULONGEST to UINT: len = extract_unsigned_integer(valaddr + embedded_offset + length_pos, length_size, byte_order) LOC p-valprint.c:802 (p-valprint.c:801) - Function C_alloca expects arg 1 to be size_t gets UINT: (baseclass)->length + Function C_alloca expects arg 1 to be size_t gets ULONGEST: (baseclass)->length LOC p-valprint.c:806 (p-valprint.c:805) - Function target_read_memory expects arg 3 to be ssize_t gets UINT: (baseclass)->length + Function target_read_memory expects arg 3 to be ssize_t gets ULONGEST: (baseclass)->length LOC python/py-prettyprint.c:355 - Function expects arg 4 to be UINT gets LONGEST: length + Function expects arg 4 to be ULONGEST gets LONGEST: length regcache.c: (in function regcache_cooked_read_signed) LOC regcache.c:915 - Operands of <= have incompatible types (int, LONGEST): offset <= descr->sizeof_register[regnum] -LOC regcache.c:915 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Assertion `%s' failed.") LOC regcache.c:916 - Operands of <= have incompatible types (int, LONGEST): offset + len <= descr->sizeof_register[regnum] -LOC regcache.c:916 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Assertion `%s' failed.") LOC regcache.c:927 (regcache.c:923) - Operands of < have incompatible types (int, LONGEST): offset + len < descr->sizeof_register[regnum] -LOC regcache.c:927 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Assertion `%s' failed.") LOC remote.c:7971 + Function phex_nz expects arg 1 to be ULONGEST gets LONGEST: len +LOC remote.c:7971 Function xsnprintf expects arg 2 to be size_t gets int: endbuf - p LOC remote.c:8015 + Function phex_nz expects arg 1 to be ULONGEST gets LONGEST: len +LOC remote.c:8015 Function xsnprintf expects arg 2 to be size_t gets int: endbuf - p LOC remote-m32r-sdi.c:1433 - Assignment of int to UINT: ab_size[i] = len + Assignment of LONGEST to UINT: ab_size[i] = len LOC remote-mips.c:2434 (remote-mips.c:2433) Parameter cond not used +remote-mips.c: (in function mips_set_breakpoint) +LOC remote-mips.c:2457 + Function mips_common_breakpoint expects arg 3 to be int gets LONGEST: len +remote-mips.c: (in function mips_clear_breakpoint) +LOC remote-mips.c:2466 + Function mips_common_breakpoint expects arg 3 to be int gets LONGEST: len remote-mips.c: (in function mips_check_lsi_error) rl78-tdep.c: (in function rl78_pointer_to_address) LOC rl78-tdep.c:1027 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC rs6000-aix-tdep.c:277 (rs6000-aix-tdep.c:280) + Operands of < have incompatible types (int, LONGEST): argbytes < len +LOC rs6000-aix-tdep.c:280 Function memset expects arg 3 to be size_t gets int: reg_size LOC rs6000-aix-tdep.c:284 (rs6000-aix-tdep.c:283) - Function memcpy expects arg 3 to be size_t gets int: (len - argbytes) > reg_size ? reg_size : len - argbytes + Conditional clauses are not of same type: reg_size (int), len - argbytes (LONGEST) +LOC rs6000-aix-tdep.c:299 + Variable adj initialized to type LONGEST, expects int: gdbarch_byte_order(gdbarch) == BFD_ENDIAN_BIG ? reg_size - len : 0 LOC rs6000-aix-tdep.c:304 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC rs6000-aix-tdep.c:366 - Function write_memory expects arg 3 to be ssize_t gets int: len - argbytes + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len - argbytes LOC rs6000-aix-tdep.c:393 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC rs6000-aix-tdep.c:494 - Operands of <= have incompatible types (UINT, int): (valtype)->length <= tdep->wordsize + Operands of <= have incompatible types (ULONGEST, int): (valtype)->length <= tdep->wordsize s390-tdep.c: (in function s390_pseudo_register_reggroup_p) LOC s390-tdep.c:2495 (s390-tdep.c:2496) + Function is_power_of_two expects arg 1 to be UINT gets ULONGEST: (type)->length +LOC s390-tdep.c:2495 Operand of ! is non-boolean (int): !is_power_of_two((type)->length) LOC s390-tdep.c:2516 (s390-tdep.c:2522) + Variable length initialized to type ULONGEST, expects UINT: (type)->length +LOC s390-tdep.c:2520 Operands of || are non-boolean (int): is_integer_like(type) || is_pointer_like(type) LOC s390-tdep.c:2555 (s390-tdep.c:2557) - Assignment of UINT to int: alignment = (type)->length + Assignment of ULONGEST to int: alignment = (type)->length LOC s390-tdep.c:2675 (s390-tdep.c:2678) - Function write_memory expects arg 3 to be ssize_t gets UINT: length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: length LOC s390-tdep.c:2699 (s390-tdep.c:2702) - Function regcache_cooked_write_part expects arg 4 to be int gets UINT: length + Function regcache_cooked_write_part expects arg 4 to be int gets ULONGEST: length LOC s390-tdep.c:2707 (s390-tdep.c:2710) - Function write_memory expects arg 3 to be ssize_t gets UINT: length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: length LOC s390-tdep.c:2710 (s390-tdep.c:2713) - Operands of <= have incompatible types (UINT, int): length <= word_size + Operands of <= have incompatible types (ULONGEST, int): length <= word_size LOC s390-tdep.c:2728 (s390-tdep.c:2731) - Operands of == have incompatible types (UINT, int): length == 2 * word_size + Operands of == have incompatible types (ULONGEST, int): length == 2 * word_size LOC s390-tdep.c:2744 (s390-tdep.c:2747) - Function write_memory expects arg 3 to be ssize_t gets UINT: length + Function write_memory expects arg 3 to be ssize_t gets ULONGEST: length LOC s390-tdep.c:2797 (s390-tdep.c:2802) - Variable length initialized to type UINT, expects int: (type)->length -LOC s390-tdep.c:2800 Parameter gdbarch not used s390-tdep.c: (in function s390_return_value) +LOC s390-tdep.c:2840 + Function regcache_cooked_write_part expects arg 4 to be int gets LONGEST: length LOC s390-tdep.c:2847 (s390-tdep.c:2862) + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: length +LOC s390-tdep.c:2850 + Function extract_signed_integer expects arg 2 to be int gets LONGEST: length +LOC s390-tdep.c:2858 New fresh storage (type char *) passed as implicitly temp (not released): gettext("invalid return type") LOC s390-tdep.c:2877 (s390-tdep.c:2880) + Function regcache_cooked_read_part expects arg 4 to be int gets LONGEST: length +LOC s390-tdep.c:2876 Return value (type enum register_status) ignored: regcache_cooked_... LOC s390-tdep.c:2883 (s390-tdep.c:2886) + Function regcache_cooked_read_part expects arg 4 to be int gets LONGEST: length +LOC s390-tdep.c:2882 Return value (type enum register_status) ignored: regcache_cooked_... LOC score-tdep.c:465 - Operands of < have incompatible types (int, UINT): offset < (type)->length + Operands of < have incompatible types (int, ULONGEST): offset < (type)->length LOC score-tdep.c:470 - Operands of > have incompatible types (int, UINT): offset + xfer > (type)->length + Operands of > have incompatible types (int, ULONGEST): offset + xfer > (type)->length LOC score-tdep.c:471 - Assignment of UINT to int: xfer = (type)->length - offset + Assignment of ULONGEST to int: xfer = (type)->length - offset LOC score-tdep.c:592 (score-tdep.c:602) + Variable partial_len initialized to type LONGEST, expects int: arglen < 4 ? arglen : 4 +LOC score-tdep.c:602 Right operand of <<= may be negative (int): regval <<= ((4 - partial_len) * 8) LOC sh64-tdep.c:1116 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC sh64-tdep.c:1118 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC sh64-tdep.c:1269 (sh64-tdep.c:1273) - Function memcpy expects arg 3 to be size_t gets int: len + Assignment of LONGEST to int: offset = register_size(gdbarch, DEFAULT_RETURN_REGNUM) - len +LOC sh64-tdep.c:1273 + Function memcpy expects arg 3 to be size_t gets LONGEST: len +LOC sh64-tdep.c:1298 + Operands of < have incompatible types (int, LONGEST): i < len LOC sh64-tdep.c:1318 (sh64-tdep.c:1320) - Function memcpy expects arg 3 to be size_t gets int: len + Assignment of LONGEST to int: offset = register_size(gdbarch, return_register) - len +LOC sh64-tdep.c:1320 + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC sh-tdep.c:808 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sh-tdep.c:828 - Operands of == have incompatible types (UINT, int): ((((type)->main_type->flds_bnds.fields[0]).type))->length == len + Operands of == have incompatible types (ULONGEST, int): ((((type)->main_type->flds_bnds.fields[0]).type))->length == len sh-tdep.c: (in function sh_use_struct_convention_nofpu) LOC sh-tdep.c:1035 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sh-tdep.c:1099 - Assignment of UINT to int: len = (type)->length + Assignment of ULONGEST to int: len = (type)->length LOC sh-tdep.c:1148 - Operands of == have incompatible types (UINT, int): (type)->length == 2 * reg_size + Operands of == have incompatible types (ULONGEST, int): (type)->length == 2 * reg_size LOC sh-tdep.c:1236 - Assignment of UINT to int: len = (type)->length + Assignment of ULONGEST to int: len = (type)->length LOC sh-tdep.c:1318 (sh-tdep.c:1324) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC sh-tdep.c:1323 + Operands of < have incompatible types (int, LONGEST): i < len +LOC sh-tdep.c:1324 Function regcache_raw_read expects arg 3 to be gdb_byte * gets char *: (char *)valbuf + i LOC sh-tdep.c:1337 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length +LOC sh-tdep.c:1367 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC sh-tdep.c:1373 + Operands of < have incompatible types (int, LONGEST): i < len LOC sh-tdep.c:1385 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc64-tdep.c:67 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc64-tdep.c:74 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc64-tdep.c:94 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc64-tdep.c:114 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc64-tdep.c:645 (sparc64-tdep.c:644) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc64-tdep.c:666 (sparc64-tdep.c:670) + Assignment of LONGEST to int: regnum = SPARC64_D0_REGNUM + element + bitpos / 64 +LOC sparc64-tdep.c:671 New fresh storage (type char *) passed as implicitly temp (not released): gettext("Assertion `%s' failed.") LOC sparc64-tdep.c:674 (sparc64-tdep.c:677) + Assignment of LONGEST to int: regnum = SPARC_F0_REGNUM + element * 2 + bitpos / 32 +LOC sparc64-tdep.c:678 Test expression for if not boolean, type int: sparc64_structure_or_union_p(type) LOC sparc64-tdep.c:721 (sparc64-tdep.c:720) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc64-tdep.c:728 + Assignment of LONGEST to int: regnum = SPARC64_Q0_REGNUM + bitpos / 128 +LOC sparc64-tdep.c:729 Return value (type enum register_status) ignored: regcache_cooked_... LOC sparc64-tdep.c:735 + Assignment of LONGEST to int: regnum = SPARC64_D0_REGNUM + bitpos / 64 +LOC sparc64-tdep.c:736 Return value (type enum register_status) ignored: regcache_cooked_... LOC sparc64-tdep.c:743 + Assignment of LONGEST to int: regnum = SPARC_F0_REGNUM + bitpos / 32 +LOC sparc64-tdep.c:744 Return value (type enum register_status) ignored: regcache_cooked_... LOC sparc64-tdep.c:816 (sparc64-tdep.c:815) - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC sparc64-tdep.c:887 (sparc64-tdep.c:886) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc64-tdep.c:1024 (sparc64-tdep.c:1023) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc64-tdep.c:1074 (sparc64-tdep.c:1073) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc-tdep.c:181 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc-tdep.c:214 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc-tdep.c:233 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc-tdep.c:486 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC sparc-tdep.c:524 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc-tdep.c:1254 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc-tdep.c:1308 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC sparc-tdep.c:1379 - Function read_memory expects arg 3 to be ssize_t gets UINT: (type)->length + Function read_memory expects arg 3 to be ssize_t gets ULONGEST: (type)->length +LOC spu-tdep.c:323 + Variable preferred_slot initialized to type LONGEST, expects int: len < 4 ? 4 - len : 0 spu-tdep.c: (in function spu_gdbarch_id) spu-tdep.c: (in function spu_pointer_to_address) LOC spu-tdep.c:1296 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC spu-tdep.c:1321 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC spu-tdep.c:1376 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC spu-tdep.c:1409 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC spu-tdep.c:1475 - Operands of <= have incompatible types (UINT, int): (type)->length <= (SPU_ARGN_REGNUM - SPU_ARG1_REGNUM + 1) * 16 + Operands of <= have incompatible types (ULONGEST, int): (type)->length <= (SPU_ARGN_REGNUM - SPU_ARG1_REGNUM + 1) * 16 LOC tracepoint.c:1483 (tracepoint.c:1482) - Function add_memrange expects arg 3 to be bfd_signed_vma gets ULONGEST: addr + Function add_memrange expects arg 3 to be bfd_signed_vma gets CORE_ADDR: addr LOC tracepoint.c:4687 (tracepoint.c:4682) - Assignment of unsigned short int to int: r->length = mlen + Assignment of unsigned short int to LONGEST: r->length = mlen LOC v850-tdep.c:812 - Previous definition of len: int + Previous definition of len: LONGEST LOC v850-tdep.c:851 - Assignment of UINT to int: len = (value_type(*args))->length + Assignment of ULONGEST to int: len = (value_type(*args))->length LOC v850-tdep.c:900 (v850-tdep.c:908) + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC v850-tdep.c:908 Passed storage buf not completely defined (*buf is undefined): regcache_raw_read (..., buf) +LOC v850-tdep.c:925 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: len +LOC v850-tdep.c:929 + Operands of < have incompatible types (int, LONGEST): i < len LOC valarith.c:713 - Assignment of UINT to int: inval2len = (type2)->length + Assignment of ULONGEST to int: inval2len = (type2)->length LOC valarith.c:757 - Assignment of UINT to int: inval1len = (type1)->length + Assignment of ULONGEST to int: inval1len = (type1)->length LOC valarith.c:758 - Assignment of UINT to int: inval2len = (type2)->length + Assignment of ULONGEST to int: inval2len = (type2)->length LOC valarith.c:895 - Assignment of UINT to int: *len_x = (type1)->length + Assignment of ULONGEST to int: *len_x = (type1)->length LOC valarith.c:901 - Assignment of UINT to int: *len_x = (type2)->length + Assignment of ULONGEST to int: *len_x = (type2)->length LOC valarith.c:914 - Assignment of UINT to int: *len_y = (type2)->length + Assignment of ULONGEST to int: *len_y = (type2)->length LOC valarith.c:920 - Assignment of UINT to int: *len_y = (type1)->length + Assignment of ULONGEST to int: *len_y = (type1)->length LOC valarith.c:973 - Assignment of UINT to int: len_v = (result_type)->length + Assignment of ULONGEST to int: len_v = (result_type)->length LOC valarith.c:1414 - Assignment of UINT to int: elsize = (eltype1)->length + Assignment of ULONGEST to int: elsize = (eltype1)->length LOC valarith.c:1417 - Operands of != have incompatible types (int, UINT): elsize != (eltype2)->length + Operands of != have incompatible types (int, ULONGEST): elsize != (eltype2)->length LOC valarith.c:1487 - Function decimal_is_zero expects arg 2 to be int gets UINT: (type1)->length + Function decimal_is_zero expects arg 2 to be int gets ULONGEST: (type1)->length +LOC valarith.c:1512 + Variable len initialized to type LONGEST, expects int: len1 < len2 ? len1 : len2 LOC valarith.c:1628 - Function memcmp expects arg 3 to be size_t gets UINT: (type1)->length + Function memcmp expects arg 3 to be size_t gets ULONGEST: (type1)->length LOC valarith.c:1718 - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC valarith.c:1739 - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC valarith.c:1772 - Function memcpy expects arg 3 to be size_t gets UINT: (eltype)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (eltype)->length LOC valarith.c:1809 - Function memcpy expects arg 3 to be size_t gets UINT: (eltype)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (eltype)->length LOC valops.c:474 (valops.c:473) - Variable dec_len initialized to type UINT, expects int: (type)->length + Variable dec_len initialized to type ULONGEST, expects int: (type)->length LOC valops.c:480 (valops.c:479) - Function decimal_convert expects arg 2 to be int gets UINT: (type2)->length + Function decimal_convert expects arg 2 to be int gets ULONGEST: (type2)->length LOC valops.c:569 (valops.c:568) - Function memcpy expects arg 3 to be size_t gets UINT: (eltype)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (eltype)->length LOC valops.c:884 (valops.c:882) - Function decimal_from_string expects arg 2 to be int gets UINT: (type)->length + Function decimal_from_string expects arg 2 to be int gets ULONGEST: (type)->length LOC valops.c:910 (valops.c:908) - Function memcpy expects arg 3 to be size_t gets UINT: (eltype)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (eltype)->length LOC valops.c:999 (valops.c:997) - Variable length initialized to type UINT, expects int: (type)->length -LOC valops.c:1000 - Function value_bits_valid expects arg 2 to be int gets LONGEST: 8 * offset + value_bitpos(val) + Variable length initialized to type ULONGEST, expects LONGEST: (type)->length LOC valops.c:1006 - Function unpack_value_bits_as_long expects arg 3 to be int gets LONGEST: offset -LOC valops.c:1004 New fresh storage (type struct type *) passed as implicitly temp (not released): value_type(val) LOC valops.c:1015 (valops.c:1013) + Function store_signed_integer expects arg 2 to be int gets LONGEST: length +LOC valops.c:1015 New fresh storage (type gdb_byte *) passed as implicitly temp (not released): value_contents_raw(val) LOC valops.c:1022 (valops.c:1019) - New fresh storage (type struct type *) passed as implicitly temp (not released): value_enclosing_type(val) + Variable length initialized to type ULONGEST, expects LONGEST: (check_typedef(enclosing_type))->length LOC valops.c:1024 (valops.c:1019) - Variable length initialized to type UINT, expects int: (check_typedef(value_enclosing_type(val)))->length + Test expression for if not boolean, type LONGEST: length LOC valops.c:1026 (valops.c:1021) - Test expression for if not boolean, type int: length -LOC valops.c:1023 - Function read_value_memory expects arg 6 to be size_t gets int: length + Function read_value_memory expects arg 6 to be size_t gets LONGEST: length LOC valops.c:1027 (valops.c:1029) + Fresh storage enclosing_type not released before scope exit + LOC valops.c:1021 + Fresh storage enclosing_type created +LOC valops.c:1032 New fresh storage (type struct type *) passed as implicitly temp (not released): value_type(val) LOC valops.c:1284 (valops.c:1281) - Operands of <= have incompatible types (UINT, int): (type)->length <= (int)sizeof(LONGEST) + Operands of <= have incompatible types (ULONGEST, int): (type)->length <= (int)sizeof(LONGEST) LOC valops.c:1293 (valops.c:1290) - Function read_memory expects arg 3 to be ssize_t gets int: changed_len + Function read_memory expects arg 3 to be ssize_t gets LONGEST: changed_len LOC valops.c:1305 (valops.c:1302) - Function write_memory expects arg 3 to be ssize_t gets int: changed_len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: changed_len +LOC valops.c:1306 + Function observer_notify_memory_changed expects arg 2 to be int gets LONGEST: changed_len LOC valops.c:1354 (valops.c:1351) - Function get_frame_register_bytes expects arg 3 to be CORE_ADDR gets int: offset + Function get_frame_register_bytes expects arg 3 to be CORE_ADDR gets LONGEST: offset LOC valops.c:1368 (valops.c:1365) - Function put_frame_register_bytes expects arg 3 to be CORE_ADDR gets int: offset + Function put_frame_register_bytes expects arg 3 to be CORE_ADDR gets LONGEST: offset LOC valops.c:1374 (valops.c:1371) - Function put_frame_register_bytes expects arg 3 to be CORE_ADDR gets int: value_offset(toval) + Function put_frame_register_bytes expects arg 3 to be CORE_ADDR gets LONGEST: value_offset(toval) LOC valops.c:1375 (valops.c:1372) - Function put_frame_register_bytes expects arg 4 to be int gets UINT: (type)->length + Function put_frame_register_bytes expects arg 4 to be int gets ULONGEST: (type)->length LOC valops.c:1459 (valops.c:1456) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC valops.c:1493 (valops.c:1490) - Function read_value_memory expects arg 6 to be size_t gets UINT: (value_enclosing_type(val))->length + Function read_value_memory expects arg 6 to be size_t gets ULONGEST: (value_enclosing_type(val))->length LOC valops.c:1832 (valops.c:1830) - Function value_contents_copy expects arg 5 to be int gets UINT: typelength + Function value_contents_copy expects arg 2 to be LONGEST gets ULONGEST: idx * typelength +LOC valops.c:1833 + Function value_contents_copy expects arg 5 to be LONGEST gets ULONGEST: typelength LOC valops.c:1842 (valops.c:1839) - Function value_contents_copy expects arg 5 to be int gets UINT: typelength + Function value_contents_copy expects arg 2 to be LONGEST gets ULONGEST: idx * typelength +LOC valops.c:1842 + Function value_contents_copy expects arg 5 to be LONGEST gets ULONGEST: typelength LOC valops.c:1851 (valops.c:1853) + Variable highbound initialized to type ULONGEST, expects int: len / (char_type)->length +LOC valops.c:1856 Function memcpy expects arg 3 to be size_t gets int: len LOC valops.c:1874 (valops.c:1876) + Variable highbound initialized to type ULONGEST, expects int: len / (char_type)->length +LOC valops.c:1879 Function memcpy expects arg 3 to be size_t gets int: len LOC valops.c:1893 (valops.c:1890) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length LOC valops.c:2139 (valops.c:2136) - Function target_read_memory expects arg 3 to be ssize_t gets UINT: (basetype)->length + Function target_read_memory expects arg 3 to be ssize_t gets ULONGEST: (basetype)->length LOC valops.c:2175 (valops.c:2171) + Function update_search_result expects arg 4 to be int gets LONGEST: boffset +LOC valops.c:2174 Null storage v passed as non-null param: update_search_result (..., v, ...) LOC valops.c:2289 (valops.c:2286) - Function C_alloca expects arg 1 to be size_t gets UINT: (baseclass)->length + Function C_alloca expects arg 1 to be size_t gets ULONGEST: (baseclass)->length LOC valops.c:2293 (valops.c:2290) - Function target_read_memory expects arg 3 to be ssize_t gets UINT: (baseclass)->length + Function target_read_memory expects arg 3 to be ssize_t gets ULONGEST: (baseclass)->length LOC valops.c:3356 (valops.c:3353) - Left operand of >> may be negative (int): ((((t)->main_type->flds_bnds.fields[i]).loc.bitpos) + 0) >> 3 + Left operand of >> may be negative (LONGEST): ((((t)->main_type->flds_bnds.fields[i]).loc.bitpos) + 0) >> 3 LOC valops.c:3825 (valops.c:3821) - Function value_contents_copy expects arg 4 to be int gets LONGEST: offset -LOC valops.c:3822 - Function value_contents_copy expects arg 5 to be int gets UINT: (slice_type)->length -LOC valops.c:3827 - Function set_value_offset expects arg 2 to be int gets LONGEST: value_offset(array) + offset + Function value_contents_copy expects arg 5 to be LONGEST gets ULONGEST: (slice_type)->length LOC valops.c:3854 (valops.c:3851) - Function memcpy expects arg 3 to be size_t gets UINT: (real_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (real_type)->length LOC valops.c:3856 (valops.c:3853) - Function memcpy expects arg 3 to be size_t gets UINT: (real_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (real_type)->length LOC valops.c:3874 (valops.c:3871) - Function memcpy expects arg 3 to be size_t gets UINT: (val_real_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (val_real_type)->length LOC valops.c:3877 (valops.c:3874) - Function memcpy expects arg 3 to be size_t gets UINT: (val_real_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (val_real_type)->length LOC valprint.c:848 - Operands of > have incompatible types (UINT, size_t): (type)->length > sizeof(LONGEST) + Operands of > have incompatible types (ULONGEST, size_t): (type)->length > sizeof(LONGEST) LOC valprint.c:1024 (valprint.c:1035) + Variable len initialized to type ULONGEST, expects UINT: (type)->length +LOC valprint.c:1035 Test expression for if not boolean, type int: floatformat_is_negative(fmt, valaddr) LOC valprint.c:1096 (valprint.c:1098) + Variable len initialized to type ULONGEST, expects UINT: (type)->length +LOC valprint.c:1098 Function decimal_to_string expects arg 2 to be int gets UINT: len LOC valprint.c:1607 (valprint.c:1611) + Operands of < have incompatible types (UINT, ULONGEST): i < len +LOC valprint.c:1611 Test expression for if not boolean, type int: options->prettyprint_arrays LOC valprint.c:1631 (valprint.c:1637) - Function value_available_contents_eq expects arg 5 to be int gets UINT: eltlen + Operands of < have incompatible types (UINT, ULONGEST): rep1 < len +LOC valprint.c:1637 + Function value_available_contents_eq expects arg 5 to be LONGEST gets ULONGEST: eltlen +LOC valprint.c:1666 + Operands of < have incompatible types (UINT, ULONGEST): i < len valprint.c: (in function partial_memory_read) LOC valprint.c:1979 - Function C_alloca expects arg 1 to be size_t gets UINT: (type)->length + Function C_alloca expects arg 1 to be size_t gets ULONGEST: (type)->length LOC valprint.c:1982 - Function make_wchar_iterator expects arg 2 to be size_t gets UINT: (type)->length + Function make_wchar_iterator expects arg 2 to be size_t gets ULONGEST: (type)->length LOC valprint.c:1983 - Function make_wchar_iterator expects arg 4 to be size_t gets UINT: (type)->length + Function make_wchar_iterator expects arg 4 to be size_t gets ULONGEST: (type)->length LOC valprint.c:2023 - Function print_wchar expects arg 4 to be int gets UINT: (type)->length + Function print_wchar expects arg 4 to be int gets ULONGEST: (type)->length LOC valprint.c:2030 - Function print_wchar expects arg 4 to be int gets UINT: (type)->length + Function print_wchar expects arg 4 to be int gets ULONGEST: (type)->length LOC valprint.c:2071 - Variable width initialized to type UINT, expects int: (type)->length + Variable width initialized to type ULONGEST, expects int: (type)->length LOC valprint.c:2079 - Operands of == have incompatible types (UINT, int): length == -1 + Operands of == have incompatible types (ULONGEST, int): length == -1 LOC valprint.c:2109 - Function make_wchar_iterator expects arg 2 to be size_t gets UINT: length * width + Function make_wchar_iterator expects arg 2 to be size_t gets ULONGEST: length * width LOC valprint.c:2313 - Variable width initialized to type UINT, expects int: (elttype)->length + Variable width initialized to type ULONGEST, expects int: (elttype)->length LOC valprint.c:2366 - Function expects arg 4 to be UINT gets int: bytes_read / width + Function expects arg 4 to be ULONGEST gets int: bytes_read / width LOC value.c:449 (value.c:447) - Assignment of UINT to int: i = (VEC_range_s_lower_bound(value->unavailable, &newr, range_lessthan, "/home/siddhesh/src/upstream/gdb-sources/gdb.git/gdb/value.c", 447)) + Assignment of UINT to int: i = (VEC_range_s_lower_bound(value->unavailable, &newr, range_lessthan, "/home/siddhesh/src/upstream/gdb-sources/gdb.git/gdb/value.c", 449)) LOC value.c:568 (value.c:566) - Function memcmp expects arg 3 to be size_t gets int: length + Function memcmp expects arg 3 to be size_t gets LONGEST: length LOC value.c:697 (value.c:695) - Function xzalloc expects arg 1 to be size_t gets UINT: (val->enclosing_type)->length + Function xzalloc expects arg 1 to be size_t gets ULONGEST: (val->enclosing_type)->length value.c: (in function allocate_repeat_value) LOC value.c:949 (value.c:946) - Function memcpy expects arg 3 to be size_t gets int: length + Function memcpy expects arg 3 to be size_t gets LONGEST: length LOC value.c:962 (value.c:958) - Function mark_value_bytes_unavailable expects arg 2 to be int gets ULONGEST: dst_offset + (l - src_offset) -LOC value.c:959 - Function mark_value_bytes_unavailable expects arg 3 to be int gets ULONGEST: h - l + Function mark_value_bytes_unavailable expects arg 3 to be LONGEST gets ULONGEST: h - l value.c: (in function value_contents_copy) LOC value.c:1047 (value.c:1044) - Function memcmp expects arg 3 to be size_t gets int: len + Function memcmp expects arg 3 to be size_t gets LONGEST: len LOC value.c:1402 (value.c:1399) - Function memcpy expects arg 3 to be size_t gets UINT: (value_enclosing_type(arg))->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (value_enclosing_type(arg))->length LOC value.c:1430 (value.c:1427) - Function memcpy expects arg 3 to be size_t gets UINT: (enc_type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (enc_type)->length LOC value.c:1957 (value.c:1954) - Function memcpy expects arg 3 to be size_t gets UINT: (value_type(newval))->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (value_type(newval))->length LOC value.c:2421 (value.c:2418) - Variable len initialized to type UINT, expects int: (type)->length + Variable len initialized to type ULONGEST, expects int: (type)->length LOC value.c:2477 (value.c:2474) - Assignment of UINT to int: len = (type)->length + Assignment of ULONGEST to int: len = (type)->length LOC value.c:2600 (value.c:2597) - Function xrealloc expects arg 2 to be size_t gets UINT: (new_encl_type)->length + Function xrealloc expects arg 2 to be size_t gets ULONGEST: (new_encl_type)->length LOC value.c:2647 (value.c:2644) - Operands of <= have incompatible types (UINT, int): (type)->length <= (int)sizeof(LONGEST) + Operands of <= have incompatible types (ULONGEST, int): (type)->length <= (int)sizeof(LONGEST) +LOC value.c:2648 + Assignment of LONGEST to int: v->bitpos = bitpos % container_bitsize +LOC value.c:2650 + Assignment of LONGEST to int: v->bitpos = bitpos % 8 LOC value.c:2816 (value.c:2815) - Assignment of UINT to int: bytes_read = (field_type)->length + Assignment of LONGEST to int: bytes_read = ((bitpos % 8) + bitsize + 7) / 8 +LOC value.c:2818 + Assignment of ULONGEST to int: bytes_read = (field_type)->length LOC value.c:2833 + Assignment of LONGEST to int: lsbcount = (bytes_read * 8 - bitpos % 8 - bitsize) +LOC value.c:2835 + Assignment of LONGEST to int: lsbcount = (bitpos % 8) +LOC value.c:2836 Right operand of >>= may be negative (int): val >>= lsbcount value.c: (in function modify_field) LOC value.c:3007 + Function extract_unsigned_integer expects arg 2 to be int gets LONGEST: bytesize +LOC value.c:3010 New fresh storage (type struct gdbarch *) passed as implicitly temp (not released): get_type_arch(type) LOC value.c:3013 (value.c:3010) - Right operand of << may be negative (int): mask << bitpos + Right operand of << may be negative (LONGEST): mask << bitpos LOC value.c:3014 (value.c:3011) - Right operand of << may be negative (int): fieldval << bitpos + Right operand of << may be negative (LONGEST): fieldval << bitpos +LOC value.c:3016 + Function store_unsigned_integer expects arg 2 to be int gets LONGEST: bytesize value.c: (in function pack_long) LOC value.c:3028 (value.c:3025) - Assignment of UINT to int: len = (type)->length + Assignment of ULONGEST to int: len = (type)->length LOC value.c:3063 (value.c:3060) - Assignment of UINT to int: len = (type)->length + Assignment of ULONGEST to int: len = (type)->length LOC value.c:3144 (value.c:3141) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length value.c: (in function value_from_contents) LOC value.c:3160 (value.c:3157) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length value.c: (in function value_from_double) LOC value.c:3186 (value.c:3183) - Function memcpy expects arg 3 to be size_t gets UINT: (type)->length + Function memcpy expects arg 3 to be size_t gets ULONGEST: (type)->length value.c: (in function value_from_history_ref) LOC vax-tdep.c:132 - Function write_memory expects arg 3 to be ssize_t gets int: len + Function write_memory expects arg 3 to be ssize_t gets LONGEST: len LOC vax-tdep.c:227 - Function read_memory expects arg 3 to be ssize_t gets int: len + Function read_memory expects arg 3 to be ssize_t gets LONGEST: len LOC vax-tdep.c:239 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len LOC vax-tdep.c:244 - Function memcpy expects arg 3 to be size_t gets int: len + Function memcpy expects arg 3 to be size_t gets LONGEST: len +LOC xstormy16-tdep.c:287 + Assignment of LONGEST to int: slacklen = typelen & 1 LOC xstormy16-tdep.c:288 (xstormy16-tdep.c:285) - Function C_alloca expects arg 1 to be size_t gets int: typelen + slacklen + Function C_alloca expects arg 1 to be size_t gets LONGEST: typelen + slacklen LOC xstormy16-tdep.c:289 (xstormy16-tdep.c:286) - Function memcpy expects arg 3 to be size_t gets int: typelen + Function memcpy expects arg 3 to be size_t gets LONGEST: typelen LOC xstormy16-tdep.c:293 (xstormy16-tdep.c:290) - Function write_memory expects arg 3 to be ssize_t gets int: typelen + slacklen + Function write_memory expects arg 3 to be ssize_t gets LONGEST: typelen + slacklen xstormy16-tdep.c: (in function xstormy16_alloc_frame_cache) LOC xtensa-tdep.c:1621 (xtensa-tdep.c:1625) + Assignment of LONGEST to int: offset = 4 - len +LOC xtensa-tdep.c:1626 + Function regcache_raw_read_part expects arg 4 to be int gets LONGEST: len +LOC xtensa-tdep.c:1626 Return value (type enum register_status) ignored: regcache_raw_rea... LOC xtensa-tdep.c:1671 (xtensa-tdep.c:1675) + Assignment of LONGEST to int: offset = 4 - len +LOC xtensa-tdep.c:1676 Function regcache_raw_write_part expects arg 2 to be int gets UINT: areg LOC xtensa-tdep.c:1676 (xtensa-tdep.c:1677) + Function regcache_raw_write_part expects arg 4 to be int gets LONGEST: len +LOC xtensa-tdep.c:1678 Function regcache_raw_write expects arg 2 to be int gets UINT: areg LOC xtensa-tdep.c:1785 (xtensa-tdep.c:1795) + Fresh storage arg_type_len_s not released before scope exit + LOC xtensa-tdep.c:1767 + Fresh storage arg_type_len_s created +LOC xtensa-tdep.c:1797 Test expression for if not boolean, type int: struct_return LOC xtensa-tdep.c:1822 (xtensa-tdep.c:1820) - Assignment of UINT to int: info->align = (arg_type)->length + Assignment of ULONGEST to int: info->align = (arg_type)->length LOC xtensa-tdep.c:1830 (xtensa-tdep.c:1828) - Assignment of UINT to int: info->align = (builtin_type(gdbarch)->builtin_double)->length + Assignment of ULONGEST to int: info->align = (builtin_type(gdbarch)->builtin_double)->length LOC xtensa-tdep.c:1832 (xtensa-tdep.c:1830) - Assignment of UINT to int: info->align = (builtin_type(gdbarch)->builtin_long)->length + Assignment of ULONGEST to int: info->align = (builtin_type(gdbarch)->builtin_long)->length LOC xtensa-tdep.c:1837 (xtensa-tdep.c:1835) - Assignment of UINT to int: info->align = (builtin_type(gdbarch)->builtin_long)->length + Assignment of ULONGEST to int: info->align = (builtin_type(gdbarch)->builtin_long)->length +LOC xtensa-tdep.c:1856 + Assignment of LONGEST to int: info->u.regno = (gdbarch_tdep(gdbarch)->call_abi == CallAbiCall0Only ? (gdbarch_tdep(gdbarch)->a0_base + 2) : (gdbarch_tdep(gdbarch)->a0_base + 6)) + size / 4 LOC xtensa-tdep.c:1886 (xtensa-tdep.c:1895) - Function write_memory expects arg 3 to be ssize_t gets int: info->length + Variable n initialized to type LONGEST, expects int: info->length +LOC xtensa-tdep.c:1897 + Function write_memory expects arg 3 to be ssize_t gets LONGEST: info->length +LOC xtensa-tdep.c:1902 + Variable n initialized to type LONGEST, expects int: info->length ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-23 17:46 ` Jan Kratochvil 2012-05-24 1:36 ` Siddhesh Poyarekar @ 2012-05-31 6:39 ` Siddhesh Poyarekar 2012-05-31 9:24 ` Siddhesh Poyarekar 1 sibling, 1 reply; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-05-31 6:39 UTC (permalink / raw) To: Jan Kratochvil; +Cc: gdb-patches, Tom Tromey On Wed, 23 May 2012 19:46:10 +0200, Jan wrote: > Yes, this size_t change - needs to be also posted to > binutils@sourceware.org for approval (the bfd/ part). I think it > should be done first and the mail to binutils@sourceware.org (Cc > gdb-patches) should not contain parts affecting only gdb/ (it should > contain parts needed to keep gdb/ compatible with the bfd/ changes). > Also maybe binutils will have different opinion on it. > I was getting the second part of this change ready for submission (the first part, i.e. the bfd changes are already posted to gdb-patches and binutils) when I realized that my earlier patch was not consistent with the size_t changes for read/write to memory. The additional changes have mainly to do with changes to to_xfer_partial() and related changes and practically all of it changes LONGEST to size_t. Making these changes is going to be another large patch (not counting the bitpos/type.length changes). Not having the changes will only cause an inconsistency in the code in terms of readability, but should not affect functionality. Is it OK if I just post the changes relevant to bitpos/type.length and leave the rest maybe for later? Regards, Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
* Re: [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST 2012-05-31 6:39 ` [PATCH v2] " Siddhesh Poyarekar @ 2012-05-31 9:24 ` Siddhesh Poyarekar 0 siblings, 0 replies; 70+ messages in thread From: Siddhesh Poyarekar @ 2012-05-31 9:24 UTC (permalink / raw) To: gdb-patches; +Cc: Jan Kratochvil, Tom Tromey On Thu, 31 May 2012 12:09:47 +0530, Siddhesh wrote: > Not having the changes will only cause an inconsistency in the code in > terms of readability, but should not affect functionality. Is it OK > if I just post the changes relevant to bitpos/type.length and leave > the rest maybe for later? I've posted the patch nevertheless so that if it is OK, then the patch may be reviewed too: http://sourceware.org/ml/gdb-patches/2012-05/msg01073.html Regards, Siddhesh ^ permalink raw reply [flat|nested] 70+ messages in thread
end of thread, other threads:[~2012-06-23 1:59 UTC | newest] Thread overview: 70+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-02-20 14:53 [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct Siddhesh Poyarekar 2012-02-21 20:46 ` Tom Tromey 2012-02-22 7:44 ` Siddhesh Poyarekar 2012-02-29 13:55 ` Siddhesh Poyarekar 2012-02-29 13:59 ` Siddhesh Poyarekar 2012-03-01 22:45 ` Jan Kratochvil 2012-03-05 6:34 ` Siddhesh Poyarekar 2012-03-05 8:05 ` Jan Kratochvil 2012-03-21 10:06 ` [PATCH] Allow 64-bit enum values Siddhesh Poyarekar 2012-03-27 17:00 ` Jan Kratochvil 2012-03-28 4:19 ` Siddhesh Poyarekar 2012-03-30 16:15 ` Jan Kratochvil 2012-04-17 14:01 ` Jan Kratochvil 2012-04-18 2:53 ` Siddhesh Poyarekar 2012-04-18 6:58 ` [commit] " Jan Kratochvil 2012-04-18 7:06 ` [ChangeLog commit] " Jan Kratochvil 2012-04-19 16:58 ` [commit] " Ulrich Weigand 2012-04-20 4:23 ` Siddhesh Poyarekar 2012-04-20 7:50 ` [obv] Fix python-2.4 compilation compat. [Re: [commit] [PATCH] Allow 64-bit enum values] Jan Kratochvil 2012-04-20 19:00 ` Tom Tromey 2012-03-28 16:55 ` [PATCH] Allow 64-bit enum values Tom Tromey 2012-03-29 10:56 ` Siddhesh Poyarekar 2012-04-17 13:11 ` [commit] Support 64-bit constants/enums on 32-bit host [Re: [PATCH] Allow 64-bit enum values] Jan Kratochvil 2012-04-17 13:16 ` [patch!] " Jan Kratochvil 2012-04-17 14:33 ` [commit] " Tom Tromey 2012-04-17 14:55 ` Jan Kratochvil 2012-04-17 15:18 ` Tom Tromey 2012-04-17 15:32 ` Jan Kratochvil 2012-04-17 19:32 ` Jan Kratochvil 2012-04-17 20:51 ` Tom Tromey 2012-04-18 7:01 ` [real commit] " Jan Kratochvil 2012-04-17 14:33 ` [patch] " Jan Kratochvil 2012-04-17 15:59 ` Tom Tromey 2012-04-17 15:42 ` Jan Kratochvil 2012-04-17 15:52 ` Tom Tromey 2012-02-21 21:39 ` [PATCH] Expand bitpos to LONGEST to allow access to large offsets within a struct Jan Kratochvil 2012-05-04 13:10 ` [PATCH v2] Expand bitpos and type.length to LONGEST and ULONGEST Siddhesh Poyarekar 2012-05-15 9:46 ` ping: " Siddhesh Poyarekar 2012-05-15 9:49 ` Jan Kratochvil 2012-05-15 10:02 ` Siddhesh Poyarekar 2012-05-15 20:07 ` Jan Kratochvil 2012-05-16 3:50 ` Siddhesh Poyarekar 2012-05-16 7:19 ` Jan Kratochvil 2012-05-16 7:41 ` Siddhesh Poyarekar 2012-05-20 15:43 ` Doug Evans 2012-05-20 20:24 ` Jan Kratochvil 2012-05-20 20:28 ` Doug Evans 2012-05-23 13:52 ` Siddhesh Poyarekar 2012-05-23 17:46 ` Jan Kratochvil 2012-05-24 1:36 ` Siddhesh Poyarekar 2012-05-24 15:01 ` Jan Kratochvil 2012-05-31 18:15 ` [PATCH v3] " Siddhesh Poyarekar 2012-06-05 22:27 ` Jan Kratochvil 2012-06-06 18:23 ` Siddhesh Poyarekar 2012-06-06 21:34 ` Jan Kratochvil 2012-06-08 14:16 ` Jan Kratochvil 2012-06-08 15:27 ` Jan Kratochvil 2012-06-11 12:53 ` Siddhesh Poyarekar 2012-06-11 13:00 ` Jan Kratochvil 2012-06-11 18:33 ` Siddhesh Poyarekar 2012-06-12 9:56 ` Jan Kratochvil 2012-06-12 14:35 ` Jan Kratochvil 2012-06-18 10:31 ` [1/2][PATCH " Siddhesh Poyarekar 2012-06-20 15:47 ` Jan Kratochvil 2012-06-20 16:32 ` Siddhesh Poyarekar 2012-06-20 17:25 ` Jan Kratochvil 2012-06-23 1:59 ` Siddhesh Poyarekar 2012-06-18 10:31 ` [2/2][PATCH " Siddhesh Poyarekar 2012-05-31 6:39 ` [PATCH v2] " Siddhesh Poyarekar 2012-05-31 9:24 ` Siddhesh Poyarekar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox