From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8982 invoked by alias); 6 Mar 2003 22:42:18 -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 8949 invoked from network); 6 Mar 2003 22:42:18 -0000 Received: from unknown (HELO kerberos.suse.cz) (195.47.106.10) by 172.16.49.205 with SMTP; 6 Mar 2003 22:42:18 -0000 Received: from chimera.suse.cz (chimera.suse.cz [10.20.0.2]) by kerberos.suse.cz (SuSE SMTP server) with ESMTP id 2806959D350; Thu, 6 Mar 2003 23:42:17 +0100 (CET) Received: from suse.cz (naga.suse.cz [10.20.1.16]) by chimera.suse.cz (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) with ESMTP id h26MgG404272; Thu, 6 Mar 2003 23:42:17 +0100 X-Authentication-Warning: chimera.suse.cz: Host naga.suse.cz [10.20.1.16] claimed to be suse.cz Message-ID: <3E67CEC8.9040301@suse.cz> Date: Thu, 06 Mar 2003 22:42:00 -0000 From: Michal Ludvig Organization: SuSE CR User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: cs, cz, en MIME-Version: 1.0 To: Andrew Cagney Cc: GDB Patches Subject: [RFA] Dummy frames on x86-64 References: <3E305670.3020700@redhat.com> <3E48378E.6090007@suse.cz> <3E492953.8010001@redhat.com> <3E52173B.1030800@suse.cz> <3E538770.6070209@redhat.com> <3E5B98D8.3030002@suse.cz> <3E5BAB7D.8090801@redhat.com> <3E5BD957.9010605@suse.cz> <3E5BDCBD.2030205@redhat.com> <3E5C7512.2080207@suse.cz> <3E5E58FC.3080704@redhat.com> <3E5F5DEE.3030505@suse.cz> <3E5F8559.1020708@redhat.com> <3E663605.6030105@suse.cz> <3E664100.4010009@redhat.com> <3E677087.70000@suse.cz> <3E67ABDD.4090401@redhat.com> In-Reply-To: <3E67ABDD.4090401@redhat.com> Content-Type: multipart/mixed; boundary="------------010401050002050005060500" X-SW-Source: 2003-03/txt/msg00145.txt.bz2 This is a multi-part message in MIME format. --------------010401050002050005060500 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 500 Andrew Cagney wrote: >> +static void >> +x86_64_save_dummy_frame_tos (CORE_ADDR sp) >> +{ >> + /* We must add the size of the return address that is already >> + put on the stack. */ >> + generic_save_dummy_frame_tos (sp + sizeof(CORE_ADDR)); > > Yes, but use TYPE_LENGTH (builtin_type_void_{code/data}_ptr). Great, thanks for your help! Can I commit the attached patch to mainline, please? Michal Ludvig -- * SuSE CR, s.r.o * mludvig@suse.cz * (+420) 296.545.373 * http://www.suse.cz --------------010401050002050005060500 Content-Type: text/plain; name="dummy-unwind-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dummy-unwind-1.diff" Content-length: 1561 2002-03-06 Michal Ludvig * x86-64-tdep.c (x86_64_save_dummy_frame_tos) (x86_64_unwind_dummy_id): New functions. (x86_64_init_abi): Register these two new functions. Index: x86-64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v retrieving revision 1.51 diff -u -p -r1.51 x86-64-tdep.c --- x86-64-tdep.c 2 Mar 2003 04:02:25 -0000 1.51 +++ x86-64-tdep.c 6 Mar 2003 22:38:14 -0000 @@ -913,6 +913,26 @@ x86_64_breakpoint_from_pc (CORE_ADDR *pc return breakpoint; } +static void +x86_64_save_dummy_frame_tos (CORE_ADDR sp) +{ + /* We must add the size of the return address that is already + put on the stack. */ + generic_save_dummy_frame_tos (sp + + TYPE_LENGTH (builtin_type_void_func_ptr)); +} + +static struct frame_id +x86_64_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *frame) +{ + struct frame_id id; + + id.pc = frame_pc_unwind (frame); + frame_unwind_unsigned_register (frame, SP_REGNUM, &id.base); + + return id; +} + void x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { @@ -1023,6 +1043,10 @@ x86_64_init_abi (struct gdbarch_info inf since all supported x86-64 targets are ELF, but that might change in the future. */ set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section); + + /* Dummy frame helper functions. */ + set_gdbarch_save_dummy_frame_tos (gdbarch, x86_64_save_dummy_frame_tos); + set_gdbarch_unwind_dummy_id (gdbarch, x86_64_unwind_dummy_id); } void --------------010401050002050005060500--