]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* printcmd.c (print_address_demangle): Add 'opts' argument.
authorTom Tromey <tromey@redhat.com>
Fri, 18 May 2012 15:27:25 +0000 (15:27 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 18 May 2012 15:27:25 +0000 (15:27 +0000)
* p-valprint.c (pascal_val_print): Update.
* jv-valprint.c (java_val_print): Update.
* value.h: Update.
* valprint.c (generic_val_print): Update.
(print_function_pointer_address): Add 'options' argument.  Remove
'addressprint' argument.  Update.
* m2-valprint.c (print_unpacked_pointer): Update.
* gnu-v3-abi.c (print_one_vtable): Update.
(gnuv3_print_method_ptr): Update.
* f-valprint.c (f_val_print): Update.
* cp-valprint.c (cp_print_value_fields): Update.
* valprint.h (print_function_pointer_address): Update.
* c-valprint.c (c_val_print): Update.

12 files changed:
gdb/ChangeLog
gdb/c-valprint.c
gdb/cp-valprint.c
gdb/f-valprint.c
gdb/gnu-v3-abi.c
gdb/jv-valprint.c
gdb/m2-valprint.c
gdb/p-valprint.c
gdb/printcmd.c
gdb/valprint.c
gdb/valprint.h
gdb/value.h

index 9cab34ea646851c5c35e5b8da2d314a0ae73a969..1eba1065722f5148097cde16ef0016a46a721d11 100644 (file)
@@ -1,3 +1,20 @@
+2012-05-18  Tom Tromey  <tromey@redhat.com>
+
+       * printcmd.c (print_address_demangle): Add 'opts' argument.
+       * p-valprint.c (pascal_val_print): Update.
+       * jv-valprint.c (java_val_print): Update.
+       * value.h: Update.
+       * valprint.c (generic_val_print): Update.
+       (print_function_pointer_address): Add 'options' argument.  Remove
+       'addressprint' argument.  Update.
+       * m2-valprint.c (print_unpacked_pointer): Update.
+       * gnu-v3-abi.c (print_one_vtable): Update.
+       (gnuv3_print_method_ptr): Update.
+       * f-valprint.c (f_val_print): Update.
+       * cp-valprint.c (cp_print_value_fields): Update.
+       * valprint.h (print_function_pointer_address): Update.
+       * c-valprint.c (c_val_print): Update.
+
 2012-05-18  Tom Tromey  <tromey@redhat.com>
 
        * psymtab.c (find_pc_sect_symtab_from_partial): Return the symtab
index d1fd56d7ad88363e68d09ae286d94bc0c43ba787..4e32973341726ea137e0c0efdf7dec9ac6003e2b 100644 (file)
@@ -248,8 +248,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
          CORE_ADDR addr
            = extract_typed_address (valaddr + embedded_offset, type);
 
-         print_function_pointer_address (gdbarch, addr, stream,
-                                         options->addressprint);
+         print_function_pointer_address (options, gdbarch, addr, stream);
          break;
        }
       unresolved_elttype = TYPE_TARGET_TYPE (type);
@@ -261,8 +260,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
          if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
            {
              /* Try to print what function it points to.  */
-             print_function_pointer_address (gdbarch, addr, stream,
-                                             options->addressprint);
+             print_function_pointer_address (options, gdbarch, addr, stream);
              return;
            }
 
@@ -354,8 +352,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
          CORE_ADDR addr
            = extract_typed_address (valaddr + offset, field_type);
 
-         print_function_pointer_address (gdbarch, addr, stream,
-                                         options->addressprint);
+         print_function_pointer_address (options, gdbarch, addr, stream);
        }
       else
        cp_print_value_fields_rtti (type, valaddr,
index 7dd13bbfcec662fc33c5258965a13903fcfd11fa..2e3beeaf324cc939896a0be69b6099d90c1e559c 100644 (file)
@@ -368,9 +368,9 @@ cp_print_value_fields (struct type *type, struct type *real_type,
                      CORE_ADDR addr;
                      
                      addr = extract_typed_address (valaddr + i_offset, i_type);
-                     print_function_pointer_address (get_type_arch (type),
-                                                     addr, stream,
-                                                     options->addressprint);
+                     print_function_pointer_address (options,
+                                                     get_type_arch (type),
+                                                     addr, stream);
                    }
                }
              else
