Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: gdb-patches@sourceware.org
Cc: gdb@sourceware.org, vladimir@codesourcery.com,
	dan@codesourcery.com,         brobecker@adacore.com
Subject: [patch] Re: -data-list-register-names regression?
Date: Wed, 17 Mar 2010 21:38:00 -0000	[thread overview]
Message-ID: <201003172138.o2HLcOBY021097@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <201003171345.44000.vladimir@codesourcery.com> from "Vladimir Prus" at Mar 17, 2010 01:45:43 PM

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


       reply	other threads:[~2010-03-17 21:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201003171345.44000.vladimir@codesourcery.com>
2010-03-17 21:38 ` Ulrich Weigand [this message]
2010-03-17 22:37   ` Daniel Jacobowitz
2010-03-17 22:59     ` Joel Brobecker
2010-03-18  4:44       ` Dave Korn
2010-03-18 13:28       ` Ulrich Weigand
2010-03-18 13:55         ` Joel Brobecker
2010-03-18 15:53           ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201003172138.o2HLcOBY021097@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=brobecker@adacore.com \
    --cc=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gdb@sourceware.org \
    --cc=vladimir@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox