Mostly MIPS symbol-reading and general symbol-reading fixups.

This commit is contained in:
John Gilmore 1991-07-21 13:02:48 +00:00
parent eb752e4e4e
commit ef98d5ac06
4 changed files with 154 additions and 135 deletions

View File

@ -24,7 +24,8 @@ Speed up single stepping by not inserting and removing breakpoints
each time the inferior starts and stops.
Speed up watchpoints by not single-stepping them, but do something
faster like single-line execution.
faster like single-line execution. Speed them up tremendously on
machines that have watchpoint registers.
Update gdb.texinfo to include doc on the directory structure and
the various tricks of building gdb.
@ -33,8 +34,6 @@ Do a tutorial in gdb.texinfo on how to do simple things in gdb.
E.g. how to set a breakpoint that just prints something and continues.
How to break on aborts. Etc.
Do a "new features" section for release 4.
Provide "voodoo" debugging of core files. This creates a zombie
process as a child of the debugger, and loads it up with the data,
stack, and regs of the core file. This allows you to call functions
@ -156,8 +155,6 @@ help completion, help history should work.
Symbol completion doesn't handle e.g. W::f. (symtab.c,
make_symbol_completion_list).
AMD version: ^C should do ^Ak to stop ebmon.
Check that we can handle stack trace through varargs AND alloca in same
function, on 29K.
@ -253,8 +250,6 @@ Breakpoints should not be inserted and deleted all the time. Only the
one(s) there should be removed when we have to step over one. Support
breakpoints that don't have to be removed to step over them.
Stop reading stop_registers!
Generalize and Standardize the RPC interface to a target program,
improve it beyond the "ptrace" interface, and see if it can become a standard
for remote debugging. Is WRS interested in donating their target-end
@ -273,22 +268,13 @@ When quitting with a running program, if a core file was previously
examined, you get "Couldn't read float regs from core file"...if
indeed it can't. generic_mourn_inferior...
...
Check signal argument to remote proceed's and error if set.
Handle floating point registers in core files under BFD. Currently
they are punted.
Sort help and info output.
Re-organize help categories into things that tend to fit on a screen
and hang together.
When trying to print source lines but you can't find the file,
print the file name and line number, and leave it selected anyway
so "i source" will show it.
renote-nindy.c handles interrupts poorly; it error()s out of badly
chosen places, e.g. leaving current_frame zero, which causes core dumps
on the next command.
@ -327,6 +313,34 @@ ptype &malloc ==> "char *(*)()"
call printf ("%x\n", malloc) ==> wierd value, should be same as
call printf ("%x\n", &malloc) ==> correct value
Fix symbol reading in the presence of interrupts. It currently leaves a
cleanup to blow away the entire symbol table when a QUIT occurs.
Fix dbxread.c symbol reading in the presence of interrupts. It currently
leaves a cleanup to blow away the entire symbol table when a QUIT occurs.
Mipsread.c reads include files depth-first, because the dependencies
in the psymtabs are way too inclusive (it seems to me). Figure out what
really depends on what, to avoid recursing 20 or 30 times while reading
real symtabs.
value_add() should be subtracting the lower bound of arrays, if known,
and possibly checking against the upper bound for error reporting.
mipsread.c symbol table allocation and deallocation should be checked.
My suspicion is that it's full of memory leaks.
SunOS should have a target_lookup_symbol() for common'd things allocated
by the shared library linker ld.so.
When listing source lines, check for a preceding \n, to verify that
the file hasn't changed out from under us.
When listing source lines, eat leading whitespace corresponding to the
line-number prefix we print. This avoids long lines wrapping.
mipsread.c needs to check for old symtabs and psymtabs for the same
files, the way it happens for dbxread.c and coffread.c, for VxWorks
incremental symbol table reloading.
When attached to a non-child process, ^C or other signals are not
propagated to the child. Do this in the GDB signal handler, using
target_kill(). AMD version: ^C should do ^Ak to stop ebmon.

View File