index 62a71363d9661adfe7d4f2e45015ee2a7f5de4c1..3181356317967ad3de9c7bc53c9eb6419fca23ae 100644 (file)
@@ -316,8 +316,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
          if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
            {
              /* Try to print what function it points to.  */
-             print_function_pointer_address (gdbarch, addr, stream,
-                                             options->addressprint);
+             print_function_pointer_address (options, gdbarch, addr, stream);
              return;
            }
 
index ed94b846688eef1ce9a68666bab7e5ead85690bf..42b939d4192c218df793dd1756ee1cca3ce280ae 100644 (file)
@@ -620,7 +620,12 @@ gnuv3_print_method_ptr (const gdb_byte *contents,
       print_longest (stream, 'd', 1, ptr_value);
     }
   else
-    print_address_demangle (gdbarch, ptr_value, stream, demangle);
+    {
+      struct value_print_options opts;
+
+      get_user_print_options (&opts);
+      print_address_demangle (&opts, gdbarch, ptr_value, stream, demangle);
+    }
 
   if (adjustment)
     {
@@ -890,8 +895,7 @@ print_one_vtable (struct gdbarch *gdbarch, struct value *value,
       if (ex.reason < 0)
        printf_filtered (_("<error: %s>"), ex.message);
       else
-       print_function_pointer_address (gdbarch, addr, gdb_stdout,
-                                       opts->addressprint);
+       print_function_pointer_address (opts, gdbarch, addr, gdb_stdout);
       printf_filtered ("\n");
     }
 }
index 12a960f09d8e10d6f417a4ba1fd008448c25f856..9c5c245d201d07e28def0d65b0e3c895e4b99a92 100644 (file)
@@ -513,7 +513,7 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
       if (TYPE_CODE (target_type) == TYPE_CODE_FUNC)
        {
          /* Try to print what function it points to.  */
-         print_address_demangle (gdbarch, addr, stream, demangle);
+         print_address_demangle (options, gdbarch, addr, stream, demangle);
          return;
        }
 
index 9e1c1ff435c90275d650bd54dce9fb9ad0030c01..015af3b0aa4273a9aa2df0d2d163d89f3b96be07 100644 (file)
@@ -199,8 +199,7 @@ print_unpacked_pointer (struct type *type,
   if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
     {
       /* Try to print what function it points to.  */
-      print_function_pointer_address (gdbarch, addr, stream,
-                                     options->addressprint);
+      print_function_pointer_address (options, gdbarch, addr, stream);
       /* Return value is irrelevant except for string pointers.  */
       return 0;
     }
index d6373aedd4e52437a70ec3150858163b1099e506..0a32a22b6072c2ede724f80f5cff6ecdcac48b31 100644 (file)
@@ -157,7 +157,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
          /* Extract the address, assume that it is unsigned.  */
          addr = extract_unsigned_integer (valaddr + embedded_offset,
                                           TYPE_LENGTH (type), byte_order);
-         print_address_demangle (gdbarch, addr, stream, demangle);
+         print_address_demangle (options, gdbarch, addr, stream, demangle);
          break;
        }
       check_typedef (TYPE_TARGET_TYPE (type));
@@ -169,7 +169,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
       if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
        {
          /* Try to print what function it points to.  */
-         print_address_demangle (gdbarch, addr, stream, demangle);
+         print_address_demangle (options, gdbarch, addr, stream, demangle);
          return;
        }
 
@@ -292,7 +292,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
             -fvtable_thunks.  (Otherwise, look under TYPE_CODE_PTR.)  */
          /* Extract the address, assume that it is unsigned.  */
          print_address_demangle
