projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* gdb.threads/linux-dp.exp: Unset 'seen' before 'array set'.
[deliverable/binutils-gdb.git]
/
gdb
/
reggroups.c
diff --git
a/gdb/reggroups.c
b/gdb/reggroups.c
index 63954f683e0c06b945ac4ae95a8b2c5d601a460e..b4790503024a58f5ad72d6ab46fd7321978630a6 100644
(file)
--- a/
gdb/reggroups.c
+++ b/
gdb/reggroups.c
@@
-1,6
+1,6
@@
/* Register groupings for GDB, the GNU debugger.
/* Register groupings for GDB, the GNU debugger.
- Copyright (C) 2002
, 2003, 2007
Free Software Foundation, Inc.
+ Copyright (C) 2002
-2003, 2007-2012
Free Software Foundation, Inc.
Contributed by Red Hat.
Contributed by Red Hat.
@@
-20,6
+20,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
+40,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
+81,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
+191,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
+202,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,15
+235,20
@@
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
{
else
{
+ struct cleanup *cleanups;
struct ui_file *file = gdb_fopen (args, "w");
struct ui_file *file = gdb_fopen (args, "w");
+
if (file == NULL)
perror_with_name (_("maintenance print reggroups"));
if (file == NULL)
perror_with_name (_("maintenance print reggroups"));
- reggroups_dump (current_gdbarch, file);
- ui_file_delete (file);
+ cleanups = make_cleanup_ui_file_delete (file);
+ reggroups_dump (gdbarch, file);
+ do_cleanups (cleanups);
}
}
}
}
This page took
0.024295 seconds
and
4
git commands to generate.