aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-05-03 01:07:12 +0000
committerJohn Gilmore <gnu@cygnus>1991-05-03 01:07:12 +0000
commit8ffd75c8a93075fb4a23bda7ae66e3b579038c6b (patch)
tree49685682ddada743c17ff32ee585d5c03b1054d7 /gdb
parent2bff8e38bcfa1cbc460bd605e6907bc99158a096 (diff)
downloadgdb-8ffd75c8a93075fb4a23bda7ae66e3b579038c6b.zip
gdb-8ffd75c8a93075fb4a23bda7ae66e3b579038c6b.tar.gz
gdb-8ffd75c8a93075fb4a23bda7ae66e3b579038c6b.tar.bz2
Mips bringup and general cleanup
* cplus-dem.c: Move CPLUS_MARKER define to after defs.h. * infptrace.c (PT_WRITE_D, PT_READ_D): Use correct values. (This still doesn't seem to make MIPS bkpts work.) * mipsread.c: Remove dup "Reading symbol data..." msg. (symbol_file_command, add_file_command): Remove, obsol. * printcmd.c (ptype_command): Say "an enum" rather than "a enum". Wrap output appropriately. * stack.c (locals_info, catch_info, args_info): Check selected_frame rather than target_has_stack or coredumping. * valprint.c (type_print_varspec_suffix): Wrap "ptype" output of enums appropriately.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog16
-rw-r--r--gdb/cplus-dem.c14
-rw-r--r--gdb/infptrace.c7
-rw-r--r--gdb/mipsread.c234
-rw-r--r--gdb/valprint.c8
5 files changed, 35 insertions, 244 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ee63935..99dfb24 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,19 @@
+Thu May 2 17:53:56 1991 John Gilmore (gnu at cygint.cygnus.com)
+
+ Mips bringup and general cleanup
+
+ * cplus-dem.c: Move CPLUS_MARKER define to after defs.h.
+ * infptrace.c (PT_WRITE_D, PT_READ_D): Use correct values.
+ (This still doesn't seem to make MIPS bkpts work.)
+ * mipsread.c: Remove dup "Reading symbol data..." msg.
+ (symbol_file_command, add_file_command): Remove, obsol.
+ * printcmd.c (ptype_command): Say "an enum" rather than "a enum".
+ Wrap output appropriately.
+ * stack.c (locals_info, catch_info, args_info): Check
+ selected_frame rather than target_has_stack or coredumping.
+ * valprint.c (type_print_varspec_suffix): Wrap "ptype" output of
+ enums appropriately.
+
Wed May 1 14:10:22 1991 Jim Kingdon (kingdon at cygint.cygnus.com)
* signame.c: Include defs.h and param.h.
diff --git a/gdb/cplus-dem.c b/gdb/cplus-dem.c
index 95c4529..cbb79c4 100644
--- a/gdb/cplus-dem.c
+++ b/gdb/cplus-dem.c
@@ -54,13 +54,6 @@
/* define this if names don't start with _ */
/* #define nounderscore 1 */
-/* This is '$' on systems where the assembler can deal with that.
- Where the assembler can't, it's '.' (but on many systems '.' is
- used for other things). */
-#if !defined (CPLUS_MARKER)
-#define CPLUS_MARKER '$'
-#endif
-
#include <stdio.h>
#include <ctype.h>
@@ -79,6 +72,13 @@
#define strrchr rindex
#endif
+/* This is '$' on systems where the assembler can deal with that.
+ Where the assembler can't, it's '.' (but on many systems '.' is
+ used for other things). */
+#if !defined (CPLUS_MARKER)
+#define CPLUS_MARKER '$'
+#endif
+
#ifndef __STDC__
#define const
#endif
diff --git a/gdb/infptrace.c b/gdb/infptrace.c
index 03bb271..a5b976d 100644
--- a/gdb/infptrace.c
+++ b/gdb/infptrace.c
@@ -32,7 +32,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/dir.h>
#include <signal.h>
#include <sys/ioctl.h>
+#ifndef USG
#include <sys/ptrace.h>
+#endif
+
#if !defined (PT_KILL)
#define PT_KILL 8
#define PT_STEP 9
@@ -40,9 +43,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define PT_READ_U 3
#define PT_WRITE_U 6
#define PT_READ_I 1
+#define PT_READ_D 2
#define PT_WRITE_I 4
-/* The Following Change is for a Sun */
-#define PT_WRITE_D 4
+#define PT_WRITE_D 5
#endif /* No PT_KILL. */
#ifndef PT_ATTACH
diff --git a/gdb/mipsread.c b/gdb/mipsread.c
index 1e1202c..ce7f5ef 100644
--- a/gdb/mipsread.c
+++ b/gdb/mipsread.c
@@ -224,8 +224,6 @@ mipscoff_symfile_read(sf, addr, mainline)
/* 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 ();*/
@@ -248,235 +246,6 @@ mipscoff_symfile_discard()
{
}
-
-#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)
@@ -2868,9 +2637,6 @@ _initialize_mipsread ()
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");
diff --git a/gdb/valprint.c b/gdb/valprint.c
index fc64139..d91bada 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1488,8 +1488,10 @@ type_print_varspec_suffix (type, stream, show, passed_a_ptr)
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, ")");
}
@@ -1549,6 +1551,7 @@ type_print_base (type, stream, show, level)
QUIT;
+ wrap_here (" ");
if (type == 0)
{
fprintf_filtered (stream, "type unknown");
@@ -1583,6 +1586,7 @@ type_print_base (type, stream, show, level)
{
fputs_filtered (name, stream);
fputs_filtered (" ", stream);
+ wrap_here (" ");
}
if (show < 0)
fprintf_filtered (stream, "{...}");
@@ -1714,6 +1718,7 @@ type_print_base (type, stream, show, level)
fputs_filtered (name, stream);
fputs_filtered (" ", stream);
}
+ wrap_here (" ");
if (show < 0)
fprintf_filtered (stream, "{...}");
else
@@ -1725,6 +1730,7 @@ type_print_base (type, stream, show, level)
{
QUIT;
if (i) fprintf_filtered (stream, ", ");
+ wrap_here (" ");
fputs_filtered (TYPE_FIELD_NAME (type, i), stream);
if (lastval != TYPE_FIELD_BITPOS (type, i))
{