1 /* Do various things to symbol tables (other than lookup), for GDB.
2 Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
26 #include "breakpoint.h"
33 #define DEV_TTY "/dev/tty"
36 /* Prototypes for local functions */
39 dump_symtab
PARAMS ((struct objfile
*, struct symtab
*, PTR
, PTR
, PTR
));
42 dump_psymtab
PARAMS ((struct objfile
*, struct partial_symtab
*, PTR
, PTR
,
46 dump_msymbols
PARAMS ((struct objfile
*, PTR
, PTR
, PTR
));
49 dump_objfile
PARAMS ((struct objfile
*, PTR
, PTR
, PTR
));
52 printobjfiles_command
PARAMS ((void));
55 block_depth
PARAMS ((struct block
*));
58 print_partial_symbol
PARAMS ((struct partial_symbol
*, int, char *, FILE *));
61 printpsyms_command
PARAMS ((char *, int));
64 print_symbol
PARAMS ((struct symbol
*, int, FILE *));
67 printsyms_command
PARAMS ((char *, int));
70 free_symtab_block
PARAMS ((struct objfile
*, struct block
*));
73 printmsyms_command
PARAMS ((char *, int));
76 dump_symtab_lines
PARAMS ((struct symtab
*));
79 dump_symtabs
PARAMS ((struct symtab
*));
82 dump_last_symtab
PARAMS ((struct symtab
*));
85 dump_blockvector
PARAMS ((struct blockvector
*));
88 dump_block
PARAMS ((struct block
*));
91 dump_addrclass
PARAMS ((int));
94 dump_namespace
PARAMS ((int));
97 dump_symbol
PARAMS ((struct symbol
*));
100 dump_type
PARAMS ((struct type
*));
103 dump_linetable
PARAMS ((struct linetable
*));
106 dump_strtbl
PARAMS ((void));
109 /* Free a struct block <- B and all the symbols defined in that block. */
112 free_symtab_block (objfile
, b
)
113 struct objfile
*objfile
;
118 for (i
= 0; i
< n
; i
++)
120 mfree (objfile
-> md
, SYMBOL_NAME (BLOCK_SYM (b
, i
)));
121 mfree (objfile
-> md
, BLOCK_SYM (b
, i
));
123 mfree (objfile
-> md
, b
);
126 /* Free all the storage associated with the struct symtab <- S.
127 Note that some symtabs have contents malloc'ed structure by structure,
128 while some have contents that all live inside one big block of memory,
129 and some share the contents of another symbol table and so you should
130 not free the contents on their behalf (except sometimes the linetable,
131 which maybe per symtab even when the rest is not).
132 It is s->free_code that says which alternative to use. */
136 register struct symtab
*s
;
139 register struct blockvector
*bv
;
141 switch (s
->free_code
)
144 /* All the contents are part of a big block of memory (an obstack),
145 and some other symtab is in charge of freeing that block.
146 Therefore, do nothing. */
150 /* Here all the contents were malloc'ed structure by structure
151 and must be freed that way. */
152 /* First free the blocks (and their symbols. */
153 bv
= BLOCKVECTOR (s
);
154 n
= BLOCKVECTOR_NBLOCKS (bv
);
155 for (i
= 0; i
< n
; i
++)
156 free_symtab_block (s
-> objfile
, BLOCKVECTOR_BLOCK (bv
, i
));
157 /* Free the blockvector itself. */
158 mfree (s
-> objfile
-> md
, bv
);
159 /* Also free the linetable. */
162 /* Everything will be freed either by our `free_ptr'
163 or by some other symtab, except for our linetable.
166 mfree (s
-> objfile
-> md
, LINETABLE (s
));
170 /* If there is a single block of memory to free, free it. */
171 if (s
-> free_ptr
!= NULL
)
172 mfree (s
-> objfile
-> md
, s
-> free_ptr
);
174 /* Free source-related stuff */
175 if (s
-> line_charpos
!= NULL
)
176 mfree (s
-> objfile
-> md
, s
-> line_charpos
);
177 if (s
-> fullname
!= NULL
)
178 mfree (s
-> objfile
-> md
, s
-> fullname
);
179 mfree (s
-> objfile
-> md
, s
);
183 dump_objfile (objfile
, arg1
, arg2
, arg3
)
184 struct objfile
*objfile
;
189 struct symtab
*symtab
;
190 struct partial_symtab
*psymtab
;
192 printf_filtered ("\nObject file %s: ", objfile
-> name
);
193 printf_filtered ("Objfile at %x, bfd at %x, %d minsyms\n\n",
194 objfile
, objfile
-> obfd
, objfile
->minimal_symbol_count
);
196 if (objfile
-> psymtabs
)
198 printf_filtered ("Psymtabs:\n");
199 for (psymtab
= objfile
-> psymtabs
;
201 psymtab
= psymtab
-> next
)
203 printf_filtered ("%s at %x, ", psymtab
-> filename
, psymtab
);
204 if (psymtab
-> objfile
!= objfile
)
206 printf_filtered ("NOT ON CHAIN! ");
210 printf_filtered ("\n\n");
213 if (objfile
-> symtabs
)
215 printf_filtered ("Symtabs:\n");
216 for (symtab
= objfile
-> symtabs
;
218 symtab
= symtab
->next
)
220 printf_filtered ("%s at %x, ", symtab
-> filename
, symtab
);
221 if (symtab
-> objfile
!= objfile
)
223 printf_filtered ("NOT ON CHAIN! ");
227 printf_filtered ("\n\n");
233 dump_msymbols (objfile
, arg1
, arg2
, arg3
)
234 struct objfile
*objfile
;
239 FILE *outfile
= (FILE *) arg1
;
240 char *symname
= (char *) arg2
;
241 struct minimal_symbol
*msymbol
;
245 /* Print minimal symbols from this objfile unless a specific linkage
246 unit file was requested, in which case we only print the symbols
248 if (symname
== NULL
|| (strcmp (symname
, objfile
-> name
) == 0))
250 fprintf_filtered (outfile
, "\nObject file %s:\n\n", objfile
-> name
);
251 for (index
= 0, msymbol
= objfile
-> msymbols
;
252 msymbol
-> name
!= NULL
; msymbol
++, index
++)
254 switch (msymbol
-> type
)
275 fprintf_filtered (outfile
, "[%2d] %c %#10x %s\n", index
, ms_type
,
276 msymbol
-> address
, msymbol
-> name
);
278 if (objfile
-> minimal_symbol_count
!= index
)
280 warning ("internal error: minimal symbol count %d != %d",
281 objfile
-> minimal_symbol_count
, index
);
283 fprintf_filtered (outfile
, "\n");
289 dump_psymtab (objfile
, psymtab
, arg1
, arg2
, arg3
)
290 struct objfile
*objfile
;
291 struct partial_symtab
*psymtab
;
296 FILE *outfile
= (FILE *) arg1
;
297 char *symname
= (char *) arg2
;
299 /* If source file name is specified, reject all but that one. */
300 if (symname
== NULL
|| (strcmp (symname
, psymtab
-> filename
) == 0))
302 fprintf_filtered (outfile
, "\nPartial symtab for source file %s ",
303 psymtab
-> filename
);
304 fprintf_filtered (outfile
, "(object 0x%x)\n\n", psymtab
);
305 fprintf (outfile
, " Read from object file %s (0x%x)\n",
306 objfile
-> name
, objfile
);
308 if (psymtab
-> readin
)
310 fprintf_filtered (outfile
,
311 " Full symtab was read (at 0x%x by function at 0x%x)\n",
312 psymtab
-> symtab
, psymtab
-> read_symtab
);
314 fprintf_filtered (outfile
, " Relocate symbols by 0x%x\n",
316 fprintf_filtered (outfile
, " Symbols cover text addresses 0x%x-0x%x\n",
317 psymtab
-> textlow
, psymtab
-> texthigh
);
318 fprintf_filtered (outfile
, " Depends on %d other partial symtabs.\n",
319 psymtab
-> number_of_dependencies
);
320 if (psymtab
-> n_global_syms
> 0)
322 print_partial_symbol (objfile
-> global_psymbols
.list
323 + psymtab
-> globals_offset
,
324 psymtab
-> n_global_syms
, "Global", outfile
);
326 if (psymtab
-> n_static_syms
> 0)
328 print_partial_symbol (objfile
-> static_psymbols
.list
329 + psymtab
-> statics_offset
,
330 psymtab
-> n_static_syms
, "Static", outfile
);
332 fprintf_filtered (outfile
, "\n");
338 dump_symtab (objfile
, symtab
, arg1
, arg2
, arg3
)
339 struct objfile
*objfile
;
340 struct symtab
*symtab
;
345 FILE *outfile
= (FILE *) arg1
;
346 char *symname
= (char *) arg2
;
349 register struct linetable
*l
;
350 struct blockvector
*bv
;
351 register struct block
*b
;
354 if (symname
== NULL
|| (strcmp (symname
, symtab
-> filename
) == 0))
356 fprintf (outfile
, "\nSymtab for file %s\n", symtab
->filename
);
357 fprintf (outfile
, "Read from object file %s (%x)\n", objfile
->name
,
360 /* First print the line table. */
361 l
= LINETABLE (symtab
);
363 fprintf (outfile
, "\nLine table:\n\n");
365 for (i
= 0; i
< len
; i
++)
366 fprintf (outfile
, " line %d at %x\n", l
->item
[i
].line
,
369 /* Now print the block info. */
370 fprintf (outfile
, "\nBlockvector:\n\n");
371 bv
= BLOCKVECTOR (symtab
);
372 len
= BLOCKVECTOR_NBLOCKS (bv
);
373 for (i
= 0; i
< len
; i
++)
375 b
= BLOCKVECTOR_BLOCK (bv
, i
);
376 depth
= block_depth (b
) * 2;
377 print_spaces (depth
, outfile
);
378 fprintf (outfile
, "block #%03d (object 0x%x) ", i
, b
);
379 fprintf (outfile
, "[0x%x..0x%x]", BLOCK_START (b
), BLOCK_END (b
));
380 if (BLOCK_SUPERBLOCK (b
))
381 fprintf (outfile
, " (under 0x%x)", BLOCK_SUPERBLOCK (b
));
382 if (BLOCK_FUNCTION (b
))
383 fprintf (outfile
, " %s", SYMBOL_NAME (BLOCK_FUNCTION (b
)));
384 fputc ('\n', outfile
);
385 blen
= BLOCK_NSYMS (b
);
386 for (j
= 0; j
< blen
; j
++)
388 print_symbol (BLOCK_SYM (b
, j
), depth
+ 1, outfile
);
391 fprintf (outfile
, "\n");
397 printsyms_command (args
, from_tty
)
403 struct cleanup
*cleanups
;
404 char *symname
= NULL
;
405 char *filename
= DEV_TTY
;
411 error ("printsyms takes an output file name and optional symbol file name");
413 else if ((argv
= buildargv (args
)) == NULL
)
417 cleanups
= make_cleanup (freeargv
, (char *) argv
);
422 /* If a second arg is supplied, it is a source file name to match on */
429 filename
= tilde_expand (filename
);
430 make_cleanup (free
, filename
);
432 outfile
= fopen (filename
, "w");
434 perror_with_name (filename
);
435 make_cleanup (fclose
, (char *) outfile
);
438 iterate_over_symtabs (dump_symtab
, (PTR
) outfile
, (PTR
) symname
, (PTR
) NULL
);
440 do_cleanups (cleanups
);
444 print_symbol (symbol
, depth
, outfile
)
445 struct symbol
*symbol
;
449 print_spaces (depth
, outfile
);
450 if (SYMBOL_NAMESPACE (symbol
) == LABEL_NAMESPACE
)
452 fprintf (outfile
, "label %s at 0x%x\n", SYMBOL_NAME (symbol
),
453 SYMBOL_VALUE_ADDRESS (symbol
));
456 if (SYMBOL_NAMESPACE (symbol
) == STRUCT_NAMESPACE
)
458 if (TYPE_NAME (SYMBOL_TYPE (symbol
)))
460 type_print_1 (SYMBOL_TYPE (symbol
), "", outfile
, 1, depth
);
464 fprintf (outfile
, "%s %s = ",
465 (TYPE_CODE (SYMBOL_TYPE (symbol
)) == TYPE_CODE_ENUM
467 : (TYPE_CODE (SYMBOL_TYPE (symbol
)) == TYPE_CODE_STRUCT
468 ? "struct" : "union")),
469 SYMBOL_NAME (symbol
));
470 type_print_1 (SYMBOL_TYPE (symbol
), "", outfile
, 1, depth
);
472 fprintf (outfile
, ";\n");
476 if (SYMBOL_CLASS (symbol
) == LOC_TYPEDEF
)
477 fprintf (outfile
, "typedef ");
478 if (SYMBOL_TYPE (symbol
))
480 type_print_1 (SYMBOL_TYPE (symbol
), SYMBOL_NAME (symbol
),
482 fprintf (outfile
, "; ");
485 fprintf (outfile
, "%s ", SYMBOL_NAME (symbol
));
487 switch (SYMBOL_CLASS (symbol
))
490 fprintf (outfile
, "const %ld (0x%lx),",
491 SYMBOL_VALUE (symbol
), SYMBOL_VALUE (symbol
));
494 case LOC_CONST_BYTES
:
495 fprintf (outfile
, "const %u hex bytes:",
496 TYPE_LENGTH (SYMBOL_TYPE (symbol
)));
499 for (i
= 0; i
< TYPE_LENGTH (SYMBOL_TYPE (symbol
)); i
++)
500 fprintf (outfile
, " %2x",
501 (unsigned)SYMBOL_VALUE_BYTES (symbol
) [i
]);
502 fprintf (outfile
, ",");
507 fprintf (outfile
, "static at 0x%x,", SYMBOL_VALUE_ADDRESS (symbol
));
511 fprintf (outfile
, "register %ld,", SYMBOL_VALUE (symbol
));
515 fprintf (outfile
, "arg at 0x%lx,", SYMBOL_VALUE (symbol
));
519 fprintf (outfile
, "arg at offset 0x%x from fp,",
520 SYMBOL_VALUE (symbol
));
523 fprintf (outfile
, "reference arg at 0x%lx,", SYMBOL_VALUE (symbol
));
527 fprintf (outfile
, "parameter register %ld,", SYMBOL_VALUE (symbol
));
531 fprintf (outfile
, "local at 0x%lx,", SYMBOL_VALUE (symbol
));
538 fprintf (outfile
, "label at 0x%lx", SYMBOL_VALUE_ADDRESS (symbol
));
542 fprintf (outfile
, "block (object 0x%x) starting at 0x%x,",
543 SYMBOL_BLOCK_VALUE (symbol
),
544 BLOCK_START (SYMBOL_BLOCK_VALUE (symbol
)));
548 fprintf (outfile
, "botched symbol class %x", SYMBOL_CLASS (symbol
));
552 fprintf (outfile
, "\n");
556 printpsyms_command (args
, from_tty
)
562 struct cleanup
*cleanups
;
563 char *symname
= NULL
;
564 char *filename
= DEV_TTY
;
570 error ("printpsyms takes an output file name and optional symbol file name");
572 else if ((argv
= buildargv (args
)) == NULL
)
576 cleanups
= make_cleanup (freeargv
, (char *) argv
);
581 /* If a second arg is supplied, it is a source file name to match on */
588 filename
= tilde_expand (filename
);
589 make_cleanup (free
, filename
);
591 outfile
= fopen (filename
, "w");
593 perror_with_name (filename
);
594 make_cleanup (fclose
, outfile
);
597 iterate_over_psymtabs (dump_psymtab
, (PTR
) outfile
, (PTR
) symname
,
600 do_cleanups (cleanups
);
604 print_partial_symbol (p
, count
, what
, outfile
)
605 struct partial_symbol
*p
;
611 fprintf_filtered (outfile
, " %s partial symbols:\n", what
);
614 fprintf_filtered (outfile
, " `%s', ", SYMBOL_NAME(p
));
615 switch (SYMBOL_NAMESPACE (p
))
617 case UNDEF_NAMESPACE
:
618 fputs_filtered ("undefined namespace, ", outfile
);
621 /* This is the usual thing -- don't print it */
623 case STRUCT_NAMESPACE
:
624 fputs_filtered ("struct namespace, ", outfile
);
626 case LABEL_NAMESPACE
:
627 fputs_filtered ("label namespace, ", outfile
);
630 fputs_filtered ("<invalid namespace>, ", outfile
);
633 switch (SYMBOL_CLASS (p
))
636 fputs_filtered ("undefined", outfile
);
639 fputs_filtered ("constant int", outfile
);
642 fputs_filtered ("static", outfile
);
645 fputs_filtered ("register", outfile
);
648 fputs_filtered ("pass by value", outfile
);
651 fputs_filtered ("pass by reference", outfile
);
654 fputs_filtered ("register parameter", outfile
);
657 fputs_filtered ("stack parameter", outfile
);
660 fputs_filtered ("type", outfile
);
663 fputs_filtered ("label", outfile
);
666 fputs_filtered ("function", outfile
);
668 case LOC_CONST_BYTES
:
669 fputs_filtered ("constant bytes", outfile
);
672 fputs_filtered ("shuffled arg", outfile
);
675 fputs_filtered ("<invalid location>", outfile
);
678 fputs_filtered (", ", outfile
);
679 fprintf_filtered (outfile
, "0x%x\n", SYMBOL_VALUE (p
));
685 printmsyms_command (args
, from_tty
)
691 struct cleanup
*cleanups
;
692 char *filename
= DEV_TTY
;
693 char *symname
= NULL
;
699 error ("printmsyms takes an output file name and optional symbol file name");
701 else if ((argv
= buildargv (args
)) == NULL
)
705 cleanups
= make_cleanup (freeargv
, argv
);
710 /* If a second arg is supplied, it is a source file name to match on */
717 filename
= tilde_expand (filename
);
718 make_cleanup (free
, filename
);
720 outfile
= fopen (filename
, "w");
722 perror_with_name (filename
);
723 make_cleanup (fclose
, outfile
);
726 iterate_over_objfiles (dump_msymbols
, (PTR
) outfile
, (PTR
) symname
,
729 fprintf_filtered (outfile
, "\n\n");
730 do_cleanups (cleanups
);
734 printobjfiles_command ()
739 iterate_over_objfiles (dump_objfile
, (PTR
) NULL
, (PTR
) NULL
, (PTR
) NULL
);
744 /* Debugging functions from xcoffread.c originally. Some are redundant
745 and should probably disappear. */
750 #if 0 /* We don't know its length FIXME */
752 printf ("===STRING TABLE DUMP...\n\n");
753 for ( ii
=0; ii
< strtbl_len
; ++ii
)
754 printf ("%c", isprint (*(strtbl
+ii
)) ? *(strtbl
+ii
) : ' ');
761 struct linetable
*ltb
;
764 for (ii
=0; ii
< ltb
->nitems
; ++ii
)
765 printf ("line: %d, addr: 0x%x\n", ltb
->item
[ii
].line
, ltb
->item
[ii
].pc
);
772 printf ("0x%x: name: %s\n", typeP
, typeP
->name
? typeP
->name
: "(nil)");
779 printf (" sym: %s\t%s,\t%s\ttype: 0x%x, val: 0x%x end: 0x%x\n",
780 pp
->name
, dump_namespace (pp
->namespace),
781 dump_addrclass (pp
->class), pp
->type
,
782 SYMBOL_CLASS(pp
) == LOC_BLOCK
? BLOCK_START(SYMBOL_BLOCK_VALUE(pp
))
784 SYMBOL_CLASS(pp
) == LOC_BLOCK
? BLOCK_END(SYMBOL_BLOCK_VALUE(pp
)) : 0);
791 static char *ns_name
[] = {
792 "UNDEF_NS", "VAR_NS", "STRUCT_NS", "LABEL_NS"};
795 case UNDEF_NAMESPACE
:
797 case STRUCT_NAMESPACE
:
798 case LABEL_NAMESPACE
:
802 return "***ERROR***";
807 int ac
; /* address class */
809 static char *ac_name
[] = {
836 case LOC_CONST_BYTES
:
840 return "***ERROR***";
848 printf ("BLOCK..: start: 0x%x, end: 0x%x\n", pp
->startaddr
, pp
->endaddr
);
849 for (ii
=0; ii
< pp
->nsyms
; ++ii
)
850 dump_symbol (pp
->sym
[ii
]);
854 dump_blockvector (pp
)
855 struct blockvector
*pp
;
858 for (ii
=0; ii
< pp
->nblocks
; ++ii
)
859 dump_block (pp
->block
[ii
]);
863 dump_last_symtab (pp
)
866 for ( ; pp
; pp
= pp
->next
) {
867 if ( pp
->next
== 0 ) {
868 printf ("SYMTAB NAME: %s\n", pp
->filename
);
869 dump_blockvector (pp
->blockvector
);
878 for ( ; pp
; pp
= pp
->next
) {
879 printf ("SYMTAB NAME: %s\n", pp
->filename
? pp
->filename
: "(nil)");
880 /* if (pp->linetable)
881 dump_linetable (pp->linetable); */
882 dump_blockvector (pp
->blockvector
);
887 dump_symtab_lines (pp
)
890 for ( ; pp
; pp
= pp
->next
) {
891 printf ("SYMTAB NAME: %s\n", pp
->filename
? pp
->filename
: "(nil)");
893 dump_linetable (pp
->linetable
);
894 /* dump_blockvector (pp->blockvector); */
900 /* Return the nexting depth of a block within other blocks in its symtab. */
907 while (block
= BLOCK_SUPERBLOCK (block
)) i
++;
912 /* Increase the space allocated for LISTP. */
915 extend_psymbol_list (listp
, objfile
)
916 register struct psymbol_allocation_list
*listp
;
917 struct objfile
*objfile
;
920 if (listp
->size
== 0)
923 listp
->list
= (struct partial_symbol
*)
924 xmmalloc (objfile
-> md
, new_size
* sizeof (struct partial_symbol
));
928 new_size
= listp
->size
* 2;
929 listp
->list
= (struct partial_symbol
*)
930 xmrealloc (objfile
-> md
, (char *) listp
->list
,
931 new_size
* sizeof (struct partial_symbol
));
933 /* Next assumes we only went one over. Should be good if
934 program works correctly */
935 listp
->next
= listp
->list
+ listp
->size
;
936 listp
->size
= new_size
;
941 /* The work performed by this function is normally done by the macro
942 ADD_PSYMBOL_TO_LIST defined in symfile.h. When debugging gdb, this
943 function makes things easier. */
946 add_psymbol_to_list (name
, namelength
, namespace, class, listp
, psymval
)
949 enum namespace namespace;
950 enum address_class
class;
951 struct psymbol_allocation_list
*listp
;
952 unsigned long psymval
;
954 register struct partial_symbol
*psym
;
956 if (listp
-> next
>= listp
-> list
+ listp
-> size
)
957 extend_psymbol_list (listp
, objfile
);
958 psym
= listp
-> next
++;
959 SYMBOL_NAME (psym
) = (char *) obstack_alloc (&objfile
->psymbol_obstack
,
961 memcpy (SYMBOL_NAME (psym
), name
, namelength
);
962 SYMBOL_NAME (psym
)[namelength
] = '\0';
963 SYMBOL_NAMESPACE (psym
) = namespace;
964 SYMBOL_CLASS (psym
) = class;
965 SYMBOL_VALUE (psym
) = psymval
;
968 /* The work performed by this function is normally done by the macro
969 ADD_PSYMBOL_ADDR_TO_LIST defined in symfile.h. When debugging gdb, this
970 function makes things easier. */
973 add_psymbol_addr_to_list (name
, namelength
, namespace, class, listp
, psymval
)
976 enum namespace namespace;
977 enum address_class
class;
978 struct psymbol_allocation_list
*listp
;
981 register struct partial_symbol
*psym
;
983 if (listp
-> next
>= listp
-> list
+ listp
-> size
)
984 extend_psymbol_list (listp
, objfile
);
985 psym
= listp
-> next
++;
986 SYMBOL_NAME (psym
) = (char *) obstack_alloc (&objfile
->psymbol_obstack
,
988 memcpy (SYMBOL_NAME (psym
), name
, namelength
);
989 SYMBOL_NAME (psym
)[namelength
] = '\0';
990 SYMBOL_NAMESPACE (psym
) = namespace;
991 SYMBOL_CLASS (psym
) = class;
992 SYMBOL_VALUE_ADDRESS (psym
) = psymval
;
998 _initialize_symmisc ()
1000 add_com ("printmsyms", class_obscure
, printmsyms_command
,
1001 "Print dump of current minimal symbol definitions to file OUTFILE.\n\
1002 If a SOURCE file is specified, dump only that file's symbols.");
1003 add_com ("printpsyms", class_obscure
, printpsyms_command
,
1004 "Print dump of current partial symbol definitions to file OUTFILE.\n\
1005 If a SOURCE file is specified, dump only that file's partial symbols.");
1006 add_com ("printsyms", class_obscure
, printsyms_command
,
1007 "Print dump of current symbol definitions to file OUTFILE.\n\
1008 If a SOURCE file is specified, dump only that file's symbols.");
1009 add_com ("printobjfiles", class_obscure
, printobjfiles_command
,
1010 "Print dump of current object file definitions.");