From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6140 invoked by alias); 27 Feb 2004 19:05:36 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6128 invoked from network); 27 Feb 2004 19:05:35 -0000 Received: from unknown (HELO localhost.redhat.com) (216.129.200.20) by sources.redhat.com with SMTP; 27 Feb 2004 19:05:35 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 112472B92; Fri, 27 Feb 2004 14:05:26 -0500 (EST) Message-ID: <403F94F6.2030801@gnu.org> Date: Fri, 27 Feb 2004 19:05:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [commit/hppa] Enable 32-bit push_dummy_call and return_value Content-Type: multipart/mixed; boundary="------------000104070407040108030605" X-SW-Source: 2004-02/txt/msg00808.txt.bz2 This is a multi-part message in MIME format. --------------000104070407040108030605 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 329 Hello, I just did a comparison between the old and new 32-bit code and the new inferior call and struct return code, while still occasionally tripping up, is way better than the old. structs.exp, for instance, gets 70 fails rather than at least 170 (it hangs). This enables that part of the 32-bit code, committed, Andrew --------------000104070407040108030605 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 8372 Index: ChangeLog 2004-02-27 Andrew Cagney * hppa-tdep.c (hppa_gdbarch_init): On 32-bit systems always "return_value" and "push_dummy_call". (hppa32_use_struct_convention): Delete unused function. (hppa32_store_return_value): Delete unused function. (hppa32_extract_return_value): Delete unused function. (hppa32_stack_align): Delete function. Index: hppa-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/hppa-tdep.c,v retrieving revision 1.127 diff -u -r1.127 hppa-tdep.c --- hppa-tdep.c 27 Feb 2004 16:38:39 -0000 1.127 +++ hppa-tdep.c 27 Feb 2004 18:58:33 -0000 @@ -183,7 +183,6 @@ int hppa_in_solib_return_trampoline (CORE_ADDR pc, char *name); CORE_ADDR hppa_saved_pc_after_call (struct frame_info *frame); int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs); -CORE_ADDR hppa32_stack_align (CORE_ADDR sp); CORE_ADDR hppa64_stack_align (CORE_ADDR sp); int hppa_pc_requires_run_before_use (CORE_ADDR pc); int hppa_instruction_nullified (void); @@ -192,13 +191,9 @@ struct type * hppa32_register_virtual_type (int reg_nr); struct type * hppa64_register_virtual_type (int reg_nr); void hppa_store_struct_return (CORE_ADDR addr, CORE_ADDR sp); -void hppa32_extract_return_value (struct type *type, char *regbuf, - char *valbuf); void hppa64_extract_return_value (struct type *type, char *regbuf, char *valbuf); -int hppa32_use_struct_convention (int gcc_p, struct type *type); int hppa64_use_struct_convention (int gcc_p, struct type *type); -void hppa32_store_return_value (struct type *type, char *valbuf); void hppa64_store_return_value (struct type *type, char *valbuf); int hppa_cannot_store_register (int regnum); void hppa_init_extra_frame_info (int fromleaf, struct frame_info *frame); @@ -241,14 +236,6 @@ /* Should call_function allocate stack space for a struct return? */ int -hppa32_use_struct_convention (int gcc_p, struct type *type) -{ - return (TYPE_LENGTH (type) > 2 * DEPRECATED_REGISTER_SIZE); -} - -/* Same as hppa32_use_struct_convention() for the PA64 ABI. */ - -int hppa64_use_struct_convention (int gcc_p, struct type *type) { /* RM: struct upto 128 bits are returned in registers */ @@ -5446,30 +5433,6 @@ /* We can leave the tail's space the same, since there's no jump. */ } -/* Copy the function value from VALBUF into the proper location - for a function return. - - Called only in the context of the "return" command. */ - -void -hppa32_store_return_value (struct type *type, char *valbuf) -{ - /* For software floating point, the return value goes into the - integer registers. But we do not have any flag to key this on, - so we always store the value into the integer registers. - - If its a float value, then we also store it into the floating - point registers. */ - deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (28) - + (TYPE_LENGTH (type) > 4 - ? (8 - TYPE_LENGTH (type)) - : (4 - TYPE_LENGTH (type))), - valbuf, TYPE_LENGTH (type)); - if (TYPE_CODE (type) == TYPE_CODE_FLT) - deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP4_REGNUM), - valbuf, TYPE_LENGTH (type)); -} - /* Same as hppa32_store_return_value(), but for the PA64 ABI. */ void @@ -5496,28 +5459,6 @@ } } -/* Copy the function's return value into VALBUF. - - This function is called only in the context of "target function calls", - ie. when the debugger forces a function to be called in the child, and - when the debugger forces a fucntion to return prematurely via the - "return" command. */ - -void -hppa32_extract_return_value (struct type *type, char *regbuf, char *valbuf) -{ - if (TYPE_CODE (type) == TYPE_CODE_FLT) - memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (FP4_REGNUM), TYPE_LENGTH (type)); - else - memcpy (valbuf, - (regbuf - + DEPRECATED_REGISTER_BYTE (28) - + (TYPE_LENGTH (type) > 4 - ? (8 - TYPE_LENGTH (type)) - : (4 - TYPE_LENGTH (type)))), - TYPE_LENGTH (type)); -} - /* Same as hppa32_extract_return_value but for the PA64 ABI case. */ void @@ -5564,15 +5505,6 @@ } CORE_ADDR -hppa32_stack_align (CORE_ADDR sp) -{ - /* elz: adjust the quantity to the next highest value which is - 64-bit aligned. This is used in valops.c, when the sp is adjusted. - On hppa the sp must always be kept 64-bit aligned */ - return ((sp % 8) ? (sp + 7) & -8 : sp); -} - -CORE_ADDR hppa64_stack_align (CORE_ADDR sp) { /* The PA64 ABI mandates a 16 byte stack alignment. */ @@ -5844,74 +5776,54 @@ set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1); /* Inferior function call methods. */ - if (0) + switch (tdep->bytes_per_address) { - switch (tdep->bytes_per_address) + case 4: + set_gdbarch_push_dummy_call (gdbarch, hppa32_push_dummy_call); + set_gdbarch_frame_align (gdbarch, hppa32_frame_align); + break; + case 8: + if (0) { - case 4: - set_gdbarch_push_dummy_call (gdbarch, hppa32_push_dummy_call); - set_gdbarch_frame_align (gdbarch, hppa32_frame_align); - break; - case 8: set_gdbarch_push_dummy_call (gdbarch, hppa64_push_dummy_call); set_gdbarch_frame_align (gdbarch, hppa64_frame_align); break; } - } - else - { - switch (tdep->bytes_per_address) + else { - case 4: - set_gdbarch_deprecated_call_dummy_length (gdbarch, hppa32_call_dummy_length); - set_gdbarch_deprecated_stack_align (gdbarch, hppa32_stack_align); - set_gdbarch_deprecated_reg_struct_has_addr (gdbarch, hppa_reg_struct_has_addr); - break; - case 8: set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, hppa64_call_dummy_breakpoint_offset); set_gdbarch_deprecated_call_dummy_length (gdbarch, hppa64_call_dummy_length); set_gdbarch_deprecated_stack_align (gdbarch, hppa64_stack_align); break; + set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame); + /* set_gdbarch_deprecated_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */ + set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments); + set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); + set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); + set_gdbarch_call_dummy_location (gdbarch, ON_STACK); } - set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame); - /* set_gdbarch_deprecated_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */ - set_gdbarch_deprecated_push_arguments (gdbarch, hppa_push_arguments); - set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0); - set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack); - set_gdbarch_call_dummy_location (gdbarch, ON_STACK); + break; } /* Struct return methods. */ - if (0) - { - switch (tdep->bytes_per_address) - { - case 4: - set_gdbarch_return_value (gdbarch, hppa32_return_value); - break; - case 8: - set_gdbarch_return_value (gdbarch, hppa64_return_value); - break; - default: - internal_error (__FILE__, __LINE__, "bad switch"); - } - } - else + switch (tdep->bytes_per_address) { - switch (tdep->bytes_per_address) + case 4: + set_gdbarch_return_value (gdbarch, hppa32_return_value); + break; + case 8: + if (0) + set_gdbarch_return_value (gdbarch, hppa64_return_value); + else { - case 4: - set_gdbarch_deprecated_extract_return_value (gdbarch, hppa32_extract_return_value); - set_gdbarch_use_struct_convention (gdbarch, hppa32_use_struct_convention); - set_gdbarch_deprecated_store_return_value (gdbarch, hppa32_store_return_value); - break; - case 8: set_gdbarch_deprecated_extract_return_value (gdbarch, hppa64_extract_return_value); set_gdbarch_use_struct_convention (gdbarch, hppa64_use_struct_convention); set_gdbarch_deprecated_store_return_value (gdbarch, hppa64_store_return_value); - break; + set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return); } - set_gdbarch_deprecated_store_struct_return (gdbarch, hppa_store_struct_return); + break; + default: + internal_error (__FILE__, __LINE__, "bad switch"); } /* Frame unwind methods. */ --------------000104070407040108030605--