@ -105,7 +105,7 @@ static char **typevec = 0;
static int ntypes = 0;
static int typevec_size = 0;
const static struct {
const static struct optable {
const char *in;
const char *out;
} optable[] = {
@ -150,7 +150,7 @@ const static struct {
/* Beware: these aren't '\0' terminated. */
typedef struct {
typedef struct string {
char *b; /* pointer to start of string */
char *p; /* pointer after last character */
char *e; /* pointer after end of allocated space */

View File

@ -242,119 +242,119 @@ frame_find_saved_regs (fi, fsr)
fsr->regs[FP_REGNUM] = fi->frame;
fsr->regs[PC_REGNUM] = fi->frame + 4;
#endif
}
}
static int
pushed_size (prev_words, v)
int prev_words;
struct value *v;
{
switch (TYPE_CODE (VALUE_TYPE (v)))
{
case TYPE_CODE_VOID: /* Void type (values zero length) */
static int
pushed_size (prev_words, v)
int prev_words;
struct value *v;
{
switch (TYPE_CODE (VALUE_TYPE (v)))
{
case TYPE_CODE_VOID: /* Void type (values zero length) */
return 0; /* That was easy! */
return 0; /* That was easy! */
case TYPE_CODE_PTR: /* Pointer type */
case TYPE_CODE_ENUM: /* Enumeration type */
case TYPE_CODE_INT: /* Integer type */
case TYPE_CODE_REF: /* C++ Reference types */
case TYPE_CODE_ARRAY: /* Array type, lower bound zero */
case TYPE_CODE_PTR: /* Pointer type */
case TYPE_CODE_ENUM: /* Enumeration type */
case TYPE_CODE_INT: /* Integer type */
case TYPE_CODE_REF: /* C++ Reference types */
case TYPE_CODE_ARRAY: /* Array type, lower bound zero */
return 1;
return 1;
case TYPE_CODE_FLT: /* Floating type */
case TYPE_CODE_FLT: /* Floating type */
if (TYPE_LENGTH (VALUE_TYPE (v)) == 4)
return 1;
else
/* Assume that it must be a double. */
if (prev_words & 1) /* at an odd-word boundary */
return 3; /* round to 8-byte boundary */
else
return 2;
if (TYPE_LENGTH (VALUE_TYPE (v)) == 4)
return 1;
else
/* Assume that it must be a double. */
if (prev_words & 1) /* at an odd-word boundary */
return 3; /* round to 8-byte boundary */
else
return 2;
case TYPE_CODE_STRUCT: /* C struct or Pascal record */
case TYPE_CODE_UNION: /* C union or Pascal variant part */
case TYPE_CODE_STRUCT: /* C struct or Pascal record */
case TYPE_CODE_UNION: /* C union or Pascal variant part */
return (((TYPE_LENGTH (VALUE_TYPE (v)) + 3) / 4) * 4);
return (((TYPE_LENGTH (VALUE_TYPE (v)) + 3) / 4) * 4);
case TYPE_CODE_FUNC: /* Function type */
case TYPE_CODE_SET: /* Pascal sets */
case TYPE_CODE_RANGE: /* Range (integers within bounds) */
case TYPE_CODE_PASCAL_ARRAY: /* Array with explicit type of index */
case TYPE_CODE_MEMBER: /* Member type */
case TYPE_CODE_METHOD: /* Method type */
/* Don't know how to pass these yet. */
case TYPE_CODE_FUNC: /* Function type */
case TYPE_CODE_SET: /* Pascal sets */
case TYPE_CODE_RANGE: /* Range (integers within bounds) */
case TYPE_CODE_PASCAL_ARRAY: /* Array with explicit type of index */
case TYPE_CODE_MEMBER: /* Member type */
case TYPE_CODE_METHOD: /* Method type */
/* Don't know how to pass these yet. */
case TYPE_CODE_UNDEF: /* Not used; catches errors */
default:
abort ();
}
}
case TYPE_CODE_UNDEF: /* Not used; catches errors */
default:
abort ();
}
}
static void
store_parm_word (address, val)
CORE_ADDR address;
int val;
{
write_memory (address, &val, 4);
}
static void
store_parm_word (address, val)
CORE_ADDR address;
int val;
{
write_memory (address, &val, 4);
}
static int
store_parm (prev_words, left_parm_addr, v)
unsigned int prev_words;
CORE_ADDR left_parm_addr;
struct value *v;
{
CORE_ADDR start = left_parm_addr + (prev_words * 4);
int *val_addr = (int *)VALUE_CONTENTS(v);
static int
store_parm (prev_words, left_parm_addr, v)
unsigned int prev_words;
CORE_ADDR left_parm_addr;
struct value *v;
{
CORE_ADDR start = left_parm_addr + (prev_words * 4);
int *val_addr = (int *)VALUE_CONTENTS(v);
switch (TYPE_CODE (VALUE_TYPE (v)))
{
case TYPE_CODE_VOID: /* Void type (values zero length) */
switch (TYPE_CODE (VALUE_TYPE (v)))
{
case TYPE_CODE_VOID: /* Void type (values zero length) */
return 0;
return 0;
case TYPE_CODE_PTR: /* Pointer type */
case TYPE_CODE_ENUM: /* Enumeration type */
case TYPE_CODE_INT: /* Integer type */
case TYPE_CODE_ARRAY: /* Array type, lower bound zero */
case TYPE_CODE_REF: /* C++ Reference types */
case TYPE_CODE_PTR: /* Pointer type */
case TYPE_CODE_ENUM: /* Enumeration type */
case TYPE_CODE_INT: /* Integer type */
case TYPE_CODE_ARRAY: /* Array type, lower bound zero */
case TYPE_CODE_REF: /* C++ Reference types */
store_parm_word (start, *val_addr);
return 1;
store_parm_word (start, *val_addr);
return 1;
case TYPE_CODE_FLT: /* Floating type */
case TYPE_CODE_FLT: /* Floating type */
if (TYPE_LENGTH (VALUE_TYPE (v)) == 4)
{
store_parm_word (start, *val_addr);
return 1;
}
else
{
store_parm_word (start + ((prev_words & 1) * 4), val_addr[0]);
store_parm_word (start + ((prev_words & 1) * 4) + 4, val_addr[1]);
return 2 + (prev_words & 1);
}
if (TYPE_LENGTH (VALUE_TYPE (v)) == 4)
{
store_parm_word (start, *val_addr);
return 1;
}
else
{
store_parm_word (start + ((prev_words & 1) * 4), val_addr[0]);
store_parm_word (start + ((prev_words & 1) * 4) + 4, val_addr[1]);
return 2 + (prev_words & 1);
}
case TYPE_CODE_STRUCT: /* C struct or Pascal record */
case TYPE_CODE_UNION: /* C union or Pascal variant part */
case TYPE_CODE_STRUCT: /* C struct or Pascal record */
case TYPE_CODE_UNION: /* C union or Pascal variant part */
{
unsigned int words = (((TYPE_LENGTH (VALUE_TYPE (v)) + 3) / 4) * 4);
unsigned int word;
{
unsigned int words = (((TYPE_LENGTH (VALUE_TYPE (v)) + 3) / 4) * 4);
unsigned int word;
for (word = 0; word < words; word++)
store_parm_word (start + (word * 4), val_addr[word]);
return words;
}
for (word = 0; word < words; word++)
store_parm_word (start + (word * 4), val_addr[word]);
return words;
}
default:
abort ();
}
}
default:
abort ();
}
}
/* This routine sets up all of the parameter values needed to make a pseudo
call. The name "push_parameters" is a misnomer on some archs,

View File

@ -118,14 +118,19 @@ DEFUN(tr_reallochook, (ptr, size), PTR ptr AND size_t size)
return hdr;
}
/* We enable tracing if either the environment variable MALLOC_TRACE
is set, or if the variable mallwatch has been patched to an address
that the debugging user wants us to stop on. When patching mallwatch,
don't forget to set a breakpoint on tr_break! */
void
mtrace()
{
char *mallfile;
mallfile = getenv (mallenv);
if (mallfile) {
mallstream = fopen (mallfile, "w");
if (mallfile || mallwatch) {
mallstream = fopen (mallfile? mallfile: "/dev/null", "w");
if (mallstream) {
/* Be sure it doesn't malloc its buffer! */
setbuf (mallstream, mallbuf);