* maint.c: New file.

* Makefile.in (SFILES_MAINDIR):  Add new file maint.c.
	* Makefile.in (OBS):  Add new file maint.o.
	* defs.h (command_class):  Add class_maintenance.
	* defs.h (MAINTENANCE_CMDS):  Default to including maintenance
	commands.  Allow for them (and other nonessential parts of gdb)
	to be selectively left out under special circumstances.
	* gdbtypes.c (recursive_dump_type):  New function; supports
	maintenance print-type command.
	* gdbtypes.h (recursive_dump_type, maintenance_print_type):
	Add prototypes.
	* main.c (maintenancelist, maintenanceinfolist):  Add maintenance
	command lists.
	* main.c (initialize_cmd_lists):  Eliminate unnecessary casts on
	initializers.  Add initializations for setprintlist, showprintlist,
	setchecklist, showchecklist, maintenancelist, and maintenanceinfolist.
	* printcmd.c (maintenance_print_type):  New maintenance cmd.
	* valprint.c (setprintlist, showprintlist):  Move to main.c, as
	implied by comment that all cmd lists are owned by main.c.
	* infcmd.c (unsetlist):  Move to main.c, as implied by comment
	that all cmd lists are owned by main.c.
	* language.c (setchecklist, showchecklist):  Move to main.c, as
	implied by comment that all cmd lists are owned by main.c
	* breakpoint.c (enablelist, enablebreaklist, disablelist, cmdlist,
	deletelist):  Remove redundant declarations (also in gdbcmd.h).
	* symmisc.c (printsyms_command):  Now maintenance_print_symbols.
	* symmisc.c (printmsyms_command):  Now maintenance_print_msymbols.
	* symmisc.c (printpsyms_command):  Now maintenance_print_psymbols.
	* symmisc.c (printobjfiles_command):  Now maintenance_print_objfiles.
	* symtab.h (maintenance_print_symbols, maintenance_print_psymbols,
	maintenance_print_msymbols, maintenance_print_objfiles):
	Add prototypes.
	* symmisc.c (printsyms_command, printpsyms_command,
	printmsyms_command, printobjfiles_command):  Removed from
	_initialize_symmisc.
	* main.c (dump_me_command):  Moved to maint.c and renamed to
	maintenance_dump_me.
	* breakpoint.c (all_breakpoints_info):  Rename to
	maintenance_info_breakpoints.
	* breakpoint.c (_initialize_breakpoint):  Convert add_info of
	all_breakpoints_info to add maintenance_info_breakpoints to the
	maintenanceinfolist instead.
	main.c (initialize_main):  Set up maintenance class commands.
This commit is contained in:
Fred Fish
1992-07-06 00:22:57 +00:00
parent 6a701ae205
commit 0239d9b328
11 changed files with 439 additions and 50 deletions

View File

