From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32388 invoked by alias); 14 Sep 2008 20:49:42 -0000 Received: (qmail 32377 invoked by uid 22791); 14 Sep 2008 20:49:42 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 14 Sep 2008 20:49:07 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id m8EKn3qp014972 for ; Sun, 14 Sep 2008 22:49:03 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id m8EKn3Df003411; Sun, 14 Sep 2008 22:49:03 +0200 (CEST) Date: Sun, 14 Sep 2008 20:49:00 -0000 Message-Id: <200809142049.m8EKn3Df003411@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: gdb-patches@sourceware.org Subject: [PATCH] Get rid of generic_push_dummy_code Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00320.txt.bz2 Nothing uses this function anymore, and it uses gdbarch_frame_align() in a somewhat bogus way since it assumes it is suitable for instruction alignment. ok? Index: ChangeLog from Mark Kettenis * infcall.c (generic_push_dummy_code): Remove. (push_dummy_code): Unconditionally call gdbarch_push_dummy_code. Index: infcall.c =================================================================== RCS file: /cvs/src/src/gdb/infcall.c,v retrieving revision 1.103 diff -u -p -r1.103 infcall.c --- infcall.c 11 Sep 2008 14:25:04 -0000 1.103 +++ infcall.c 14 Sep 2008 20:46:06 -0000 @@ -270,43 +270,6 @@ breakpoint_auto_delete_contents (void *a breakpoint_auto_delete (inferior_thread ()->stop_bpstat); } -static CORE_ADDR -generic_push_dummy_code (struct gdbarch *gdbarch, - CORE_ADDR sp, CORE_ADDR funaddr, - struct value **args, int nargs, - struct type *value_type, - CORE_ADDR *real_pc, CORE_ADDR *bp_addr, - struct regcache *regcache) -{ - /* Something here to findout the size of a breakpoint and then - allocate space for it on the stack. */ - int bplen; - /* This code assumes frame align. */ - gdb_assert (gdbarch_frame_align_p (gdbarch)); - /* Force the stack's alignment. The intent is to ensure that the SP - is aligned to at least a breakpoint instruction's boundary. */ - sp = gdbarch_frame_align (gdbarch, sp); - /* Allocate space for, and then position the breakpoint on the - stack. */ - if (gdbarch_inner_than (gdbarch, 1, 2)) - { - CORE_ADDR bppc = sp; - gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen); - sp = gdbarch_frame_align (gdbarch, sp - bplen); - (*bp_addr) = sp; - /* Should the breakpoint size/location be re-computed here? */ - } - else - { - (*bp_addr) = sp; - gdbarch_breakpoint_from_pc (gdbarch, bp_addr, &bplen); - sp = gdbarch_frame_align (gdbarch, sp + bplen); - } - /* Inferior resumes at the function entry point. */ - (*real_pc) = funaddr; - return sp; -} - /* For CALL_DUMMY_ON_STACK, push a breakpoint sequence that the called function returns to. */ @@ -318,14 +281,11 @@ push_dummy_code (struct gdbarch *gdbarch CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache) { - if (gdbarch_push_dummy_code_p (gdbarch)) - return gdbarch_push_dummy_code (gdbarch, sp, funaddr, - args, nargs, value_type, real_pc, bp_addr, - regcache); - else - return generic_push_dummy_code (gdbarch, sp, funaddr, - args, nargs, value_type, real_pc, bp_addr, - regcache); + gdb_assert (gdbarch_push_dummy_code_p (gdbarch)); + + return gdbarch_push_dummy_code (gdbarch, sp, funaddr, + args, nargs, value_type, real_pc, bp_addr, + regcache); } /* All this stuff with a dummy frame may seem unnecessarily complicated