From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27398 invoked by alias); 20 Mar 2002 02:29:24 -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 27357 invoked from network); 20 Mar 2002 02:29:22 -0000 Received: from unknown (HELO localhost.localdomain) (12.230.181.242) by sources.redhat.com with SMTP; 20 Mar 2002 02:29:22 -0000 Received: from there (DRAGON [127.0.0.1]) by localhost.localdomain (8.11.6/8.11.6) with SMTP id g2K2Sri16880 for ; Tue, 19 Mar 2002 18:28:53 -0800 Message-Id: <200203200228.g2K2Sri16880@localhost.localdomain> Content-Type: text/plain; charset="iso-8859-1" From: "Martin M. Hunt" Organization: Red Hat Inc To: gdb-patches@sources.redhat.com Subject: [RFA] regcache fix Date: Tue, 19 Mar 2002 18:29:00 -0000 X-Mailer: KMail [version 1.3.2] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SW-Source: 2002-03/txt/msg00371.txt.bz2 Currently build_regcache is called 3 times, once at initialization, before any architectures are registered, once when the host is registered and once when the target is registered. I don't see any reason for the first call, and in some non-multiarched targets it can cause core dumps. -- Martin Hunt GDB Engineer Red Hat, Inc. 2002-03-19 Martin M. Hunt * regcache.c (_initialize_regcache): No need to call build_regcache() at this time; it gets called whenever the gdbarch changes. Index: regcache.c =================================================================== RCS file: /cvs/src/src/gdb/regcache.c,v retrieving revision 1.32 diff -u -u -r1.32 regcache.c --- regcache.c 2002/02/06 03:16:38 1.32 +++ regcache.c 2002/03/20 02:24:33 @@ -802,8 +802,6 @@ void _initialize_regcache (void) { - build_regcache (); - register_gdbarch_swap (®isters, sizeof (registers), NULL); register_gdbarch_swap (®ister_valid, sizeof (register_valid), NULL); register_gdbarch_swap (NULL, 0, build_regcache);