From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19381 invoked by alias); 3 Sep 2004 22:05:13 -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 19357 invoked from network); 3 Sep 2004 22:05:11 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 3 Sep 2004 22:05:11 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i83M56S2031887 for ; Fri, 3 Sep 2004 18:05:11 -0400 Received: from localhost.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i83M4t302255; Fri, 3 Sep 2004 18:05:01 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 891B928D2; Fri, 3 Sep 2004 18:03:44 -0400 (EDT) Message-ID: <4138EA40.2030001@gnu.org> Date: Fri, 03 Sep 2004 22:05:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040831 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [commit] Zap cur_frame param from mips Content-Type: multipart/mixed; boundary="------------020908070009020302070207" X-SW-Source: 2004-09/txt/msg00065.txt.bz2 This is a multi-part message in MIME format. --------------020908070009020302070207 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 303 Just FYI, Since, for a live process there's always a frame (next_frame != NULL) and for a dead process there's never a frame (next_frame == NULL), the cur_frame parameter indicating the validity of next_frame is redundant. I've removed it, committed, Andrew (this is a side line to joel's cleanup) --------------020908070009020302070207 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 4538 2004-09-03 Andrew Cagney * mips-tdep.c (find_proc_desc, heuristic_proc_desc): Delete "cur_frame" parameter. (after_prologue, mips_mdebug_frame_cache, mips_insn16_frame_cache): Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.313 diff -p -u -r1.313 mips-tdep.c --- mips-tdep.c 2 Sep 2004 22:57:49 -0000 1.313 +++ mips-tdep.c 3 Sep 2004 21:59:48 -0000 @@ -421,7 +421,7 @@ mips_stack_argsize (struct gdbarch *gdba #define VM_MIN_ADDRESS (CORE_ADDR)0x400000 static mips_extra_func_info_t heuristic_proc_desc (CORE_ADDR, CORE_ADDR, - struct frame_info *, int); + struct frame_info *); static mips_extra_func_info_t non_heuristic_proc_desc (CORE_ADDR pc, CORE_ADDR *addrptr); @@ -432,8 +432,7 @@ static CORE_ADDR read_next_frame_reg (st static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *); static mips_extra_func_info_t find_proc_desc (CORE_ADDR pc, - struct frame_info *next_frame, - int cur_frame); + struct frame_info *next_frame); static CORE_ADDR after_prologue (CORE_ADDR pc, mips_extra_func_info_t proc_desc); @@ -890,13 +889,13 @@ after_prologue (CORE_ADDR pc, mips_extra struct symtab_and_line sal; CORE_ADDR func_addr, func_end; - /* Pass cur_frame == 0 to find_proc_desc. We should not attempt + /* Pass a NULL next_frame to find_proc_desc. We should not attempt to read the stack pointer from the current machine state, because the current machine state has nothing to do with the information we need from the proc_desc; and the process may or may not exist right now. */ if (!proc_desc) - proc_desc = find_proc_desc (pc, NULL, 0); + proc_desc = find_proc_desc (pc, NULL); if (proc_desc) { @@ -1545,7 +1544,7 @@ mips_mdebug_frame_cache (struct frame_in cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); /* Get the mdebug proc descriptor. */ - proc_desc = find_proc_desc (frame_pc_unwind (next_frame), next_frame, 1); + proc_desc = find_proc_desc (frame_pc_unwind (next_frame), next_frame); if (proc_desc == NULL) /* I'm not sure how/whether this can happen. Normally when we can't find a proc_desc, we "synthesize" one using @@ -1821,7 +1820,7 @@ mips_insn16_frame_cache (struct frame_in cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); /* Get the mdebug proc descriptor. */ - proc_desc = find_proc_desc (frame_pc_unwind (next_frame), next_frame, 1); + proc_desc = find_proc_desc (frame_pc_unwind (next_frame), next_frame); if (proc_desc == NULL) /* I'm not sure how/whether this can happen. Normally when we can't find a proc_desc, we "synthesize" one using @@ -2082,7 +2081,7 @@ mips_insn32_frame_cache (struct frame_in if (start_addr == 0) start_addr = heuristic_proc_start (pc); - proc_desc = heuristic_proc_desc (start_addr, pc, next_frame, 1); + proc_desc = heuristic_proc_desc (start_addr, pc, next_frame); } if (proc_desc == NULL) @@ -2866,11 +2865,13 @@ restart: static mips_extra_func_info_t heuristic_proc_desc (CORE_ADDR start_pc, CORE_ADDR limit_pc, - struct frame_info *next_frame, int cur_frame) + struct frame_info *next_frame) { CORE_ADDR sp; - if (cur_frame) + /* Can be called when there's no process, and hence when there's no + NEXT_FRAME. */ + if (next_frame != NULL) sp = read_next_frame_reg (next_frame, NUM_REGS + MIPS_SP_REGNUM); else sp = 0; @@ -3109,7 +3110,7 @@ non_heuristic_proc_desc (CORE_ADDR pc, C static mips_extra_func_info_t -find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame, int cur_frame) +find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame) { mips_extra_func_info_t proc_desc; CORE_ADDR startaddr = 0; @@ -3140,7 +3141,7 @@ find_proc_desc (CORE_ADDR pc, struct fra { mips_extra_func_info_t found_heuristic = heuristic_proc_desc (PROC_LOW_ADDR (proc_desc), - pc, next_frame, cur_frame); + pc, next_frame); if (found_heuristic) proc_desc = found_heuristic; } @@ -3151,7 +3152,7 @@ find_proc_desc (CORE_ADDR pc, struct fra if (startaddr == 0) startaddr = heuristic_proc_start (pc); - proc_desc = heuristic_proc_desc (startaddr, pc, next_frame, cur_frame); + proc_desc = heuristic_proc_desc (startaddr, pc, next_frame); } return proc_desc; } --------------020908070009020302070207--