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 171fc36654990954fe67d861c68bc33ebe8517bb..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.
@@
-40,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;
@@
-80,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;
}
@@
-189,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
@@
-199,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
@@
-239,6
+244,7
@@
maintenance_print_reggroups (char *args, int from_tty)
{
struct cleanup *cleanups;
struct ui_file *file = gdb_fopen (args, "w");
{
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);