diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-08-05 14:58:29 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-08-05 14:58:29 +0000 |
commit | 50e1101ec61a8ab56d02e264165a96943b4e6886 (patch) | |
tree | 931bc704fc466cbbb2bc1e3609fa9457d2130e81 /gdb/gdbtk | |
parent | a64eb436054e525ca2dc9f72be0aa1f504a2d4ae (diff) | |
download | gdb-50e1101ec61a8ab56d02e264165a96943b4e6886.tar.gz |
2003-08-05 Andrew Cagney <cagney@redhat.com>
* generic/gdbtk-register.c (gdb_reggrouplist): Update, use
reggroup_next.
(gdb_reggroup): Ditto.
Diffstat (limited to 'gdb/gdbtk')
-rw-r--r-- | gdb/gdbtk/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gdbtk/generic/gdbtk-register.c | 28 |
2 files changed, 21 insertions, 13 deletions
diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog index 5f62cc4f0c2..1f745a60ed8 100644 --- a/gdb/gdbtk/ChangeLog +++ b/gdb/gdbtk/ChangeLog @@ -1,3 +1,9 @@ +2003-08-05 Andrew Cagney <cagney@redhat.com> + + * generic/gdbtk-register.c (gdb_reggrouplist): Update, use + reggroup_next. + (gdb_reggroup): Ditto. + 2003-08-04 David Carlton <carlton@kealia.com> * generic/gdbtk.c (gdbtk_source_start_file): Add "%s" first diff --git a/gdb/gdbtk/generic/gdbtk-register.c b/gdb/gdbtk/generic/gdbtk-register.c index 7b7fdbb0297..7a305656173 100644 --- a/gdb/gdbtk/generic/gdbtk-register.c +++ b/gdb/gdbtk/generic/gdbtk-register.c @@ -514,7 +514,7 @@ static int gdb_reggrouplist (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj **objv) { - struct reggroup *const *groups; + struct reggroup *group; int i = 0; if (objc != 0) @@ -523,13 +523,13 @@ gdb_reggrouplist (ClientData clientData, Tcl_Interp *interp, return TCL_ERROR; } - groups = reggroups (current_gdbarch); - - while (groups[i] != NULL) { - if (reggroup_type (groups[i]) == USER_REGGROUP) - Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewStringObj (reggroup_name(groups[i]), -1)); - i++; - } + for (group = reggroup_next (current_gdbarch, NULL); + group != NULL; + group = reggroup_next (current_gdbarch, group)) + { + if (reggroup_type (group) == USER_REGGROUP) + Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewStringObj (reggroup_name (group), -1)); + } return TCL_OK; } @@ -541,7 +541,7 @@ static int gdb_reggroup (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj **objv) { - struct reggroup *const *group; + struct reggroup *group; char *groupname; int regnum; @@ -558,18 +558,20 @@ gdb_reggroup (ClientData clientData, Tcl_Interp *interp, return TCL_ERROR; } - for (group = reggroups (current_gdbarch); *group != NULL; group++) + for (group = reggroup_next (current_gdbarch, NULL); + group != NULL; + group = reggroup_next (current_gdbarch, group)) { - if (strcmp (groupname, reggroup_name (*group)) == 0) + if (strcmp (groupname, reggroup_name (group)) == 0) break; } - if (*group == NULL) + if (group == NULL) return TCL_ERROR; for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++) { - if (gdbarch_register_reggroup_p (current_gdbarch, regnum, *group)) + if (gdbarch_register_reggroup_p (current_gdbarch, regnum, group)) Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr, Tcl_NewIntObj (regnum)); } return TCL_OK; |