This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch/sysregs-branch] reggroup fixes


FYI,

Testing turned up a number of problems:

- broke ``info registers REGNAME''
- needed to test against all_reggroup and general_reggroup. If you add system or other registers they otherwize get displayed.
- tweaks mxcsr.

committed to branch,
Andrew
2002-08-28  Andrew Cagney  <ac131313@redhat.com>

	* infcmd.c (registers_info): Pass start, instead of addr_exp, to
	target_map_name_to_register.
	(default_print_registers_info): Use all_reggroup and
	general_reggroup to decide if all, general registers should be
	displayed.
	* i386-tdep.c (i386_register_reggroup_p): Move mxcsr to SSE group.

Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.84.4.1
diff -u -r1.84.4.1 i386-tdep.c
--- i386-tdep.c	26 Aug 2002 19:57:39 -0000	1.84.4.1
+++ i386-tdep.c	29 Aug 2002 03:21:52 -0000
@@ -1445,11 +1445,11 @@
 {
   if (group == all_reggroup)
     return 1;
-  if (mmx_regnum_p (regnum) || regnum == MXCSR_REGNUM)
+  if (mmx_regnum_p (regnum))
     return (group == i368_mmx_reggroup || group == vector_reggroup);
   if (FP_REGNUM_P (regnum) || FPC_REGNUM_P (regnum))
     return (group == float_reggroup || group == all_reggroup);
-  if (SSE_REGNUM_P (regnum))
+  if (SSE_REGNUM_P (regnum) || regnum == MXCSR_REGNUM)
     return (group == i368_sse_reggroup || group == vector_reggroup);
   if (group == general_reggroup)
     return 1;
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.54.4.1
diff -u -r1.54.4.1 infcmd.c
--- infcmd.c	26 Aug 2002 19:57:39 -0000	1.54.4.1
+++ infcmd.c	29 Aug 2002 03:21:52 -0000
@@ -1586,13 +1586,12 @@
          specific reg.  */
       if (regnum == -1)
 	{
-	  if (!print_all)
-	    {
-	      if (gdbarch_register_reggroup_p (gdbarch, i, float_reggroup))
-		continue;
-	      if (gdbarch_register_reggroup_p (gdbarch, i, vector_reggroup))
-		continue;
-	    }
+	  if (print_all && !gdbarch_register_reggroup_p (gdbarch, i,
+							 all_reggroup))
+	    continue;
+	  if (!print_all && !gdbarch_register_reggroup_p (gdbarch, i,
+							  general_reggroup))
+	    continue;
 	}
       else
 	{
@@ -1696,7 +1695,7 @@
 
   while (*addr_exp != '\0')
     {
-      const char *start;
+      char *start;
       const char *end;
       /* Keep skipping leading white space until something interesting
          is found.  */
@@ -1722,7 +1721,7 @@
 
       /* A register name?  */
       {
-	int regnum = target_map_name_to_register (addr_exp, end - start);
+	int regnum = target_map_name_to_register (start, end - start);
 	if (regnum >= 0)
 	  {
 	    gdbarch_print_registers_info (current_gdbarch, gdb_stdout,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]