From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27449 invoked by alias); 14 May 2002 15:18:34 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 27437 invoked from network); 14 May 2002 15:18:32 -0000 Received: from unknown (HELO fw-cam.cambridge.arm.com) (193.131.176.3) by sources.redhat.com with SMTP; 14 May 2002 15:18:32 -0000 Received: by fw-cam.cambridge.arm.com; id QAA17597; Tue, 14 May 2002 16:18:30 +0100 (BST) Received: from unknown(172.16.1.2) by fw-cam.cambridge.arm.com via smap (V5.5) id xma016563; Tue, 14 May 02 16:17:38 +0100 Received: from cam-mail2.cambridge.arm.com (cam-mail2.cambridge.arm.com [172.16.1.91]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id QAA19029 for ; Tue, 14 May 2002 16:17:38 +0100 (BST) Received: from sun18.cambridge.arm.com (sun18.cambridge.arm.com [172.16.2.18]) by cam-mail2.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id QAA18465; Tue, 14 May 2002 16:17:37 +0100 (BST) Message-Id: <200205141517.QAA18465@cam-mail2.cambridge.arm.com> To: gdb@sources.redhat.com cc: Richard.Earnshaw@arm.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. X-Url: http://www.arm.com/ Subject: Saving/restoring the entire register set Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 14 May 2002 08:18:00 -0000 From: Richard Earnshaw X-SW-Source: 2002-05/txt/msg00150.txt.bz2 The current implementation of generic_{push,pop}_dummy_frame use {read,write}_register_bytes (0, addr, REGISTER_BYTES) to save/restore the entire regset. This is causing a problem for me with the new pseudo/raw register separation that I'm trying to create because write_register_bytes calls write_register_gen which calls arm_register_write and then aborts because we are trying to directly update a raw register rather than a pseudo. While the dummy frame code does seem to be doing something sensible, doing it this way is somewhat of a pain, because I really want to fault out attempts to directly poke into the raw registers (I've already tracked down two or three bugs this way). For this special case of saving/restoring the entire register bank, I wonder if a more suitable interface might be to have calls such as struct regcache *regcache_alloc (); /* Allocate a new regcache structure */ regcache_save (regcache); /* Copy current registers into it */ regcache_restore (regcache); /* Restore registers from it */ regcache_free (regcache); /* Release it */ which would directly perform the precise operations that are required. These routines could then directly use the legacy_{read,write}_register_gen interface to fill/restore a copy of the structure. R.