This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] Re: -data-list-register-names regression?
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Cc: gdb at sourceware dot org, vladimir at codesourcery dot com, dan at codesourcery dot com, brobecker at adacore dot com
- Date: Wed, 17 Mar 2010 22:38:24 +0100 (CET)
- Subject: [patch] Re: -data-list-register-names regression?
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