This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/4] bitpos expansion summary reloaded


Hi,

Here is a fix on top of the bitpos fixes based on the warnings
generated from gcc -Wconversion.  I have also attached the report for
review; I have not rebased since the last submission to ensure that
the line numbers don't go awry. Most of the extra warnings were either
unrelated or were the length parameter to
(store|extract)_(un)?signed_integer functions that are safe.

I have also verified that this does not cause any regressions in the
testsuite and that the gcc warnings generated after this were safe.

Regards,
Siddhesh

gdb/ChangeLog:

	* ada-lang.c (ada_lookup_struct_elt_type): Expand parameter
	DISPP to point to LONGEST.  Expand DISP to LONGEST.
	* breakpoint.c (insert_watchpoint): Expand LENGTH to LONGEST.
	(remove_watchpoint): Likewise.
	(resources_needed_watchpoint): Likewise.
	* hppa-tdep.c (hppa64_push_dummy_call): Expand OFFSET, REGNUM to
	LONGEST.
	* m32r-tdep.c (m32r_push_dummy_call): Expand STACK_ALLOC to
	LONGEST.
	* rs6000-aix-tdep.c (rs6000_push_dummy_call): Expand II to
	LONGEST.
	* tic6x-tdep.c (tic6x_push_dummy_call): Expand STACK_OFFSET to
	LONGEST.
	* valops.c (value_slice): Expand parameters LOWBOUND, LENGTH to
	LONGEST.
	* value.h (value_slice): Likewise.

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 146e733..df499db 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -152,7 +152,7 @@ static struct symbol *find_old_style_renaming_symbol (const char *,
 						      struct block *);
 
 static struct type *ada_lookup_struct_elt_type (struct type *, char *,
-                                                int, int, int *);
+                                                int, int, LONGEST *);
 
 static struct value *evaluate_subexp_type (struct expression *, int *);
 
@@ -6766,7 +6766,7 @@ ada_value_struct_elt (struct value *arg, char *name, int no_err)
 
 static struct type *
 ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
-                            int noerr, int *dispp)
+                            int noerr, LONGEST *dispp)
 {
   int i;
 
@@ -6811,7 +6811,7 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
     {
       const char *t_field_name = TYPE_FIELD_NAME (type, i);
       struct type *t;
-      int disp;
+      LONGEST disp;
 
       if (t_field_name == NULL)
         continue;
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index a7d5e32..e5788eb 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -10309,7 +10309,7 @@ static int
 insert_watchpoint (struct bp_location *bl)
 {
   struct watchpoint *w = (struct watchpoint *) bl->owner;
-  int length = w->exact ? 1 : bl->length;
+  LONGEST length = w->exact ? 1 : bl->length;
 
   return target_insert_watchpoint (bl->address, length, bl->watchpoint_type,
 				   w->cond_exp);
@@ -10321,7 +10321,7 @@ static int
 remove_watchpoint (struct bp_location *bl)
 {
   struct watchpoint *w = (struct watchpoint *) bl->owner;
-  int length = w->exact ? 1 : bl->length;
+  LONGEST length = w->exact ? 1 : bl->length;
 
   return target_remove_watchpoint (bl->address, length, bl->watchpoint_type,
 				   w->cond_exp);
@@ -10363,7 +10363,7 @@ static int
 resources_needed_watchpoint (const struct bp_location *bl)
 {
   struct watchpoint *w = (struct watchpoint *) bl->owner;
-  int length = w->exact? 1 : bl->length;
+  LONGEST length = w->exact? 1 : bl->length;
 
   return target_region_ok_for_hw_watchpoint (bl->address, length);
 }
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index e66f17f..f8444bc 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -951,7 +951,8 @@ hppa64_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 i, offset = 0;
+  int i;
+  LONGEST offset = 0;
   CORE_ADDR gp;
 
   /* "The outgoing parameter area [...] must be aligned at a 16-byte
@@ -965,7 +966,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
       LONGEST len = TYPE_LENGTH (type);
       const bfd_byte *valbuf;
       bfd_byte fptrbuf[8];
-      int regnum;
+      LONGEST regnum;
 
       /* "Each parameter begins on a 64-bit (8-byte) boundary."  */
       offset = align_up (offset, 8);
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index 438f482..d424776 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -688,7 +688,8 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		      CORE_ADDR struct_addr)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  int stack_offset, stack_alloc;
+  int stack_offset;
+  LONGEST stack_alloc;
   int argreg = ARG1_REGNUM;
   int argnum;
   struct type *type;
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index 37353f6..6353aa8 100644
--- a/gdb/rs6000-aix-tdep.c
+++ b/gdb/rs6000-aix-tdep.c
@@ -196,7 +196,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;
+  LONGEST ii;
   LONGEST len = 0;
   int argno;			/* current argument number */
   LONGEST argbytes;		/* current argument byte */
diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c
index 85fd433..915605a 100644
--- a/gdb/tic6x-tdep.c
+++ b/gdb/tic6x-tdep.c
@@ -895,7 +895,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 {
   int argreg = 0;
   int argnum;
-  int stack_offset = 4;
+  LONGEST stack_offset = 4;
   LONGEST references_offset = 4;
   CORE_ADDR func_addr = find_function_addr (function, NULL);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
diff --git a/gdb/valops.c b/gdb/valops.c
index 94e8f67..89f3bb7 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3737,7 +3737,7 @@ value_of_this_silent (const struct language_defn *lang)
    bound as the original ARRAY.  */
 
 struct value *
-value_slice (struct value *array, int lowbound, int length)
+value_slice (struct value *array, LONGEST lowbound, LONGEST length)
 {
   struct type *slice_range_type, *slice_type, *range_type;
   LONGEST lowerbound, upperbound;
diff --git a/gdb/value.h b/gdb/value.h
index 33199f3..2796262 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -936,7 +936,7 @@ extern void preserve_one_value (struct value *, struct objfile *, htab_t);
 
 extern struct value *varying_to_slice (struct value *);
 
-extern struct value *value_slice (struct value *, int, int);
+extern struct value *value_slice (struct value *, LONGEST, LONGEST);
 
 extern struct value *value_literal_complex (struct value *, struct value *,
 					    struct type *);

Attachment: gcc-warnings.out.report
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]