@@ -1105,3 +1105,113 @@ lookup_fundamental_type (objfile, typeid)
return (type);
}
#if MAINTENANCE_CMDS
void recursive_dump_type (type, spaces)
struct type *type;
int spaces;
{
int idx;
struct field *fldp;
print_spaces_filtered (spaces, stdout);
printf_filtered ("type node @ 0x%x\n", type);
print_spaces_filtered (spaces, stdout);
printf_filtered ("name: 0x%x '%s'\n", type -> name,
type -> name ? type -> name : "<NULL>");
print_spaces_filtered (spaces, stdout);
printf_filtered ("code: 0x%x ", type -> code);
switch (type -> code)
{
case TYPE_CODE_UNDEF: printf_filtered ("TYPE_CODE_UNDEF"); break;
case TYPE_CODE_PTR: printf_filtered ("TYPE_CODE_PTR"); break;
case TYPE_CODE_ARRAY: printf_filtered ("TYPE_CODE_ARRAY"); break;
case TYPE_CODE_STRUCT: printf_filtered ("TYPE_CODE_STRUCT"); break;
case TYPE_CODE_UNION: printf_filtered ("TYPE_CODE_UNION"); break;
case TYPE_CODE_ENUM: printf_filtered ("TYPE_CODE_ENUM"); break;
case TYPE_CODE_FUNC: printf_filtered ("TYPE_CODE_FUNC"); break;
case TYPE_CODE_INT: printf_filtered ("TYPE_CODE_INT"); break;
case TYPE_CODE_FLT: printf_filtered ("TYPE_CODE_FLT"); break;
case TYPE_CODE_VOID: printf_filtered ("TYPE_CODE_VOID"); break;
case TYPE_CODE_SET: printf_filtered ("TYPE_CODE_SET"); break;
case TYPE_CODE_RANGE: printf_filtered ("TYPE_CODE_RANGE"); break;
case TYPE_CODE_PASCAL_ARRAY: printf_filtered ("TYPE_CODE_PASCAL_ARRAY"); break;
case TYPE_CODE_ERROR: printf_filtered ("TYPE_CODE_ERROR"); break;
case TYPE_CODE_MEMBER: printf_filtered ("TYPE_CODE_MEMBER"); break;
case TYPE_CODE_METHOD: printf_filtered ("TYPE_CODE_METHOD"); break;
case TYPE_CODE_REF: printf_filtered ("TYPE_CODE_REF"); break;
case TYPE_CODE_CHAR: printf_filtered ("TYPE_CODE_CHAR"); break;
case TYPE_CODE_BOOL: printf_filtered ("TYPE_CODE_BOOL"); break;
default: printf_filtered ("<UNKNOWN TYPE CODE>"); break;
}
printf_filtered ("\n");
print_spaces_filtered (spaces, stdout);
printf_filtered ("length: %d\n", type -> length);
print_spaces_filtered (spaces, stdout);
printf_filtered ("objfile: 0x%x\n", type -> objfile);
print_spaces_filtered (spaces, stdout);
printf_filtered ("target_type: 0x%x\n", type -> target_type);
if (type -> target_type != NULL)
{
recursive_dump_type (type -> target_type, spaces + 2);
}
print_spaces_filtered (spaces, stdout);
printf_filtered ("pointer_type: 0x%x\n", type -> pointer_type);
print_spaces_filtered (spaces, stdout);
printf_filtered ("reference_type: 0x%x\n", type -> reference_type);
print_spaces_filtered (spaces, stdout);
printf_filtered ("function_type: 0x%x\n", type -> function_type);
print_spaces_filtered (spaces, stdout);
printf_filtered ("flags: 0x%x", type -> flags);
if (type -> flags & TYPE_FLAG_UNSIGNED)
printf_filtered (" TYPE_FLAG_UNSIGNED");
if (type -> flags & TYPE_FLAG_SIGNED)
printf_filtered (" TYPE_FLAG_SIGNED");
if (type -> flags & TYPE_FLAG_STUB)
printf_filtered (" TYPE_FLAG_STUB");
printf_filtered ("\n");
print_spaces_filtered (spaces, stdout);
printf_filtered ("nfields: %d at 0x%x\n", type -> nfields, type -> fields);
for (idx = 0; idx < type -> nfields; idx++)
{
fldp = &(type -> fields[idx]);
print_spaces_filtered (spaces + 2, stdout);
printf_filtered ("[%d] bitpos %d bitsize %d type 0x%x name 0x%x '%s'\n",
idx, fldp -> bitpos, fldp -> bitsize, fldp -> type,
fldp -> name, fldp -> name ? fldp -> name : "<NULL>");
if (fldp -> type != NULL)
{
recursive_dump_type (fldp -> type, spaces + 4);
}
}
print_spaces_filtered (spaces, stdout);
printf_filtered ("vptr_basetype: 0x%x\n", type -> vptr_basetype);
if (type -> vptr_basetype != NULL)
{
recursive_dump_type (type -> vptr_basetype, spaces + 2);
}
print_spaces_filtered (spaces, stdout);
printf_filtered ("vptr_fieldno: %d\n", type -> vptr_fieldno);
switch (type -> code)
{
case TYPE_CODE_METHOD:
case TYPE_CODE_FUNC:
print_spaces_filtered (spaces, stdout);
printf_filtered ("arg_types: 0x%x\n",
type -> type_specific.arg_types);
break;
case TYPE_CODE_STRUCT:
print_spaces_filtered (spaces, stdout);
printf_filtered ("cplus_stuff: 0x%x\n",
type -> type_specific.cplus_stuff);
break;
}
}
#endif /* MAINTENANCE_CMDS */