From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13647 invoked by alias); 17 Mar 2010 21:38:36 -0000 Received: (qmail 13630 invoked by uid 22791); 17 Mar 2010 21:38:35 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtagate7.de.ibm.com (HELO mtagate7.de.ibm.com) (195.212.17.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Mar 2010 21:38:29 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate7.de.ibm.com (8.13.1/8.13.1) with ESMTP id o2HLcPbX013571; Wed, 17 Mar 2010 21:38:25 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 v10.0) with ESMTP id o2HLcPLp1736818; Wed, 17 Mar 2010 22:38:25 +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 o2HLcP0g021108; Wed, 17 Mar 2010 22:38:25 +0100 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id o2HLcOBY021097; Wed, 17 Mar 2010 22:38:24 +0100 Message-Id: <201003172138.o2HLcOBY021097@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 17 Mar 2010 22:38:24 +0100 Subject: [patch] Re: -data-list-register-names regression? To: gdb-patches@sourceware.org Date: Wed, 17 Mar 2010 21:38:00 -0000 From: "Ulrich Weigand" Cc: gdb@sourceware.org, vladimir@codesourcery.com, dan@codesourcery.com, brobecker@adacore.com In-Reply-To: <201003171345.44000.vladimir@codesourcery.com> from "Vladimir Prus" at Mar 17, 2010 01:45:43 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 2010-03/txt/msg00635.txt.bz2 Vladimir Prus wrote: > It seems that -data-list-register-names does not work until the application > was started. In 6.8, it worked. Hmm, seems this was my fault: http://sourceware.org/ml/gdb-patches/2009-06/msg00124.html I guess we can allow this again by using get_current_arch () instead of requiring the presence of a selected frame. The patch below implements this. As a side note, I'm wondering why this matters so much to Eclipse: even if we allow -data-list-register-names before the application started, Eclipse still will not be able to show register *contents*. And once the application *has* started, I'd hope Eclipse re-reads the list of register names anyway, because it might have changed from before ... Tested on powerpc-linux. Thoughts on whether we should this? Bye, Ulrich ChangeLog: * mi/mi-main.c (mi_cmd_list_thread_groups): Use get_current_arch instead of selected frame architecture. testsuite/ChangeLog: * gdb.mi/gdb680.exp: Revert 2009-06-17 change. Index: gdb/mi/mi-main.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-main.c,v retrieving revision 1.169 diff -u -p -r1.169 mi-main.c --- gdb/mi/mi-main.c 24 Feb 2010 23:11:28 -0000 1.169 +++ gdb/mi/mi-main.c 17 Mar 2010 20:58:38 -0000 @@ -852,7 +852,6 @@ mi_cmd_list_thread_groups (char *command void mi_cmd_data_list_register_names (char *command, char **argv, int argc) { - struct frame_info *frame; struct gdbarch *gdbarch; int regnum, numregs; int i; @@ -864,8 +863,7 @@ mi_cmd_data_list_register_names (char *c In this case, some entries of gdbarch_register_name will change depending upon the particular processor being debugged. */ - frame = get_selected_frame (NULL); - gdbarch = get_frame_arch (frame); + gdbarch = get_current_arch (); numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch); cleanup = make_cleanup_ui_out_list_begin_end (uiout, "register-names"); Index: gdb/testsuite/gdb.mi/gdb680.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/gdb680.exp,v retrieving revision 1.8 diff -u -p -r1.8 gdb680.exp --- gdb/testsuite/gdb.mi/gdb680.exp 1 Jan 2010 07:32:03 -0000 1.8 +++ gdb/testsuite/gdb.mi/gdb680.exp 17 Mar 2010 20:58:39 -0000 @@ -27,7 +27,7 @@ if [mi_gdb_start] { proc do_test {count} { mi_gdb_test "-data-list-register-names -1" \ - {\^error,msg=\"No registers.\"} \ + {\^error,msg=\"bad register number\"} \ "-data-list-register-names -1, try $count" } -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com