From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17186 invoked by alias); 26 Sep 2002 22:03:00 -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 17179 invoked from network); 26 Sep 2002 22:02:59 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 26 Sep 2002 22:02:59 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g8QLipi08740 for ; Thu, 26 Sep 2002 17:44:51 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g8QM2wf02671 for ; Thu, 26 Sep 2002 18:02:58 -0400 Received: from localhost.localdomain (romulus-int.sfbay.redhat.com [172.16.27.251]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g8QM2vJ21192 for ; Thu, 26 Sep 2002 18:02:57 -0400 Content-Type: text/plain; charset="us-ascii" From: "Martin M. Hunt" Organization: Red Hat Inc To: gdb-patches@sources.redhat.com Subject: [RFA] mips find_proc_desc() Date: Thu, 26 Sep 2002 15:03:00 -0000 User-Agent: KMail/1.4.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200209261501.54430.hunt@redhat.com> X-SW-Source: 2002-09/txt/msg00645.txt.bz2 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);