From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31955 invoked by alias); 19 May 2008 04:16:55 -0000 Received: (qmail 31873 invoked by uid 22791); 19 May 2008 04:16:52 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate2.de.ibm.com (HELO mtagate2.de.ibm.com) (195.212.29.151) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 19 May 2008 04:16:31 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.8/8.13.8) with ESMTP id m4J4GLLk180162 for ; Mon, 19 May 2008 04:16:21 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m4J4GKku2887712 for ; Mon, 19 May 2008 06:16:20 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m4J4GKHK002202 for ; Mon, 19 May 2008 06:16:20 +0200 Received: from bbkeks.de.ibm.com (dyn-9-152-248-39.boeblingen.de.ibm.com [9.152.248.39]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m4J4GJQv002195 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 May 2008 06:16:20 +0200 Message-ID: <4830FF13.4070605@de.ibm.com> Date: Mon, 19 May 2008 15:17:00 -0000 From: Markus Deuling User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: GDB Patches CC: ", Ulrich Weigand "@d12av02.megacenter.de.ibm.com Subject: [patch] Get rid of current_gdbarch in xtensa Content-Type: multipart/mixed; boundary="------------020103070109030709040307" 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: 2008-05/txt/msg00548.txt.bz2 This is a multi-part message in MIME format. --------------020103070109030709040307 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-length: 486 Hi, this patch get rid of the last to current_gdbarch's in xtensa target. Unfortunately I dont have a xtensa machine here. If anyone has access to such a machine I'd welcome a test run with this patch very much. Thanks in advance. ChangeLog: * xtensa-tdep.c (call0_track_op): Add gdbarch as parameter and replace current_gdbarch. Update callers. (call0_analyze_prologue): Likewise. Regards, Markus -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------020103070109030709040307 Content-Type: text/plain; name="diff-xtensa" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-xtensa" Content-length: 2504 diff -urpN src/gdb/xtensa-tdep.c dev/gdb/xtensa-tdep.c --- src/gdb/xtensa-tdep.c 2008-05-16 06:17:17.000000000 +0200 +++ dev/gdb/xtensa-tdep.c 2008-05-16 08:09:09.000000000 +0200 @@ -1981,7 +1981,7 @@ call0_classify_opcode (xtensa_isa isa, x static void call0_track_op (xtensa_c0reg_t dst[], xtensa_c0reg_t src[], xtensa_insn_kind opclass, int nods, unsigned odv[], - CORE_ADDR pc, int spreg) + CORE_ADDR pc, int spreg, struct gdbarch *gdbarch) { unsigned litbase, litaddr, litval; @@ -2034,9 +2034,9 @@ call0_track_op (xtensa_c0reg_t dst[], xt /* 2 operands: dst, literal offset. */ gdb_assert (nods == 2); /* litbase = xtensa_get_litbase (pc); can be also used. */ - litbase = (gdbarch_tdep (current_gdbarch)->litbase_regnum == -1) + litbase = (gdbarch_tdep (gdbarch)->litbase_regnum == -1) ? 0 : xtensa_read_register - (gdbarch_tdep (current_gdbarch)->litbase_regnum); + (gdbarch_tdep (gdbarch)->litbase_regnum); litaddr = litbase & 1 ? (litbase & ~1) + (signed)odv[1] : (pc + 3 + (signed)odv[1]) & ~3; @@ -2093,8 +2093,9 @@ call0_track_op (xtensa_c0reg_t dst[], xt because they begin with default assumptions that analysis may change. */ static CORE_ADDR -call0_analyze_prologue (CORE_ADDR start, CORE_ADDR pc, - int nregs, xtensa_c0reg_t rt[], int *call0) +call0_analyze_prologue (CORE_ADDR start, CORE_ADDR pc, int nregs, + xtensa_c0reg_t rt[], int *call0, + struct gdbarch *gdbarch) { CORE_ADDR ia; /* Current insn address in prologue. */ CORE_ADDR ba = 0; /* Current address at base of insn buffer. */ @@ -2285,7 +2286,7 @@ call0_analyze_prologue (CORE_ADDR start, } /* Track register movement and modification for this operation. */ - call0_track_op (rt, rtmp, opclass, nods, odv, ia, 1); + call0_track_op (rt, rtmp, opclass, nods, odv, ia, 1, gdbarch); } } done: @@ -2315,7 +2316,7 @@ call0_frame_cache (struct frame_info *th { body_pc = call0_analyze_prologue (start_pc, pc, C0_NREGS, &cache->c0.c0_rt[0], - &cache->call0); + &cache->call0, gdbarch); } sp = get_frame_register_unsigned @@ -2487,7 +2488,7 @@ xtensa_skip_prologue (struct gdbarch *gd } /* No debug line info. Analyze prologue for Call0 or simply skip ENTRY. */ - body_pc = call0_analyze_prologue(start_pc, 0, 0, NULL, NULL); + body_pc = call0_analyze_prologue(start_pc, 0, 0, NULL, NULL, gdbarch); return body_pc != 0 ? body_pc : start_pc; } --------------020103070109030709040307--