/* Now that the executable file is positioned at symbol table,
process it and define symbols accordingly. */
- printf("Reading symbol data from %s...", name);
- fflush(stdout);
read_mips_symtab(desc, 0);
/* patch_opaque_types ();*/
{
}
-
-#if 0
-/* Exported procedure: Reads symbols from file NAME.
- Invoked at startup time if executable was given.
- When invoked cleans up the world */
-
-void
-symbol_file_command(name, from_tty)
- char *name;
- int from_tty;
-{
- int desc;
- struct coff_exec hdr;
- register int val;
- extern void close();
- struct cleanup *old_chain;
-
- dont_repeat();
-
- /*
- * Make sure s/he means it
- */
- if (name == 0) {
- if ((symtab_list || partial_symtab_list)
- && from_tty
- && !query("Discard symbol table? ", 0))
- error("Not confirmed.");
- destroy_all_symtabs();
- return;
- }
-
- name = tilde_expand(name);
- make_cleanup(free, name);
-
- if (symtab_list &&
- !query("Load new symbol table from \"%s\"? ", name))
- error("Not confirmed.");
-
- /* Open the file */
- {
- char *absolute_name;
- desc = openp (getenv ("PATH"), 1, name, O_RDONLY, 0, &absolute_name);
- if (desc < 0)
- perror_with_name (name);
- else
- name = absolute_name;
- }
-
- old_chain = make_cleanup (close, desc);
- make_cleanup (free_current_contents, &name);
-
- /*
- * Check file is indeed executable
- */
- val = myread(desc, &hdr, sizeof hdr);
- if (val < 0)
- perror_with_name(name);
-
- if (N_BADMAG(hdr))
- error("File \"%s\" not in executable format.", name);
-
- if (hdr.a.entry < SAFE_TEXT_ADDR && access(name, 1))
- printf_filtered("Warning: %s is not executable!\n", name);
-
- if (hdr.a_syms == 0) {
- printf_filtered("%s does not have a symbol-table.\n", name);
- fflush(stdout);
- return;
- }
-
- /* Get the modification time. */
- {
- struct stat symstat;
-
- if (fstat (desc, &symstat) < 0)
- perror_with_name (name);
-
- symfile_mtime = symstat.st_mtime;
- }
-
- /*
- * Throw away the old symbol table.
- */
-
- destroy_all_symtabs();
-
- /* Make a default for file to list. */
-
- symfile = savestring (name, strlen (name));
-
- /* Prepare to remember misc symbol values */
-
- init_misc_bunches ();
- make_cleanup (discard_misc_bunches, 0);
-
- /*
- * Now read the new symbol table
- */
-
- read_mips_symtab(desc, 0);
-
- /* Go over the misc symbol bunches and install them in vector. */
-
- condense_misc_bunches (0);
-
- /* Don't allow char * to have a typename (else would get caddr_t.) */
-
- TYPE_NAME (lookup_pointer_type (builtin_type_char)) = 0;
-
- /* Force reinit of the sigtramp info */
- sigtramp_address = 0;
-
- do_cleanups (old_chain); /* Descriptor closed here */
-
- if (!partial_symtab_list)
- printf ("\n(no debugging symbols found)...");
-
- printf ("done.\n");
- fflush(stdout);
-}
-#endif
-
-/* C++:
- This function allows the addition of incrementally linked object files.
- Since this has a fair amount of code in common with symbol_file_command,
- it might be worthwhile to consolidate things, as was done with
- read_dbx_symtab and condense_misc_bunches. */
-
-/* Exported procedure: add more symbols from file NAME. */
-
-void
-add_file_command(arg_string)
- char* arg_string;
-{
- int desc;
- struct coff_exec hdr;
- register int val;
- extern void close();
- struct cleanup *old_chain;
- char *name;
- unsigned text_addr;
-
- if (arg_string == 0)
- error ("add-file takes a file name and an address");
-
- if (arg_string == 0)
- error ("add-file takes a file name and an address");
-
- arg_string = tilde_expand (arg_string);
- make_cleanup (free, arg_string);
-
- for( ; *arg_string == ' '; arg_string++ );
- name = arg_string;
- for( ; *arg_string && *arg_string != ' ' ; arg_string++ );
- *arg_string++ = (char) 0;
-
- if (name[0] == 0)
- error ("add-file takes a file name and an address");
-
- text_addr = parse_and_eval_address (arg_string);
-
- dont_repeat();
-
- if (!query ("add symbol table from filename \"%s\" at text_addr = 0x%x\n",
- name, text_addr))
- error ("Not confirmed.");
-
- /*
- * Open the file
- */
- {
- char *absolute_name;
-
- desc = openp(getenv("PATH"), 1, name, O_RDONLY, 0, &absolute_name);
- if (desc < 0)
- perror_with_name(name);
- else
- name = absolute_name;
- }
- old_chain = make_cleanup (close, desc);
-
-
- /*
- * Check file is indeed executable
- */
- val = myread(desc, &hdr, sizeof hdr);
- if (val < 0)
- perror_with_name(name);
-
- if (N_BADMAG(hdr))
- error("File \"%s\" not in executable format.", name);
-
- if (hdr.a.entry < SAFE_TEXT_ADDR && access(name, 1))
- printf_filtered("Warning: %s is not executable!\n", name);
-
- if (hdr.a_syms == 0) {
- printf_filtered("%s does not have a symbol-table.\n", name);
- fflush(stdout);
- return;
- }
-
- if (symfile)
- free(symfile);
- symfile = 0;
-
- /*
- * Now read the new symbol table
- */
-
- symfile = savestring(name, strlen(name));
-
- init_misc_bunches ();
- make_cleanup (discard_misc_bunches, 0);
- read_mips_symtab(desc, 1);
-
- /* Go over the misc symbol bunches and install them in vector. */
-
- condense_misc_bunches (1);
-
- /* Don't allow char * to have a typename (else would get caddr_t.) */
-
- TYPE_NAME (lookup_pointer_type (builtin_type_char)) = 0;
-
- do_cleanups (old_chain);
-
- printf_filtered("done.\n");
- fflush(stdout);
-}
-
/* Exported procedure: Allocate zeroed memory */
char *xzalloc(size)
bzero (&global_psymbols, sizeof (global_psymbols));
bzero (&static_psymbols, sizeof (static_psymbols));
- add_com("add-file", class_files, add_file_command,
- "Add a new symbol table (in mips format) from file FILE.");
-
/* Missing basic types */
builtin_type_string = make_type(TYPE_CODE_PASCAL_ARRAY,
1, 0, "string");
type_print_1 (args[i], "", stream, -1, 0);
if (args[i+1] == 0)
fprintf_filtered (stream, "...");
- else if (args[i+1]->code != TYPE_CODE_VOID)
+ else if (args[i+1]->code != TYPE_CODE_VOID) {
fprintf_filtered (stream, ",");
+ wrap_here (" ");
+ }
}
fprintf_filtered (stream, ")");
}
QUIT;
+ wrap_here (" ");
if (type == 0)
{
fprintf_filtered (stream, "type unknown");
{
fputs_filtered (name, stream);
fputs_filtered (" ", stream);
+ wrap_here (" ");
}
if (show < 0)
fprintf_filtered (stream, "{...}");
fputs_filtered (name, stream);
fputs_filtered (" ", stream);
}
+ wrap_here (" ");
if (show < 0)
fprintf_filtered (stream, "{...}");
else
{
QUIT;
if (i) fprintf_filtered (stream, ", ");
+ wrap_here (" ");
fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
if (lastval != TYPE_FIELD_BITPOS (type, i))
{