From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26604 invoked by alias); 5 Sep 2004 00:14:52 -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 26596 invoked from network); 5 Sep 2004 00:14:50 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sourceware.org with SMTP; 5 Sep 2004 00:14:50 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 778F947D92; Sat, 4 Sep 2004 17:14:49 -0700 (PDT) Date: Sun, 05 Sep 2004 00:14:00 -0000 From: Joel Brobecker To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: your turn :-) Message-ID: <20040905001449.GB1216@gnat.com> References: <41390838.4050609@gnu.org> <20040904190742.GW1216@gnat.com> <413A5649.8070205@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <413A5649.8070205@gnu.org> User-Agent: Mutt/1.4i X-SW-Source: 2004-09/txt/msg00086.txt.bz2 > oops, this should be deleted. An earlier change modified set_reg_offset > to ignore NULL pointers. > > > - this_cache = xrealloc (this_cache, SIZEOF_FRAME_SAVED_REGS); > > - memset (this_cache, '\0', SIZEOF_FRAME_SAVED_REGS); > > > > + this_cache->saved_regs = xrealloc (this_cache->saved_regs, > > + SIZEOF_FRAME_SAVED_REGS); > > + memset (this_cache->saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS); Of course, this was OB - vious! > >What should heuristic_proc_desc do if the cache given is NULL. > >Create a temporary one while scaning the function, and then > >trash it? > > No, the code should survive a NULL this_cache. OK. > >Another question that's troubling me: I can't see how mips_frame_cache > >structs are deallocated. I am guessing that this happens when the > >obstack is reset, but then that would mean that we leak the save_regs > >array. ??? > > Right. The deallocate occures each time the frame cache is flushed and > that occures over and over. I was confused by the saved_regs array re-allocation above. I thought that was what you meant when I saw that code, so I was confused. Now, with these lines gone, I see the code allocating this array and it becomes obvious too. I shouldn't be doing things in a hurry... Thanks, -- Joel