From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14217 invoked by alias); 10 Jul 2002 16:18:00 -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 14209 invoked from network); 10 Jul 2002 16:17:58 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 10 Jul 2002 16:17:58 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id E13553CF5; Wed, 10 Jul 2002 12:17:54 -0400 (EDT) Message-ID: <3D2C5E32.3040308@ges.redhat.com> Date: Wed, 10 Jul 2002 09:43:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020613 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Richard.Earnshaw@arm.com Cc: Mark Kettenis , gdb-patches@sources.redhat.com Subject: Re: [PATCH] Remove bogosities from dwarf2cfi.c:cfi_pop_frame() References: <200207100924.KAA09464@cam-mail2.cambridge.arm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg00187.txt.bz2 > Mark >> > >> > Index: ChangeLog >> > from Mark Kettenis >> > >> > * dwarf2cfi.c (cfi_pop_frame): Use alloca() for regbuf. >> > Don't call get_current_frame(). >> > > >> >> Heads up, >> >> I think the write_register_bytes() call should be replaced by >> regcache_register_write(current_regcache, ). This is new code so it >> doesn't need to go through any of that nasty write_register_bytes() stuff. >> >> Andrew >> >> > > > Why is this code trying to poke directly into the regcache at all? AFAICT > it should be operating on the pseudo registers not the cache. [cooked] Hmm, yes, good point. It should at least use regcache_cpy() so that it is ``bug compatible'' with generic_pop_dummy_frame()(1). At present GDB saves/restores registers in a confused sort of way. Firstly, the save/restore operation (see regcache_cpy): - for old targets it iterates over 0..NUM_REGS (the full raw register space) using write_register_bytes() to restore the registers. - for new targets it iterates over 0..NUM_REGS (the full raw register space) using regcache_write() to directly transfer the raw registers. It then uses this single mechanism(2) to handle two orthogonal situtations, and that is the problem: - saving / restoring a raw register cache before / after an inferior function call. Here, a select list of raw registers should be transfered. - unwinding a stack frame, storing those unwound register values, and hence having the effect of poping one or more frames. Here, a select list of cooked registers should be stored. Andrew (1) I also suspect that some cleanups would let the function in question be eliminated from dwarf2cfi but that is another story. (2) I believe the regcache changes were ``bug compatible''.