This is the mail archive of the gdb-patches@sources.redhat.com 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: [commit] s/extract_address/.../ for *lang*


Hello Andrew,

> 2003-05-23  Andrew Cagney  <cagney@redhat.com>
> 
> 	* p-valprint.c (pascal_val_print): Replace extract_address with
> 	the inline equivalent extract_unsigned_integer.
> 	* jv-valprint.c (java_value_print): Ditto.
> 	* ada-valprint.c (ada_val_print_1): Ditto.
> 	* ada-lang.h (EXTRACT_ADDRESS): Ditto.

FYI: we decide to replace these extract_address calls with calls to
extract_typed_address, using the builtin_type_void_data_ptr, vis:

<<
  @@ -821,8 +820,8 @@ ada_val_print_1 (struct type *type, char
          {
            fprintf_filtered (stream, "@");
            print_address_numeric
  -           (extract_address (valaddr,
  -                             TARGET_PTR_BIT / HOST_CHAR_BIT), 1, stream);
  +           (extract_typed_address (valaddr, builtin_type_void_data_ptr),
  +             1, stream);
            if (deref_ref)
              fputs_filtered (": ", stream);
          }
>>

As a bonus, we got rid of this bizarre division of a target size by
a host size (unless there is a logic that escapes me - but I think it
was just a mindless typo on our part)

-- 
Joel


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