From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7354 invoked by alias); 1 Jun 2005 11:12: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 7186 invoked by uid 22791); 1 Jun 2005 11:12:00 -0000 Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 01 Jun 2005 11:12:00 +0000 Received: from farnswood.snap.net.nz (p134-tnt2.snap.net.nz [202.124.108.134]) by viper.snap.net.nz (Postfix) with ESMTP id D4011537DC3 for ; Wed, 1 Jun 2005 23:11:56 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 96F3862A99; Wed, 1 Jun 2005 12:12:02 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17053.38913.487990.775198@farnswood.snap.net.nz> Date: Wed, 01 Jun 2005 11:12:00 -0000 To: gdb-patches@sources.redhat.com Subject: [PATCH] -data-list-changed-registers X-SW-Source: 2005-06/txt/msg00005.txt.bz2 Currently the GDB/MI command -data-list-changed-registers gives an internal error if there is no stack i.e when there is no inferior process: nickrob/91 ~/src/gdb/gdb -i=mi myprog ~"GNU gdb 6.3.50.20050527-cvs\n" ~"Copyright 2004 Free Software Foundation, Inc.\n" ~"GDB is free software, covered by the GNU General Public License, and you are\n " ~"welcome to change it and/or distribute copies of it under certain conditions.\ n" ~"Type \"show copying\" to see the conditions.\n" ~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\ n" ~"This GDB was configured as \"i586-pc-linux-gnu\"..." ~"Using host libthread_db library \"/lib/libthread_db.so.1\".\n" ~"\n" (gdb) -data-list-changed-registers ~"frame.c:616: internal-error: frame_register: Assertion `frame != NULL && frame ->next != NULL' failed.\n" ~"A problem internal to GDB has been detected,\n" ~"further debugging may prove unreliable.\n" ~"Quit this debugging session? (y or n) " ~"\n" ~"frame.c:616: internal-error: frame_register: Assertion `frame != NULL && frame ->next != NULL' failed.\n" ~"A problem internal to GDB has been detected,\n" ~"further debugging may prove unreliable.\n" ~"Create a core file of GDB? (y or n) " This patch changes the output to: -data-list-changed-registers ^error,msg="mi_cmd_data_list_changed_registers: No registers." (gdb) Nick 2005-06-01 Nick Roberts * mi/mi-main.c (mi_cmd_data_list_changed_registers): Test for registers. *** /home/nick/src/gdb/mi/mi-main.c.~1.78.~ 2005-05-27 12:27:29.000000000 +1200 --- /home/nick/src/gdb/mi/mi-main.c 2005-06-01 22:59:47.000000000 +1200 *************** *** 331,336 **** --- 331,342 ---- cleanup = make_cleanup_ui_out_list_begin_end (uiout, "changed-registers"); + if (!target_has_registers) + { + mi_error_message = xstrprintf ("mi_cmd_data_list_changed_registers: No registers."); + return MI_CMD_ERROR; + } + if (argc == 0) /* No args, just do all the regs */ { for (regnum = 0;