From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4464 invoked by alias); 26 Sep 2002 22:48:50 -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 4457 invoked from network); 26 Sep 2002 22:48:49 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 26 Sep 2002 22:48:49 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 862F53DC7; Thu, 26 Sep 2002 18:48:49 -0400 (EDT) Message-ID: <3D938ED1.8030805@redhat.com> Date: Thu, 26 Sep 2002 15:48:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Martin M. Hunt" Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] mips find_proc_desc() References: <200209261501.54430.hunt@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00649.txt.bz2 Yes, ok. > In mips-tdep.c, we have > > static mips_extra_func_info_t > find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame) > { > mips_extra_func_info_t proc_desc; > CORE_ADDR startaddr; > > proc_desc = non_heuristic_proc_desc (pc, &startaddr); > if (proc_desc) > { > [...] > } > else > { > [...] > if (startaddr == 0) > startaddr = heuristic_proc_start (pc); > } > } > > and we have > > static mips_extra_func_info_t > non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr) > { > CORE_ADDR startaddr; > mips_extra_func_info_t proc_desc; > struct block *b = block_for_pc (pc); > struct symbol *sym; > struct obj_section *sec; > struct mips_objfile_private *priv; > > if (PC_IN_CALL_DUMMY (pc, 0, 0)) > return NULL; > [...] > } > > Looking at "startaddr" in find_proc_desc(), it is passed into > non_heuristic_proc_desc uninitialized and never initialized if > PC_IN_CALL_DUMMY(). Nevertheless find_proc_desc attempts to use it anyway. > > There are several simple fixes. The easiest is to initialize it to 0 as it > appears that is what find_proc_desc() expects. > > -- Martin Hunt GDB Engineer Red Hat, Inc. 2002-09-26 Martin M. Hunt * mips-tdep.c (find_proc_desc): Initialize startaddr. Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.126 diff -u -u -r1.126 mips-tdep.c --- mips-tdep.c 18 Sep 2002 15:37:18 -0000 1.126 +++ mips-tdep.c 26 Sep 2002 22:01:54 -0000 @@ -2336,7 +2336,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame) { mips_extra_func_info_t proc_desc; - CORE_ADDR startaddr; + CORE_ADDR startaddr = 0; proc_desc = non_heuristic_proc_desc (pc, &startaddr);