From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3786 invoked by alias); 15 Mar 2002 03:41:19 -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 3701 invoked from network); 15 Mar 2002 03:41:16 -0000 Received: from unknown (HELO localhost.localdomain) (12.230.181.242) by sources.redhat.com with SMTP; 15 Mar 2002 03:41:16 -0000 Received: from there (DRAGON [127.0.0.1]) by localhost.localdomain (8.11.6/8.11.6) with SMTP id g2F3ej620448; Thu, 14 Mar 2002 19:40:45 -0800 Message-Id: <200203150340.g2F3ej620448@localhost.localdomain> Content-Type: text/plain; charset="iso-8859-1" From: "Martin M. Hunt" Organization: Red Hat Inc To: Andrew Cagney Subject: Re: build_regcache Date: Thu, 14 Mar 2002 19:41:00 -0000 X-Mailer: KMail [version 1.3.2] Cc: gdb@sources.redhat.com References: <200203150141.g2F1fO620177@localhost.localdomain> <3C9164B5.5000300@cygnus.com> In-Reply-To: <3C9164B5.5000300@cygnus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SW-Source: 2002-03/txt/msg00133.txt.bz2 On Thursday 14 March 2002 07:04 pm, Andrew Cagney wrote: > > Am I misunderstanding something or does it not make sense that the > > register cache is initialized before any architectures? Would moving it > > to the end of COMMON_OBS be an OK solution? > > It has worked up until now. Do you have any more info? My situation is very complicated. I'll try to summarize in general what I see happening. build_regcache() runs through all the registers calling REGISTER_RAW_SIZE(). This normally calls generic_register_raw_size() because we don't have an arch registered yet. build_regcache() then allocates enough memory to handle all the generic registers it has seen and initializes the memory to zero. In my case, REGISTER_RAW_SIZE is defined to call TYPE_LENGTH(REGISTER_VIRTUAL_SIZE(n)) and REGISTER_VIRTUAL_SIZE returns something like builtin_type_int, which is still uninitialized because _initialize_gdbtypes() has not been called yet. I haven't checked what happens if the allocated memory for the registers is too small for the actual register set. Maybe it gets reallocated when the architecture changes. > I do recall that the mixture of pseudo-registers and the wrong > combination of multi-arch and non-multi-arch register macros can be > fatal. That would be one way to explain what I'm dealing with. -- Martin Hunt GDB Engineer Red Hat, Inc.