From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8565 invoked by alias); 18 Jul 2009 13:50:03 -0000 Received: (qmail 8547 invoked by uid 22791); 18 Jul 2009 13:50:02 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtpauth16.prod.mesa1.secureserver.net (HELO smtpauth16.prod.mesa1.secureserver.net) (64.202.165.22) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sat, 18 Jul 2009 13:49:56 +0000 Received: (qmail 5370 invoked from network); 18 Jul 2009 13:49:54 -0000 Received: from unknown (99.230.243.104) by smtpauth16.prod.mesa1.secureserver.net (64.202.165.22) with ESMTP; 18 Jul 2009 13:49:54 -0000 Subject: [patch, moxie] Fix regression/crash in prologue analysis From: Anthony Green To: gdb-patches@sourceware.org Content-Type: multipart/mixed; boundary="=-Mh/c2yBEazx84fv+mG81" Date: Sat, 18 Jul 2009 18:02:00 -0000 Message-Id: <1247925160.2847.7.camel@localhost.localdomain> Mime-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00448.txt.bz2 --=-Mh/c2yBEazx84fv+mG81 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 480 This patch... http://sourceware.org/ml/gdb-patches/2009-07/msg00079.html ...introduced a frame_info argument to moxie_analyze_prologue from which we extract a gdbarch to get the frame's endianess for later use. Unfortunately moxie_skip_prologue calls moxie_analyze_prologue with a NULL frame_info, resulting in a crash. My solution is to change that frame_info argument into a gdbarch argument because all of the callers have a valid gdbarch. I'm checking this patch in. AG --=-Mh/c2yBEazx84fv+mG81 Content-Disposition: attachment; filename=p.txt Content-Type: text/plain; name=p.txt; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 1673 2009-07-18 Anthony Green * moxie-tdep.c (moxie_analyze_prologue): Take gdbarch as last parameter instead of frame_info. (moxie_frame_cache): Call moxie_analyze_prologue with different args. Index: gdb/moxie-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/moxie-tdep.c,v retrieving revision 1.5 diff -u -r1.5 moxie-tdep.c --- gdb/moxie-tdep.c 13 Jul 2009 04:56:14 -0000 1.5 +++ gdb/moxie-tdep.c 18 Jul 2009 13:25:42 -0000 @@ -145,10 +145,9 @@ static CORE_ADDR moxie_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, - struct moxie_frame_cache *cache, - struct frame_info *this_frame) + struct moxie_frame_cache *cache, + struct gdbarch *gdbarch) { - struct gdbarch *gdbarch = get_frame_arch (this_frame); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR next_addr; ULONGEST inst, inst2; @@ -226,7 +225,7 @@ memset (&cache, 0, sizeof cache); plg_end = moxie_analyze_prologue (func_addr, - func_end, &cache, NULL); + func_end, &cache, gdbarch); /* Found a function. */ sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL); /* Don't use line number debug info for assembly source @@ -384,7 +383,10 @@ cache->pc = get_frame_func (this_frame); current_pc = get_frame_pc (this_frame); if (cache->pc) - moxie_analyze_prologue (cache->pc, current_pc, cache, this_frame); + { + struct gdbarch *gdbarch = get_frame_arch (this_frame); + moxie_analyze_prologue (cache->pc, current_pc, cache, gdbarch); + } cache->saved_sp = cache->base - cache->framesize; --=-Mh/c2yBEazx84fv+mG81--