From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16282 invoked by alias); 22 Jul 2003 18:58:12 -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 16273 invoked from network); 22 Jul 2003 18:58:12 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 22 Jul 2003 18:58:12 -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 h6MIwBH16151 for ; Tue, 22 Jul 2003 14:58:11 -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 h6MIwBI14302 for ; Tue, 22 Jul 2003 14:58:11 -0400 Received: from localhost.localdomain (vpn50-28.rdu.redhat.com [172.16.50.28]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h6MIwAv29226 for ; Tue, 22 Jul 2003 14:58:11 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h6MIw5504237 for gdb-patches@sources.redhat.com; Tue, 22 Jul 2003 11:58:05 -0700 Date: Tue, 22 Jul 2003 18:58:00 -0000 From: Kevin Buettner Message-Id: <1030722185805.ZM4236@localhost.localdomain> To: gdb-patches@sources.redhat.com Subject: [RFC] Fix some frame problems in the mn10300 prologue analyzer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-07/txt/msg00396.txt.bz2 The mn10300 prologue analyzer has bit-rotted since the addition of Andrew's new frame code -- calling get_frame_pc() with a frame constructed in analyze_dummy_frame() triggers an assertion failure. The patch below reduced the number of FAILs (when run against the simulator) from 671 to 357. Comments? * mn10300-tdep.c (analyze_dummy_frame): Pass ``pc'' so that the prologue analyzer won't need to attempt to extract the pc value from the woefully incomplete dummy frame. (mn10300_analyze_prologue): Avoid calls to get_frame_pc() when possible. Disable code which modifies the frame. Index: mn10300-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mn10300-tdep.c,v retrieving revision 1.83 diff -u -p -r1.83 mn10300-tdep.c --- mn10300-tdep.c 16 Jun 2003 16:47:42 -0000 1.83 +++ mn10300-tdep.c 22 Jul 2003 18:45:47 -0000 @@ -169,7 +169,7 @@ analyze_dummy_frame (CORE_ADDR pc, CORE_ get_frame_extra_info (dummy)->status = 0; get_frame_extra_info (dummy)->stack_size = 0; memset (get_frame_saved_regs (dummy), '\000', SIZEOF_FRAME_SAVED_REGS); - mn10300_analyze_prologue (dummy, 0); + mn10300_analyze_prologue (dummy, pc); return dummy; } @@ -401,8 +401,13 @@ mn10300_analyze_prologue (struct frame_i char *name; /* Use the PC in the frame if it's provided to look up the - start of this function. */ - pc = (fi ? get_frame_pc (fi) : pc); + start of this function. + + Note: kevinb/2003-07-16: We used to do the following here: + pc = (fi ? get_frame_pc (fi) : pc); + But this is (now) badly broken when called from analyze_dummy_frame(). + */ + pc = (pc ? pc : get_frame_pc (fi)); /* Find the start of this function. */ status = find_pc_partial_function (pc, &name, &func_addr, &func_end); @@ -432,6 +437,9 @@ mn10300_analyze_prologue (struct frame_i if (status != 0) return pc; +#if 0 + /* Note: kevinb/2003-07-16: We shouldn't be making these sorts of + changes to the frame in prologue examination code. */ /* If we're physically on an "rets" instruction, then our frame has already been deallocated. Note this can also be true for retf and ret if they specify a size of zero. @@ -452,9 +460,10 @@ mn10300_analyze_prologue (struct frame_i deprecated_update_frame_base_hack (fi, read_sp ()); return get_frame_pc (fi); } +#endif /* Figure out where to stop scanning. */ - stop = fi ? get_frame_pc (fi) : func_end; + stop = fi ? pc : func_end; /* Don't walk off the end of the function. */ stop = stop > func_end ? func_end : stop;