From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13969 invoked by alias); 4 May 2004 14:34:54 -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 13962 invoked from network); 4 May 2004 14:34:53 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 4 May 2004 14:34:53 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i44EYrkI012232 for ; Tue, 4 May 2004 10:34:53 -0400 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i44EYov24151; Tue, 4 May 2004 10:34:51 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 6E3712B9D; Tue, 4 May 2004 10:34:50 -0400 (EDT) Message-ID: <4097AA0A.4050603@gnu.org> Date: Tue, 04 May 2004 14:34:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: Randolph Chung Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/rfc/hppa] handle setting gp for calling shlib functions References: <20040429062324.GX3965@tausq.org> <40910D4F.1020700@gnu.org> <20040429150704.GZ3965@tausq.org> <409126FD.3080708@gnu.org> <20040429161357.GA3965@tausq.org> <409131F2.5040706@gnu.org> <20040430040417.GC3965@tausq.org> <409261BF.8010605@gnu.org> <4097A2A3.8030807@gnu.org> <20040504141035.GH3965@tausq.org> In-Reply-To: <20040504141035.GH3965@tausq.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-05/txt/msg00096.txt.bz2 >>What happens if the function pointer value, rather than code start >>> address is passed into push dummy call? The entire value should be >>> passed in, but this is a simple step in that direction. > > > This will certainly help, as long as we also have a hook later in > call_function_by_hand () that can twiddle the funcaddr before setting > the breakpoint. maybe just moving the call that converts a funcptr to an > address to after the push dummy call? Yes, or find_function addr could return both. > btw, a related but slightly different question -- i don't see any code > in this path which will preserve and restore the call-clobbered > registers when doing a call. how does gdb ensure that the register > state before and after the call are the same? (i do see that there is > a testcase for this though.) See generic_push_dummy_frame (the name is historic) which saves all registers in save_reggroup (which by default is all registers). callfuncs.exp checks that this works, namely tests like: PASS: gdb.base/callfuncs.exp: gdb function calls preserve register contents PASS: gdb.base/callfuncs.exp: continue after stop in call dummy preserves register contents PASS: gdb.base/callfuncs.exp: finish after stop in call dummy preserves register contents PASS: gdb.base/callfuncs.exp: return after stop in call dummy preserves register contents PASS: gdb.base/callfuncs.exp: nested call dummies preserve register contents Andrew