From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5201 invoked by alias); 20 Nov 2007 13:33:58 -0000 Received: (qmail 5190 invoked by uid 22791); 20 Nov 2007 13:33:57 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 20 Nov 2007 13:33:44 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id lAKDXe9T314960 for ; Tue, 20 Nov 2007 13:33:40 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.6) with ESMTP id lAKDXcgg2240746 for ; Tue, 20 Nov 2007 14:33:40 +0100 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 lAKDXcf5028196 for ; Tue, 20 Nov 2007 14:33:38 +0100 Received: from bbkeks.boeblingen.de.ibm.com (dyn-9-152-248-41.boeblingen.de.ibm.com [9.152.248.41]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id lAKDXbNV028165 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Nov 2007 14:33:38 +0100 Message-ID: <4742E1C6.2010709@de.ibm.com> Date: Tue, 20 Nov 2007 13:33:00 -0000 From: Markus Deuling User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: GDB Patches CC: Ulrich Weigand Subject: [rfc] Replace current_gdbarch in stack.c Content-Type: multipart/mixed; boundary="------------080104020800000909000705" 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: 2007-11/txt/msg00378.txt.bz2 This is a multi-part message in MIME format. --------------080104020800000909000705 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-length: 323 Hi, this patch removes the last occurences of current_gdbarch in stack.c. Tested on x86. Ok ? ChangeLog: * stack.c (print_args_stub): Use get_frame_arch to get at the current architecture and replace current_gdbarch. (frame_info): Likewise. -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------080104020800000909000705 Content-Type: text/plain; name="diff-stack" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-stack" Content-length: 1800 diff -urpN src/gdb/stack.c dev/gdb/stack.c --- src/gdb/stack.c 2007-11-09 21:38:58.000000000 +0100 +++ dev/gdb/stack.c 2007-11-20 13:49:32.000000000 +0100 @@ -409,11 +409,12 @@ static int print_args_stub (void *args) { struct print_args_args *p = args; + struct gdbarch *gdbarch = get_frame_arch (p->frame); int numargs; - if (gdbarch_frame_num_args_p (current_gdbarch)) + if (gdbarch_frame_num_args_p (gdbarch)) { - numargs = gdbarch_frame_num_args (current_gdbarch, p->frame); + numargs = gdbarch_frame_num_args (gdbarch, p->frame); gdb_assert (numargs >= 0); } else @@ -893,15 +894,15 @@ frame_info (char *addr_exp, int from_tty struct gdbarch *gdbarch; fi = parse_frame_specification_1 (addr_exp, "No stack.", &selected_frame_p); + gdbarch = get_frame_arch (fi); /* Name of the value returned by get_frame_pc(). Per comments, "pc" is not a good name. */ - if (gdbarch_pc_regnum (current_gdbarch) >= 0) + if (gdbarch_pc_regnum (gdbarch) >= 0) /* OK, this is weird. The gdbarch_pc_regnum hardware register's value can easily not match that of the internal value returned by get_frame_pc(). */ - pc_regname = gdbarch_register_name (current_gdbarch, - gdbarch_pc_regnum (current_gdbarch)); + pc_regname = gdbarch_register_name (gdbarch, gdbarch_pc_regnum (gdbarch)); else /* But then, this is weird to. Even without gdbarch_pc_regnum, an architectures will often have a hardware register called "pc", @@ -910,7 +911,6 @@ frame_info (char *addr_exp, int from_tty pc_regname = "pc"; find_frame_sal (fi, &sal); - gdbarch = get_frame_arch (fi); func = get_frame_function (fi); /* FIXME: cagney/2002-11-28: Why bother? Won't sal.symtab contain the same value? */ --------------080104020800000909000705--