From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6937 invoked by alias); 3 Sep 2004 22:32:39 -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 6929 invoked from network); 3 Sep 2004 22:32:38 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 3 Sep 2004 22:32:38 -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 i83MWXS2004064 for ; Fri, 3 Sep 2004 18:32:33 -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 i83MWS307316; Fri, 3 Sep 2004 18:32:33 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id BFCEB28D2; Fri, 3 Sep 2004 18:31:16 -0400 (EDT) Message-ID: <4138F0B4.30601@gnu.org> Date: Fri, 03 Sep 2004 22:32: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] Inline one find_proc_desc call, simplify Content-Type: multipart/mixed; boundary="------------020904090801000502070003" X-SW-Source: 2004-09/txt/msg00068.txt.bz2 This is a multi-part message in MIME format. --------------020904090801000502070003 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 46 Just FYI (hope I got this one right), Andrew --------------020904090801000502070003 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 3458 * mips-tdep.c (find_proc_desc): Inline call to find_proc_desc. Simplify as NEXT_FRAME is NULL. (find_proc_desc): Simplify as NEXT_FRAME is non-NULL. Index: mips-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.c,v retrieving revision 1.315 diff -p -u -r1.315 mips-tdep.c --- mips-tdep.c 3 Sep 2004 22:18:17 -0000 1.315 +++ mips-tdep.c 3 Sep 2004 22:30:00 -0000 @@ -888,13 +888,45 @@ after_prologue (CORE_ADDR pc) mips_extra_func_info_t proc_desc; struct symtab_and_line sal; CORE_ADDR func_addr, func_end; + CORE_ADDR startaddr = 0; + + /* Pass a NULL next_frame to heuristic_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. */ + proc_desc = non_heuristic_proc_desc (pc, &startaddr); + if (proc_desc) + { + /* IF this is the topmost frame AND (this proc does not have + debugging information OR the PC is in the procedure prologue) + THEN create a "heuristic" proc_desc (by analyzing the actual + code) to replace the "official" proc_desc. */ + struct symtab_and_line val; + struct symbol *proc_symbol = + PROC_DESC_IS_DUMMY (proc_desc) ? 0 : PROC_SYMBOL (proc_desc); + + if (proc_symbol) + { + val = find_pc_line (BLOCK_START + (SYMBOL_BLOCK_VALUE (proc_symbol)), 0); + val.pc = val.end ? val.end : pc; + } + if (!proc_symbol || pc < val.pc) + { + mips_extra_func_info_t found_heuristic = + heuristic_proc_desc (PROC_LOW_ADDR (proc_desc), pc, NULL); + if (found_heuristic) + proc_desc = found_heuristic; + } + } + else + { + if (startaddr == 0) + startaddr = heuristic_proc_start (pc); - /* 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. */ - proc_desc = find_proc_desc (pc, NULL); + proc_desc = heuristic_proc_desc (startaddr, pc, NULL); + } if (proc_desc) { @@ -3115,38 +3147,7 @@ find_proc_desc (CORE_ADDR pc, struct fra CORE_ADDR startaddr = 0; proc_desc = non_heuristic_proc_desc (pc, &startaddr); - - if (proc_desc) - { - /* IF this is the topmost frame AND - * (this proc does not have debugging information OR - * the PC is in the procedure prologue) - * THEN create a "heuristic" proc_desc (by analyzing - * the actual code) to replace the "official" proc_desc. - */ - if (next_frame == NULL) - { - struct symtab_and_line val; - struct symbol *proc_symbol = - PROC_DESC_IS_DUMMY (proc_desc) ? 0 : PROC_SYMBOL (proc_desc); - - if (proc_symbol) - { - val = find_pc_line (BLOCK_START - (SYMBOL_BLOCK_VALUE (proc_symbol)), 0); - val.pc = val.end ? val.end : pc; - } - if (!proc_symbol || pc < val.pc) - { - mips_extra_func_info_t found_heuristic = - heuristic_proc_desc (PROC_LOW_ADDR (proc_desc), - pc, next_frame); - if (found_heuristic) - proc_desc = found_heuristic; - } - } - } - else + if (proc_desc == NULL) { if (startaddr == 0) startaddr = heuristic_proc_start (pc); --------------020904090801000502070003--