-           (gdbarch,
+           (options, gdbarch,
             extract_unsigned_integer (valaddr + embedded_offset
                                       + TYPE_FIELD_BITPOS (type,
                                                            VTBL_FNADDR_OFFSET) / 8,
index fa7629630e618b9e6187af07fbed22026b2166c9..3bb43bdedde894a7df2ff84aa39f9476a7dd2cad 100644 (file)
@@ -767,17 +767,15 @@ pc_prefix (CORE_ADDR addr)
    or not.  */
 
 void
-print_address_demangle (struct gdbarch *gdbarch, CORE_ADDR addr,
+print_address_demangle (const struct value_print_options *opts,
+                       struct gdbarch *gdbarch, CORE_ADDR addr,
                        struct ui_file *stream, int do_demangle)
 {
-  struct value_print_options opts;
-
-  get_user_print_options (&opts);
   if (addr == 0)
     {
       fprintf_filtered (stream, "0");
     }
-  else if (opts.addressprint)
+  else if (opts->addressprint)
     {
       fputs_filtered (paddress (gdbarch, addr), stream);
       print_address_symbolic (gdbarch, addr, stream, do_demangle, " ");
index 25b62bc14bd8bc3eebceef188f090a4ff35453ec..507aeb587b8324fc0ca8c3434d7264f2d85989c7 100644 (file)
@@ -384,8 +384,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr,
          if (TYPE_CODE (elttype) == TYPE_CODE_FUNC)
            {
              /* Try to print what function it points to.  */
-             print_function_pointer_address (gdbarch, addr, stream,
-                                             options->addressprint);
+             print_function_pointer_address (options, gdbarch, addr, stream);
              return;
            }
 
@@ -515,7 +514,7 @@ generic_val_print (struct type *type, const gdb_byte *valaddr,
       type_print (type, "", stream, -1);
       fprintf_filtered (stream, "} ");
       /* Try to print what function it points to, and its address.  */
-      print_address_demangle (gdbarch, address, stream, demangle);
+      print_address_demangle (options, gdbarch, address, stream, demangle);
       break;
 
     case TYPE_CODE_BOOL:
@@ -1501,10 +1500,10 @@ print_char_chars (struct ui_file *stream, struct type *type,
    stream STREAM.  */
 
 void
-print_function_pointer_address (struct gdbarch *gdbarch,
+print_function_pointer_address (const struct value_print_options *options,
+                               struct gdbarch *gdbarch,
                                CORE_ADDR address,
-                               struct ui_file *stream,
-                               int addressprint)
+                               struct ui_file *stream)
 {
   CORE_ADDR func_addr
     = gdbarch_convert_from_func_ptr_addr (gdbarch, address,
@@ -1512,13 +1511,13 @@ print_function_pointer_address (struct gdbarch *gdbarch,
 
   /* If the function pointer is represented by a description, print
      the address of the description.  */
-  if (addressprint && func_addr != address)
+  if (options->addressprint && func_addr != address)
     {
       fputs_filtered ("@", stream);
       fputs_filtered (paddress (gdbarch, address), stream);
       fputs_filtered (": ", stream);
     }
-  print_address_demangle (gdbarch, func_addr, stream, demangle);
+  print_address_demangle (options, gdbarch, func_addr, stream, demangle);
 }
 
 
index 56c0c92c01c6752c0f705c20eecb54110cb9866c..817e5cd48dec8664da19fafcb1336dc3c2f833df 100644 (file)
@@ -148,10 +148,10 @@ extern void print_hex_chars (struct ui_file *, const gdb_byte *,
 extern void print_char_chars (struct ui_file *, struct type *,
                              const gdb_byte *, unsigned int, enum bfd_endian);
 
-extern void print_function_pointer_address (struct gdbarch *gdbarch,
+extern void print_function_pointer_address (const struct value_print_options *options,
+                                           struct gdbarch *gdbarch,
                                            CORE_ADDR address,
-                                           struct ui_file *stream,
-                                           int addressprint);
+                                           struct ui_file *stream);
 
 int read_string (CORE_ADDR addr, int len, int width, unsigned int fetchlimit,
                 enum bfd_endian byte_order, gdb_byte **buffer,
index 055b69eb203f3b1c0f47eca409b9c3d4b0c9447d..6e5066c3afb526896e62e477e1e729b126924dad 100644 (file)
@@ -491,7 +491,8 @@ extern void read_value_memory (struct value *val, int embedded_offset,
 struct frame_info;
 struct fn_field;
 
-extern void print_address_demangle (struct gdbarch *, CORE_ADDR,
+extern void print_address_demangle (const struct value_print_options *,
+                                   struct gdbarch *, CORE_ADDR,
                                    struct ui_file *, int);
 
 extern LONGEST value_as_long (struct value *val);