projects
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gdb/
[binutils-gdb.git]
/
gdb
/
reggroups.c
diff --git
a/gdb/reggroups.c
b/gdb/reggroups.c
index 080342206cbbaaaf2418af88e1171d5f8a4cdc42..fdc05754729a4d9373042767231fe77fa517496d 100644
(file)
--- a/
gdb/reggroups.c
+++ b/
gdb/reggroups.c
@@
-1,6
+1,7
@@
/* Register groupings for GDB, the GNU debugger.
/* Register groupings for GDB, the GNU debugger.
- Copyright (C) 2002, 2003, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Red Hat.
Contributed by Red Hat.
@@
-20,6
+21,7
@@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "arch-utils.h"
#include "reggroups.h"
#include "gdbtypes.h"
#include "gdb_assert.h"
#include "reggroups.h"
#include "gdbtypes.h"
#include "gdb_assert.h"
@@
-39,6
+41,7
@@
struct reggroup *
reggroup_new (const char *name, enum reggroup_type type)
{
struct reggroup *group = XMALLOC (struct reggroup);
reggroup_new (const char *name, enum reggroup_type type)
{
struct reggroup *group = XMALLOC (struct reggroup);
+
group->name = name;
group->type = type;
return group;
group->name = name;
group->type = type;
return group;
@@
-79,6
+82,7
@@
reggroups_init (struct gdbarch *gdbarch)
{
struct reggroups *groups = GDBARCH_OBSTACK_ZALLOC (gdbarch,
struct reggroups);
{
struct reggroups *groups = GDBARCH_OBSTACK_ZALLOC (gdbarch,
struct reggroups);
+
groups->last = &groups->first;
return groups;
}
groups->last = &groups->first;
return groups;
}
@@
-188,6
+192,7
@@
reggroups_dump (struct gdbarch *gdbarch, struct ui_file *file)
/* Group name. */
{
const char *name;
/* Group name. */
{
const char *name;
+
if (group == NULL)
name = "Group";
else
if (group == NULL)
name = "Group";
else
@@
-198,6
+203,7
@@
reggroups_dump (struct gdbarch *gdbarch, struct ui_file *file)
/* Group type. */
{
const char *type;
/* Group type. */
{
const char *type;
+
if (group == NULL)
type = "Type";
else
if (group == NULL)
type = "Type";
else
@@
-230,16
+236,19
@@
reggroups_dump (struct gdbarch *gdbarch, struct ui_file *file)
static void
maintenance_print_reggroups (char *args, int from_tty)
{
static void
maintenance_print_reggroups (char *args, int from_tty)
{
+ struct gdbarch *gdbarch = get_current_arch ();
+
if (args == NULL)
if (args == NULL)
- reggroups_dump (
current_
gdbarch, gdb_stdout);
+ reggroups_dump (gdbarch, gdb_stdout);
else
{
struct cleanup *cleanups;
struct ui_file *file = gdb_fopen (args, "w");
else
{
struct cleanup *cleanups;
struct ui_file *file = gdb_fopen (args, "w");
+
if (file == NULL)
perror_with_name (_("maintenance print reggroups"));
cleanups = make_cleanup_ui_file_delete (file);
if (file == NULL)
perror_with_name (_("maintenance print reggroups"));
cleanups = make_cleanup_ui_file_delete (file);
- reggroups_dump (
current_gdbarch, file);
+ reggroups_dump (
gdbarch, file);
do_cleanups (cleanups);
}
}
do_cleanups (cleanups);
}
}