This commit is contained in:
gdb-3.4 1989-11-05 21:02:37 +00:00 committed by Pedro Alves
parent 4187119d59
commit 1c997a4ae8
38 changed files with 1819 additions and 620 deletions

View File

@ -1,5 +1,129 @@
Sun Nov 5 11:39:01 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* version.c: Change version to 3.4
* symtab.c (decode_line_1): Only skip past "struct" if it
is there.
* valops.c (value_ind), eval.c (evaluate_subexp, case UNOP_IND):
Have "*" <int-valued-exp> return an int, not a LONGEST.
* utils.c (fprintf_filtered): Pass arg{4,5,6} to sprintf.
* printcmd.c (x_command): Use variable itself rather
than treating it as a pointer only if it is a function.
(See comment "this makes x/i main work").
* coffread.c (symbol_file_command): Use error for
"%s does not have a symbol-table.\n".
Wed Nov 1 19:56:18 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* dbxread.c [BELIEVE_PCC_PROMOTION_TYPE]: New code.
m-sparc.h: Define BELIEVE_PCC_PROMOTION_TYPE.
Thu Oct 26 12:45:00 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* infrun.c: Include <sys/dir.h>.
* dbxread.c (read_dbx_symtab, case N_LSYM, case 'T'):
Check for enum types and put constants in psymtab.
Mon Oct 23 15:02:25 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* dbxread.c (define_symbol, read_dbx_symtab): Handle enum
constants (e.g. "b:c=e6,0").
Thu Oct 19 14:57:26 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* stack.c (frame_info): Use FRAME_ARGS_ADDRESS_CORRECT
m-vax.h (FRAME_ARGS_ADDRESS_CORRECT): New macro.
(FRAME_ARGS_ADDRESS): Restore old meaning.
* frame.h (Frame_unknown): New macro.
stack.c (frame_info): Check for Frame_unknown return from
FRAME_ARGS_ADDRESS.
m-vax.h (FRAME_ARGS_ADDRESS): Sometimes return Frame_unknown.
* utils.c (fatal_dump_core): Add "internal error" to message.
* infrun.c (IN_SIGTRAMP): New macro.
(wait_for_inferior): Use IN_SIGTRAMP.
m-vax.h (IN_SIGTRAMP): New macro.
Wed Oct 18 15:09:22 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* config.gdb, Makefile.dist: Shorten m-i386-sv32.h.
* coffread.c (symbol_file_command): Pass 0 to select_source_symtab.
Tue Oct 17 12:24:41 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* i386-dep.c (i386_frame_num_args): Take function from m-i386.h
file. Check for pfi null.
m-i386.h (FRAME_NUM_ARGS): Use i386_frame_num_args.
* infrun.c (wait_for_inferior): set stop_func_name to 0
before calling find_pc_partial_function.
Thu Oct 12 01:08:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* breakpoint.c (_initialize_breakpoint): Add "disa".
* Makefile.dist: Add GLOBAL_CFLAGS and pass to readline.
* config.gdb (various): "$machine =" -> "machine =".
Wed Oct 11 11:54:31 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* inflow.c (try_writing_regs): #if 0 out this function.
* main.c (main): Add "-help" option.
* dbxread.c (read_dbx_symtab): Merge code for N_FUN with
N_STSYM, etc.
Mon Oct 9 14:21:55 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* inflow.c (try_writing_regs_command): Don't write past end
of struct user.
* dbxread.c (read_struct_type): #if 0 out code which checks for
bitpos and bitsize 0.
* config.gdb: Accept sequent-i386 (not seq386).
(symmetry): Set depfile and paramfile.
* m-convex.h (IGNORE_SYMBOL): Check for N_MONPT if defined.
Thu Oct 5 10:14:26 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* default-dep.c (read_inferior_memory): Put #if 0'd out comment
within /* */.
Wed Oct 4 18:44:41 1989 Jim Kingdon (kingdon at apple-gunkies.ai.mit.edu)
* config.gdb: Change /dev/null to m-i386.h for various
386 machine "opcodefile" entries.
* config.gdb: Accept seq386 for sequent symmetry.
Mon Oct 2 09:59:50 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* hp300bsd-dep.c: Fix copyright notice.
Sun Oct 1 16:25:30 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* Makefile.dist (DEPFILES): Add isi-dep.c.
* default-dep.c (read_inferior_memory): Move #endif after else.
Sat Sep 30 12:50:16 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* version.c: Change version number to 3.3.xxx.
* GDB 3.3 released.
* version.c: Change version number to 3.3.
* Makefile.dist (READLINE): Add vi_mode.c

View File

@ -40,8 +40,9 @@ CC-LD=${CC}
#define M_CFLAGS
#endif
CFLAGS = -g -I. ${HAVE_VPRINTF_DEFINE} M_CFLAGS
/* CFLAGS = -I. -g -pg ${HAVE_VPRINTF_DEFINE} */
/* CFLAGS for both GDB and readline. */
GLOBAL_CFLAGS = -g M_CFLAGS
CFLAGS = -I. ${HAVE_VPRINTF_DEFINE} ${GLOBAL_CFLAGS}
/* None of the things in CFLAGS will do any harm, and on some systems
(e.g. SunOS4) it is important to use the M_CFLAGS. */
LDFLAGS = $(CFLAGS)
@ -122,7 +123,7 @@ SFILES = blockframe.c breakpoint.c dbxread.c coffread.c command.c core.c \
DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
sparc-dep.c hp9k320-dep.c hp300bsd-dep.c news-dep.c i386-dep.c \
symmetry-dep.c convex-dep.c altos-dep.c
symmetry-dep.c convex-dep.c altos-dep.c isi-dep.c
PINSNS = gld-pinsn.c i386-pinsn.c sparc-pinsn.c vax-pinsn.c m68k-pinsn.c \
ns32k-pinsn.c convex-pinsn.c
@ -135,7 +136,7 @@ OPCODES = m68k-opcode.h pn-opcode.h sparc-opcode.h npl-opcode.h vax-opcode.h \
ns32k-opcode.h convex-opcode.h
MFILES = m-hp9k320.h m-hp300bsd.h m-i386.h m-i386gas.h \
m-i386-sysv3.2.h m-i386gas-sysv3.2.h m-isi.h m-merlin.h \
m-i386-sv32.h m-i386g-sv32.h m-isi.h m-merlin.h \
m-altos.h m-news.h m-newsos3.h m-npl.h m-pn.h \
m-sparc.h m-sun2.h m-sun3.h m-sun2os4.h \
m-sun3os4.h m-sun4os4.h m-umax.h m-vax.h m-symmetry.h m-convex.h
@ -286,7 +287,8 @@ expread.o : expread.tab.c defs.h param.h symtab.h frame.h expression.h
mv expread.tab.o expread.o
readline/libreadline.a : force_update
cd readline ; ${MAKE} "SYSV=${SYSV_DEFINE}" "CC=${CC}" libreadline.a
cd readline ; ${MAKE} "SYSV=${SYSV_DEFINE}" \
"DEBUG_FLAGS=${GLOBAL_CFLAGS}" "CC=${CC}" libreadline.a
force_update :

View File

@ -19,14 +19,17 @@ emacs 18.55 or later.
About languages other than C...
C++ support has been integrated into gdb. GDB should work with Pascal
and FORTRAN programs, but I am not aware of anyone who is working on
getting it to use the syntax of any language other than C or C++.
C++ support has been integrated into gdb. GDB should work with
FORTRAN programs (if you have problem, please send a bug report), but
I am not aware of anyone who is working on getting it to use the
syntax of any language other than C or C++. Pascal programs which use
sets, subranges, file variables, or nested functions will not
currently work.
About -gg format...
Currently GDB version 3.x does *not* support GCC's -gg format. This
is because it is (in theory) has fast enough startup on dbx debugging
is because it (in theory) has fast enough startup on dbx debugging
format object files that -gg format is unnecessary (and hence
undesirable, since it wastes space and processing power in gcc). I
would like to hear people's opinions on the amount of time currently
@ -97,30 +100,31 @@ operating system-dependent). If this is unavoidable, put a hook in
the machine-independent file which calls a (possibly)
machine-dependent macro (for example, the IGNORE_SYMBOL macro can be
used for any symbols which need to be ignored on a specific machine.
Calling IGNORE_SYMBOL in dbxread.c is a lot cleaner than a maze of
#if defined's). The machine-independent code should do whatever "most"
machines want if the macro is not defined in param.h. Using #if defined
can sometimes be OK (e.g. SET_STACK_LIMIT_HUGE) but should usually be
Calling IGNORE_SYMBOL in dbxread.c is a lot cleaner than a maze of #if
defined's). The machine-independent code should do whatever "most"
machines want if the macro is not defined in param.h. Using #if
defined can sometimes be OK (e.g. SET_STACK_LIMIT_HUGE) but should be
conditionalized on a specific feature of an operating system (set in
param.h) rather than something like #if defined(vax) or #if defined(SYSV).
param.h) rather than something like #if defined(vax) or #if
defined(SYSV).
It is better to replace entire routines which may be system-specific,
rather than put in a whole bunch of hooks which are probably not going
to be helpful for any purpose other than your changes. For example,
if you want to modify dbxread.c to deal with DBX debugging symbols
which are in COFF files rather than a.out files, do something
which are in COFF files rather than BSD a.out files, do something
along the lines of a macro GET_NEXT_SYMBOL, which could have
different definitions for COFF and a.out, rather than trying to put
the necessary changes throughout all the code in dbxread.c that
currently assumes a.out format.
currently assumes BSD format.
Please avoid duplicating code. For example, if something needs to be
changed in read_inferior_memory, it is very painful because there is a
copy in every dep.c file. The correct way to do this is to put the
standard ptrace interfaces in a separate file ptrace.c, which is used
by all systems which have ptrace. ptrace.c would deal with variations
between systems the same way any system-independent file would (hooks,
#if defined, etc.).
copy in every dep.c file. The correct way to do this is to put (in
this case) the standard ptrace interfaces in a separate file ptrace.c,
which is used by all systems which have ptrace. ptrace.c would deal
with variations between systems the same way any system-independent
file would (hooks, #if defined, etc.).
About debugging gdb with itself...
@ -128,11 +132,9 @@ You probably want to do a "make TAGS" after you configure your
distribution; this will put the machine dependent routines for your
local machine where they will be accessed first by a M-period .
Also, you want to make sure that gdb is not compiled with shared
libraries on the Sun 4. And you want to make sure that you've
compiled gdb with your local cc or taken appropriate precautions
regarding ansification of include files. See the Makefile for more
information.
Also, make sure that you've compiled gdb with your local cc or taken
appropriate precautions regarding ansification of include files. See
the Makefile for more information.
The "info" command, when executed without a subcommand in a gdb being
debugged by gdb, will pop you back up to the top level gdb. See

814
gdb/TAGS

File diff suppressed because it is too large Load Diff

View File

@ -431,7 +431,15 @@ find_pc_function (pc)
/* Finds the "function" (text symbol) that is smaller than PC
but greatest of all of the potential text symbols. Sets
*NAME and/or *ADDRESS conditionally if that pointer is non-zero.
Returns 0 if it couldn't find anything, 1 if it did. */
Returns 0 if it couldn't find anything, 1 if it did.
Note that there are several possible responses:
* Set *NAME and *ADDRESS to nonzero values and return 0
* Set *NAME and *ADDRESS to zero and return 0
* Don't set *NAME and *ADDRESS and return 1
(I don't know whether it *should* work this way, but I'd rather
document it than risk breaking code
which depends on this behavior). */
int
find_pc_partial_function (pc, name, address)

View File

@ -1297,6 +1297,7 @@ A disabled breakpoint is not forgotten, but has no effect until reenabled.\n\
The \"display\" subcommand applies to auto-displays instead of breakpoints.",
&disablelist, "disable ", 1, &cmdlist);
add_com_alias ("dis", "disable", class_breakpoint, 1);
add_com_alias ("disa", "disable", class_breakpoint, 1);
add_abbrev_cmd ("breakpoints", class_breakpoint, disable_command,
"Disable some breakpoints or auto-display expressions.\n\

View File

@ -747,9 +747,7 @@ symbol_file_command (name)
if (num_symbols == 0)
{
free_all_symtabs ();
printf ("%s does not have a symbol-table.\n", name);
fflush (stdout);
return;
error ("%s does not have a symbol-table.\n", name);
}
printf ("Reading symbol data from %s...", name);
@ -814,7 +812,7 @@ symbol_file_command (name)
/* Make a default for file to list. */
select_source_symtab (symtab_list);
select_source_symtab (0);
symfile = savestring (name, strlen (name));

View File

@ -51,35 +51,40 @@ news)
sun2)
case $os in
os4|sunos4)
$machine=sun2os4
$os=""
machine=sun2os4
os=""
;;
os2|sunos2)
$machine=sun2os2
$os=""
machine=sun2os2
os=""
;;
esac
;;
sun3)
case $os in
os4|sunos4)
$machine=sun3os4
$os=""
machine=sun3os4
os=""
;;
os3|sunos3)
$machine=sun3os3
$os=""
machine=sun3os3
os=""
;;
esac
;;
sparc|sun4)
case $os in
os4|sunos4)
$machine=sun4os4
$os=""
machine=sun4os4
os=""
;;
esac
;;
# GCC accepts sequent-i386 or symmetry, so be consistent.
sequent-i386)
machine=symmetry
os=""
;;
esac
paramfile=m-${machine}${os}.h
@ -117,7 +122,10 @@ altosgas)
;;
vax)
echo
echo "/bin/cc has been known to fail on readline.c on VAXen running BSD4.3"
# The following types of /bin/cc failures have been observed:
# 1. Something in readline.c which I have never seen
# 2. ``"values.c", line 816: compiler error: schain botch''
echo "/bin/cc has been known to fail on VAXen running BSD4.3"
echo "If this occurs, use gcc "
echo " (but see comments in Makefile.dist about compiling with gcc)."
echo
@ -166,13 +174,17 @@ i386gas)
# of this file about unneeded files.
opcodefile=m-i386.h
;;
i386-sysv3.2)
# These names are short and cryptic due to the @#$#!@#$@! System V
# 14 character file name limit.
i386-sv32)
makedefine="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
pinsnfile=i386-pinsn.c
depfile=i386-dep.c
opcodefile=/dev/null
# The following is a lie, but a necessary one. See comment at beginning
# of this file about unneeded files.
opcodefile=m-i386.h
;;
i386gas-sysv3.2)
i386g-sv32)
makedefine="-DM_CLIBS=-lPW -DM_SYSV -DM_REGEX=regex.o"
echo
echo "Use of the coff encapsulation features requires the GNU binary utilities"
@ -180,7 +192,9 @@ i386gas-sysv3.2)
echo
pinsnfile=i386-pinsn.c
depfile=i386-dep.c
opcodefile=/dev/null
# The following is a lie, but a necessary one. See comment at beginning
# of this file about unneeded files.
opcodefile=m-i386.h
;;
merlin)
pinsnfile=ns32k-pinsn.c
@ -256,9 +270,12 @@ sun4os4|sun4-os4)
depfile=sparc-dep.c
;;
symmetry)
paramfile=m-symmetry.h
depfile=symmetry-dep.c
pinsnfile=i386-pinsn.c
# Need *some* opcode file to keep make from trying to make opcode.h
opcodefile=/dev/null
# The following is a lie, but a necessary one. See comment at beginning
# of this file about unneeded files.
opcodefile=m-i386.h
;;
umax)
pinsnfile=ns32k-pinsn.c

View File

@ -107,19 +107,19 @@ CORE_ADDR text_end;
CORE_ADDR exec_data_start;
CORE_ADDR exec_data_end;
/* Address in executable file of start of text area data. */
/* Offset within executable file of start of text area data. */
int text_offset;
/* Address in executable file of start of data area data. */
/* Offset within executable file of start of data area data. */
int exec_data_offset;
/* Address in core file of start of data area data. */
/* Offset within core file of start of data area data. */
int data_offset;
/* Address in core file of start of stack area data. */
/* Offset within core file of start of stack area data. */
int stack_offset;

View File

@ -1936,6 +1936,8 @@ read_dbx_symtab (desc, stringtab, stringtab_size, nlistlen, inclink,
profile_types[i] = 0;
#endif
stringtab_global = stringtab;
pst = (struct partial_symtab *) 0;
includes_allocated = 30;
@ -2270,9 +2272,7 @@ read_dbx_symtab (desc, stringtab, stringtab_size, nlistlen, inclink,
p = (char *) index (namestring, ':');
/* Skip if there is no : or if the thing following the : is
not a letter (which indicates declaration of a local
variable, which we aren't interested in). */
/* Skip if there is no :. */
if (!p) continue;
switch (p[1])
@ -2281,11 +2281,75 @@ read_dbx_symtab (desc, stringtab, stringtab_size, nlistlen, inclink,
ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
STRUCT_NAMESPACE, LOC_TYPEDEF,
static_psymbols, bufp->n_value);
continue;
goto check_enum;
case 't':
ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
VAR_NAMESPACE, LOC_TYPEDEF,
static_psymbols, bufp->n_value);
check_enum:
/* If this is an enumerated type, we need to
add all the enum constants to the partial symbol
table. This does not cover enums without names, e.g.
"enum {a, b} c;" in C, but fortunately those are
rare. There is no way for GDB to find those from the
enum type without spending too much time on it. Thus
to solve this problem, the compiler needs to put out separate
constant symbols ('c' N_LSYMS) for enum constants in
enums without names. */
/* We are looking for something of the form
<name> ":" ("t" | "T") [<number> "="] "e"
{<constant> ":" <value> ","} ";". */
/* Skip over the colon and the 't' or 'T'. */
p += 2;
/* This type may be given a number. Skip over it. */
while ((*p >= '0' && *p <= '9')
|| *p == '=')
p++;
if (*p++ == 'e')
{
/* We have found an enumerated type. */
/* According to comments in read_enum_type
a comma could end it instead of a semicolon.
I don't know where that happens.
Accept either. */
while (*p && *p != ';' && *p != ',')
{
char *q;
/* Check for and handle cretinous dbx symbol name
continuation! */
if (*p == '\\')
p = next_symbol_text ();
/* Point to the character after the name
of the enum constant. */
for (q = p; *q && *q != ':'; q++)
;
/* Note that the value doesn't matter for
enum constants in psymtabs, just in symtabs. */
ADD_PSYMBOL_TO_LIST (p, q - p,
VAR_NAMESPACE, LOC_CONST,
static_psymbols, 0);
/* Point past the name. */
p = q;
/* Skip over the value. */
while (*p && *p != ',')
p++;
/* Advance past the comma. */
if (*p)
p++;
}
}
continue;
case 'c':
/* Constant, e.g. from "const" in Pascal. */
ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
VAR_NAMESPACE, LOC_CONST,
static_psymbols, bufp->n_value);
continue;
default:
#ifdef PROFILE_TYPES
@ -2293,10 +2357,18 @@ read_dbx_symtab (desc, stringtab, stringtab_size, nlistlen, inclink,
printf ("Funny...LSYM with a letter that isn't a type\n");
autovars++;
#endif
/* Skip if the thing following the : is
not a letter (which indicates declaration of a local
variable, which we aren't interested in). */
continue;
}
case N_FUN:
#if 0
/* This special-casing of N_FUN is just wrong; N_FUN
does not mean "function"; it means "text segment".
So N_FUN can go with 'V', etc. as well as 'f' or 'F'. */
SET_NAMESTRING();
p = (char *) index (namestring, ':');
@ -2314,7 +2386,7 @@ read_dbx_symtab (desc, stringtab, stringtab_size, nlistlen, inclink,
static_psymbols, bufp->n_value);
continue;
#endif /* 0 */
case N_GSYM: /* Global (extern) variable; can be
data or bss (sigh). */
case N_STSYM: /* Data seg var -- static */
@ -2369,17 +2441,36 @@ read_dbx_symtab (desc, stringtab, stringtab_size, nlistlen, inclink,
global_psymbols, bufp->n_value);
continue;
/* I don't think the default case should happen. A breakpoint
here to check would probably be good. */
default:
case 'f':
ADD_PSYMBOL_TO_LIST (namestring, p - namestring,
VAR_NAMESPACE, LOC_BLOCK,
static_psymbols, bufp->n_value);
continue;
/* Two things show up here (hopefully); static symbols of
local scope (static used inside braces) or extensions
of structure symbols. We can ignore both. */
if (p[1] != 'V' && p[1] != '('
&& (p[1] < '0' || p[1] > '9'))
fatal ("Internal error: Unexpected debugging symbol type '%c' at symnum %d.\n",
p[1], symnum);
case 'V':
case '(':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
/* Global functions are ignored here. I'm not
sure what psymtab they go into (or just the misc
function vector). */
case 'F':
continue;
default:
fatal ("Internal error: Unexpected debugging symbol type '%c' at symnum %d.\n",
p[1], symnum);
}
#ifdef N_BINCL
@ -3656,6 +3747,32 @@ add_file_command (arg_string)
printf ("done.\n");
fflush (stdout);
}
/* Read a number by which a type is referred to in dbx data,
or perhaps read a pair (FILENUM, TYPENUM) in parentheses.
Just a single number N is equivalent to (0,N).
Return the two numbers by storing them in the vector TYPENUMS.
TYPENUMS will then be used as an argument to dbx_lookup_type. */
static void
read_type_number (pp, typenums)
register char **pp;
register int *typenums;
{
if (**pp == '(')
{
(*pp)++;
typenums[0] = read_number (pp, ',');
typenums[1] = read_number (pp, ')');
}
else
{
typenums[0] = 0;
typenums[1] = read_number (pp, 0);
}
}
static struct symbol *
define_symbol (value, string, desc)
@ -3696,7 +3813,10 @@ define_symbol (value, string, desc)
/* c is a special case, not followed by a type-number.
SYMBOL:c=iVALUE for an integer constant symbol.
SYMBOL:c=rVALUE for a floating constant symbol. */
SYMBOL:c=rVALUE for a floating constant symbol.
SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol.
e.g. "b:c=e6,0" for "const b = blob1"
(where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
if (deftype == 'c')
{
if (*p++ != '=')
@ -3722,6 +3842,22 @@ define_symbol (value, string, desc)
SYMBOL_CLASS (sym) = LOC_CONST;
}
break;
case 'e':
/* SYMBOL:c=eTYPE,INTVALUE for an enum constant symbol.
e.g. "b:c=e6,0" for "const b = blob1"
(where type 6 is defined by "blobs:t6=eblob1:0,blob2:1,;"). */
{
int typenums[2];
read_type_number (&p, typenums);
if (*p++ != ',')
error ("Invalid symbol data: no comma in enum const symbol");
SYMBOL_TYPE (sym) = *dbx_lookup_type (typenums);
SYMBOL_VALUE (sym) = atoi (p);
SYMBOL_CLASS (sym) = LOC_CONST;
}
break;
default:
error ("Invalid symbol data at symtab pos %d.", symnum);
}
@ -3796,9 +3932,40 @@ define_symbol (value, string, desc)
SYMBOL_VALUE (sym) = value;
SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
add_symbol_to_list (sym, &local_symbols);
/* If it's compiled, if it says `short', believe it. */
if (processing_gcc_compilation || BELIEVE_PCC_PROMOTION)
break;
#if defined(BELIEVE_PCC_PROMOTION_TYPE)
/* This macro is defined on machines (e.g. sparc) where
we should believe the type of a PCC 'short' argument,
but shouldn't believe the address (the address is
the address of the corresponding int). Note that
this is only different from the BELIEVE_PCC_PROMOTION
case on big-endian machines.
My guess is that this correction, as opposed to changing
the parameter to an 'int' (as done below, for PCC
on most machines), is the right thing to do
on all machines, but I don't want to risk breaking
something that already works. On most PCC machines,
the sparc problem doesn't come up because the calling
function has to zero the top bytes (not knowing whether
the called function wants an int or a short), so there
is no practical difference between an int and a short
(except perhaps what happens when the GDB user types
"print short_arg = 0x10000;"). */
if (SYMBOL_TYPE (sym) == builtin_type_char
|| SYMBOL_TYPE (sym) == builtin_type_unsigned_char)
SYMBOL_VALUE (sym) += 3;
if (SYMBOL_TYPE (sym) == builtin_type_short
|| SYMBOL_TYPE (sym) == builtin_type_unsigned_short)
SYMBOL_VALUE (sym) += 2;
break;
#else /* no BELIEVE_PCC_PROMOTION_TYPE. */
/* If PCC says a parameter is a short or a char,
it is really an int. */
if (SYMBOL_TYPE (sym) == builtin_type_char
@ -3809,6 +3976,8 @@ define_symbol (value, string, desc)
SYMBOL_TYPE (sym) = builtin_type_unsigned_int;
break;
#endif /* no BELIEVE_PCC_PROMOTION_TYPE. */
case 'P':
SYMBOL_CLASS (sym) = LOC_REGPARM;
SYMBOL_VALUE (sym) = STAB_REG_TO_REGNUM (value);
@ -3960,30 +4129,6 @@ cleanup_undefined_types ()
/* Read a number by which a type is referred to in dbx data,
or perhaps read a pair (FILENUM, TYPENUM) in parentheses.
Just a single number N is equivalent to (0,N).
Return the two numbers by storing them in the vector TYPENUMS.
TYPENUMS will then be used as an argument to dbx_lookup_type. */
static void
read_type_number (pp, typenums)
register char **pp;
register int *typenums;
{
if (**pp == '(')
{
(*pp)++;
typenums[0] = read_number (pp, ',');
typenums[1] = read_number (pp, ')');
}
else
{
typenums[0] = 0;
typenums[1] = read_number (pp, 0);
}
}
/* Read a dbx type reference or definition;
return the type that is meant.
This can be just a number, in which case it references
@ -4508,6 +4653,16 @@ read_struct_type (pp, type)
list->field.bitpos = read_number (pp, ',');
list->field.bitsize = read_number (pp, ';');
#if 0
/* This is wrong because this is identical to the symbols
produced for GCC 0-size arrays. For example:
typedef union {
int num;
char str[0];
} foo;
The code which dumped core in such circumstances should be
fixed not to dump core. */
/* g++ -g0 can put out bitpos & bitsize zero for a static
field. This does not give us any way of getting its
class, so we can't know its name. But we can just
@ -4536,6 +4691,7 @@ Therefore GDB will not know about your class variables.\n\
list = list->next;
}
else
#endif /* 0 */
{
/* Detect an unpacked field and mark it as such.
dbx gives a bit size for all fields.

View File

@ -189,16 +189,16 @@ read_inferior_memory (memaddr, myaddr, len)
{
errno = 0;
#if 0
This is now done by read_memory, because when this function did it,
reading a byte or short int hardware port read whole longs, causing
serious side effects
such as bus errors and unexpected hardware operation. This would
also be a problem with ptrace if the inferior process could read
or write hardware registers, but that's not usually the case.
/* This is now done by read_memory, because when this function did it,
reading a byte or short int hardware port read whole longs, causing
serious side effects
such as bus errors and unexpected hardware operation. This would
also be a problem with ptrace if the inferior process could read
or write hardware registers, but that's not usually the case. */
if (remote_debugging)
buffer[i] = remote_fetch_word (addr);
#endif
else
#endif
buffer[i] = ptrace (1, inferior_pid, addr, 0);
if (errno)
return errno;
@ -413,6 +413,11 @@ core_file_command (filename, from_tty)
perror_with_name ("Not a core file: reading upage");
if (val != sizeof u)
error ("Not a core file: could only read %d bytes", val);
/* We are depending on exec_file_command having been called
previously to set exec_data_start. Since the executable
and the core file share the same text segment, the address
of the data segment will be the same in both. */
data_start = exec_data_start;
data_end = data_start + NBPG * u.u_dsize;

View File

@ -739,7 +739,7 @@ evaluate_subexp (expect_type, exp, pos, noside)
lval_memory);
else if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_INT)
/* GDB allows dereferencing an int. */
return value_zero (BUILTIN_TYPE_LONGEST, lval_memory);
return value_zero (builtin_type_int, lval_memory);
else
error ("Attempt to take contents of a non-pointer value.");
}

View File

@ -111,3 +111,5 @@ extern struct symbol *get_pc_function ();
/* In stack.c */
extern FRAME find_relative_frame ();
/* Generic pointer value indicating "I don't know." */
#define Frame_unknown (CORE_ADDR)-1

View File

@ -40,9 +40,9 @@ original English.
@sp 1
@center The GNU Source-Level Debugger
@sp 4
@center Third Edition, GDB version 3.2
@center Third Edition, GDB version 3.4
@sp 1
@center April 1989
@center October 1989
@sp 5
@center Richard M. Stallman
@page
@ -669,6 +669,9 @@ correct, but there's no sense in pushing your luck.
GDB no longer supports the debugging information produced by giving the
GNU C compiler the @samp{-gg} option, so do not use this option.
@ignore
@comment As far as I know, there are no cases in which GDB will
@comment produce strange output in this case. (but no promises).
If your program includes archives made with the @code{ar} program, and
if the object files used as input to @code{ar} were compiled without the
@samp{-g} option and have names longer than 15 characters, GDB will get
@ -680,6 +683,7 @@ names longer than 15 characters.
To avoid this problem, compile the archive members with the @samp{-g}
option or use shorter file names. Alternatively, use a version of GNU
@code{ar} dated more recently than August 1989.
@end ignore
@node Running, Stopping, Compilation, Top
@chapter Running Your Program Under GDB
@ -3341,13 +3345,19 @@ to correspond properly to the code.
@node Remote, Commands, Emacs, Top
@chapter Remote Kernel Debugging
GDB has a special facility for debugging a remote machine via a serial
connection. This can be used for kernel debugging.
If you are trying to debug a program running on a machine that can't run
GDB in the usual way, it is often useful to use remote debugging. For
example, you might be debugging an operating system kernel, or debugging
a small system which does not have a general purpose operating system
powerful enough to run a full-featured debugger. Currently GDB supports
remote debugging over a serial connection.
The program to be debugged on the remote machine needs to contain a
debugging device driver which talks to GDB over the serial line using the
protocol described below. The same version of GDB that is used ordinarily
can be used for this.
can be used for this. Several sample remote debugging drivers are
distributed with GDB; see the @file{README} file in the GDB distribution for
more information.
@menu
* Remote Commands:: Commands used to start and finish remote debugging.

View File

@ -1,6 +1,21 @@
In other words, go ahead and share GDB, but don't try to stop
anyone else from sharing it farther. Help stamp out software hoarding!
*/
/* Machine-dependent code for a Hewlett-Packard 9000/300, running bsd.
Copyright (C) 1986, 1987, 1989 Free Software Foundation, Inc.
This file is part of GDB.
GDB is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
GDB is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "defs.h"
#include "param.h"

View File

@ -767,6 +767,65 @@ i386_get_frame_setup (pc)
return (-1);
}
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
/* on the 386, the instruction following the call could be:
* popl %ecx - one arg
* addl $imm, %esp - imm/4 args; imm may be 8 or 32 bits
* anything else - zero args
*/
int
i386_frame_num_args (fi)
struct frame_info fi;
{
int retpc;
unsigned char op;
struct frame_info *pfi;
pfi = get_prev_frame_info ((fi));
if (pfi == 0)
{
/* Note: this can happen if we are looking at the frame for
main, because FRAME_CHAIN_VALID won't let us go into
start. If we have debugging symbols, that's not really
a big deal; it just means it will only show as many arguments
to main as are declared. */
return -1;
}
else
{
retpc = pfi->pc;
op = read_memory_integer (retpc, 1);
if (op == 0x59)
/* pop %ecx */
return 1;
else if (op == 0x83)
{
op = read_memory_integer (retpc+1, 1);
if (op == 0xc4)
/* addl $<signed imm 8 bits>, %esp */
return (read_memory_integer (retpc+2,1)&0xff)/4;
else
return 0;
}
else if (op == 0x81)
{ /* add with 32 bit immediate */
op = read_memory_integer (retpc+1, 1);
if (op == 0xc4)
/* addl $<imm 32>, %esp */
return read_memory_integer (retpc+2, 4) / 4;
else
return 0;
}
else
{
return 0;
}
}
}
/*
* parse the first few instructions of the function to see
* what registers were stored.

View File

@ -470,6 +470,11 @@ inferior_died ()
set_current_frame (0);
}
#if 0
/* This function is just for testing, and on some systems (Sony NewsOS
3.2) <sys/user.h> also includes <sys/time.h> which leads to errors
(since on this system at least sys/time.h is not protected against
multiple inclusion). */
static void
try_writing_regs_command ()
{
@ -480,7 +485,12 @@ try_writing_regs_command ()
if (inferior_pid == 0)
error ("There is no inferior process now.");
for (i = 0; ; i += 2)
/* A Sun 3/50 or 3/60 (at least) running SunOS 4.0.3 will have a
kernel panic if we try to write past the end of the user area.
Presumably Sun will fix this bug (it has been reported), but it
is tacky to crash the system, so at least on SunOS4 we need to
stop writing when we hit the end of the user area. */
for (i = 0; i < sizeof (struct user); i += 2)
{
QUIT;
errno = 0;
@ -495,6 +505,7 @@ try_writing_regs_command ()
printf (" Failed at 0x%x.\n", i);
}
}
#endif
void
_initialize_inflow ()
@ -502,9 +513,11 @@ _initialize_inflow ()
add_com ("term-status", class_obscure, term_status_command,
"Print info on inferior's saved terminal status.");
#if 0
add_com ("try-writing-regs", class_obscure, try_writing_regs_command,
"Try writing all locations in inferior's system block.\n\
Report which ones can be written.");
#endif
add_com ("kill", class_run, kill_command,
"Kill execution of program being debugged.");

View File

@ -139,9 +139,34 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <sys/ptrace.h>
#endif /* UMAX_PTRACE */
/* Required by <sys/user.h>. */
#include <sys/types.h>
/* Required by <sys/user.h>, at least on system V. */
#include <sys/dir.h>
/* Needed by IN_SIGTRAMP on some machines (e.g. vax). */
#include <sys/param.h>
/* Needed by IN_SIGTRAMP on some machines (e.g. vax). */
#include <sys/user.h>
extern char *sys_siglist[];
extern int errno;
/* Sigtramp is a routine that the kernel calls (which then calls the
signal handler). On most machines it is a library routine that
is linked into the executable.
This macro, given a program counter value and the name of the
function in which that PC resides (which can be null if the
name is not known), returns nonzero if the PC and name show
that we are in sigtramp.
On most machines just see if the name is sigtramp (and if we have
no name, assume we are not in sigtramp). */
#if !defined (IN_SIGTRAMP)
#define IN_SIGTRAMP(pc, name) \
name && !strcmp ("_sigtramp", name)
#endif
/* Tables of how to react to signals; the user sets them. */
static char signal_stop[NSIG];
@ -534,8 +559,9 @@ wait_for_inferior ()
stop_frame_address = FRAME_FP (get_current_frame ());
stop_sp = read_register (SP_REGNUM);
stop_func_start = 0;
/* Don't care about return value; stop_func_start will be 0
if it doesn't work. */
stop_func_name = 0;
/* Don't care about return value; stop_func_start and stop_func_name
will both be 0 if it doesn't work. */
(void) find_pc_partial_function (stop_pc, &stop_func_name,
&stop_func_start);
stop_func_start += FUNCTION_START_OFFSET;
@ -813,8 +839,8 @@ wait_for_inferior ()
}
/* Did we just take a signal? */
if (stop_func_name && !strcmp ("_sigtramp", stop_func_name)
&& (!prev_func_name || strcmp ("_sigtramp", prev_func_name)))
if (IN_SIGTRAMP (stop_pc, stop_func_name)
&& !IN_SIGTRAMP (prev_pc, prev_func_name))
{
/* We've just taken a signal; go until we are back to
the point where we took it and one more. */

624
gdb/isi-dep.c Normal file
View File

@ -0,0 +1,624 @@
/* Low level interface to ptrace, for GDB when running under Unix.
Copyright (C) 1988 Free Software Foundation, Inc.
GDB is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY. No author or distributor accepts responsibility to anyone
for the consequences of using it or for whether it serves any
particular purpose or works at all, unless he says so in writing.
Refer to the GDB General Public License for full details.
Everyone is granted permission to copy, modify and redistribute GDB,
but only under the conditions described in the GDB General Public
License. A copy of this license is supposed to have been given to you
along with GDB so you can know your rights and responsibilities. It
should be in a file named COPYING. Among other things, the copyright
notice and this notice must be preserved on all copies.
In other words, go ahead and share GDB, but don't try to stop
anyone else from sharing it farther. Help stamp out software hoarding!
*/
#include "defs.h"
#include "param.h"
#include "frame.h"
#include "inferior.h"
#ifdef USG
#include <sys/types.h>
#endif
#include <stdio.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <signal.h>
#include <sys/user.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#ifdef COFF_ENCAPSULATE
#include "a.out.encap.h"
#else
#include <a.out.h>
#endif
#ifndef N_SET_MAGIC
#define N_SET_MAGIC(exec, val) ((exec).a_magic = (val))
#endif
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/ptrace.h>
#ifdef ATTACH_DETACH
static int oldParent;
extern int attach_flag;
#endif /* ATTACH_DETACH */
/*
* Mapping of register numbers to their position in the stack
*/
#include <machine/reg.h>
int rloc[] = {
R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, FP, SP, PS, PC
};
extern int errno;
/* This function simply calls ptrace with the given arguments.
It exists so that all calls to ptrace are isolated in this
machine-dependent file. */
int
call_ptrace (request, pid, arg3, arg4)
int request, pid, arg3, arg4;
{
return ptrace (request, pid, arg3, arg4);
}
#ifdef ATTACH_DETACH
/* Start debugging the process whose number is PID. */
attach (pid)
int pid;
{
errno = 0;
oldParent = ptrace (PT_ATTACH, pid, 0, 0);
if (errno)
perror_with_name ("ptrace");
attach_flag = 1;
return pid;
}
/* Stop debugging the process whose number is PID
and continue it with signal number SIGNAL.
SIGNAL = 0 means just continue it. */
void
detach (signal)
int signal;
{
errno = 0;
ptrace (PT_DETACH, inferior_pid, signal, oldParent);
if (errno)
perror_with_name ("ptrace");
attach_flag = 0;
}
#endif /* ATTACH_DETACH */
kill_inferior ()
{
if (remote_debugging)
return;
if (inferior_pid == 0)
return;
#ifdef ATTACH_DETACH
if (attach_flag) {
/*
* Need to detach so the old parent gets notified of the death.
*/
detach(SIGKILL);
} else {
#endif /* ATTACH_DETACH */
ptrace (PT_KILL, inferior_pid, 0, 0);
wait (0);
#ifdef ATTACH_DETACH
}
#endif /* ATTACH_DETACH */
inferior_died ();
}
/* This is used when GDB is exiting. It gives less chance of error.*/
kill_inferior_fast ()
{
if (remote_debugging)
return;
if (inferior_pid == 0)
return;
#ifdef ATTACH_DETACH
if (attach_flag) {
detach(SIGKILL);
} else {
#endif /* ATTACH_DETACH */
ptrace (PT_KILL, inferior_pid, 0, 0);
wait (0);
#ifdef ATTACH_DETACH
}
#endif /* ATTACH_DETACH */
}
/* Resume execution of the inferior process.
If STEP is nonzero, single-step it.
If SIGNAL is nonzero, give it that signal. */
void
resume (step, signal)
int step;
int signal;
{
errno = 0;
if (remote_debugging)
remote_resume (step, signal);
else
{
ptrace (step ? PT_STEP : PT_CONTINUE, inferior_pid, 1, signal);
if (errno)
perror_with_name ("ptrace");
}
}
void
fetch_inferior_registers ()
{
register int regno;
register unsigned int regaddr;
char buf[MAX_REGISTER_RAW_SIZE];
register int i;
struct user u;
unsigned int offset = (char *) &u.u_ar0 - (char *) &u;
offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR;
for (regno = 0; regno < NUM_REGS; regno++)
{
regaddr = register_addr (regno, offset);
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
{
*(int *) &buf[i] = ptrace (3, inferior_pid, regaddr, 0);
regaddr += sizeof (int);
}
supply_register (regno, buf);
}
}
/* Store our register values back into the inferior.
If REGNO is -1, do this for all registers.
Otherwise, REGNO specifies which register (so we can save time). */
store_inferior_registers (regno)
int regno;
{
register unsigned int regaddr;
char buf[80];
struct user u;
unsigned int offset = (char *) &u.u_ar0 - (char *) &u;
offset = ptrace (3, inferior_pid, offset, 0) - KERNEL_U_ADDR;
if (regno >= 0)
{
regaddr = register_addr (regno, offset);
errno = 0;
ptrace (6, inferior_pid, regaddr, read_register (regno));
if (errno != 0)
{
sprintf (buf, "writing register number %d", regno);
perror_with_name (buf);
}
}
else for (regno = 0; regno < NUM_REGS; regno++)
{
regaddr = register_addr (regno, offset);
errno = 0;
ptrace (6, inferior_pid, regaddr, read_register (regno));
if (errno != 0)
{
sprintf (buf, "writing register number %d", regno);
perror_with_name (buf);
}
}
}
/* Copy LEN bytes from inferior's memory starting at MEMADDR
to debugger memory starting at MYADDR.
On failure (cannot read from inferior, usually because address is out
of bounds) returns the value of errno. */
int
read_inferior_memory (memaddr, myaddr, len)
CORE_ADDR memaddr;
char *myaddr;
int len;
{
register int i;
/* Round starting address down to longword boundary. */
register CORE_ADDR addr = memaddr & - sizeof (int);
/* Round ending address up; get number of longwords that makes. */
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
/* Allocate buffer of that many longwords. */
register int *buffer = (int *) alloca (count * sizeof (int));
extern int errno;
/* Read all the longwords */
for (i = 0; i < count; i++, addr += sizeof (int))
{
errno = 0;
if (remote_debugging)
buffer[i] = remote_fetch_word (addr);
else
buffer[i] = ptrace (1, inferior_pid, addr, 0);
if (errno)
return errno;
}
/* Copy appropriate bytes out of the buffer. */
bcopy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
return 0;
}
/* Copy LEN bytes of data from debugger memory at MYADDR
to inferior's memory at MEMADDR.
On failure (cannot write the inferior)
returns the value of errno. */
int
write_inferior_memory (memaddr, myaddr, len)
CORE_ADDR memaddr;
char *myaddr;
int len;
{
register int i;
/* Round starting address down to longword boundary. */
register CORE_ADDR addr = memaddr & - sizeof (int);
/* Round ending address up; get number of longwords that makes. */
register int count
= (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
/* Allocate buffer of that many longwords. */
register int *buffer = (int *) alloca (count * sizeof (int));
extern int errno;
/* Fill start and end extra bytes of buffer with existing memory data. */
if (remote_debugging)
buffer[0] = remote_fetch_word (addr);
else
buffer[0] = ptrace (1, inferior_pid, addr, 0);
if (count > 1)
{
if (remote_debugging)
buffer[count - 1]
= remote_fetch_word (addr + (count - 1) * sizeof (int));
else
buffer[count - 1]
= ptrace (1, inferior_pid,
addr + (count - 1) * sizeof (int), 0);
}
/* Copy data to be written over corresponding part of buffer */
bcopy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
/* Write the entire buffer. */
for (i = 0; i < count; i++, addr += sizeof (int))
{
errno = 0;
if (remote_debugging)
remote_store_word (addr, buffer[i]);
else
ptrace (4, inferior_pid, addr, buffer[i]);
if (errno)
return errno;
}
return 0;
}
/* Work with core dump and executable files, for GDB.
This code would be in core.c if it weren't machine-dependent. */
/* Recognize COFF format systems because a.out.h defines AOUTHDR. */
#ifdef AOUTHDR
#define COFF_FORMAT
#endif
#ifndef N_TXTADDR
#define N_TXTADDR(hdr) 0
#endif /* no N_TXTADDR */
#ifndef N_DATADDR
#define N_DATADDR(hdr) hdr.a_text
#endif /* no N_DATADDR */
/* Make COFF and non-COFF names for things a little more compatible
to reduce conditionals later. */
#ifdef COFF_FORMAT
#define a_magic magic
#endif
#ifndef COFF_FORMAT
#define AOUTHDR struct exec
#endif
extern char *sys_siglist[];
/* Hook for `exec_file_command' command to call. */
extern void (*exec_file_display_hook) ();
/* File names of core file and executable file. */
extern char *corefile;
extern char *execfile;
/* Descriptors on which core file and executable file are open.
Note that the execchan is closed when an inferior is created
and reopened if the inferior dies or is killed. */
extern int corechan;
extern int execchan;
/* Last modification time of executable file.
Also used in source.c to compare against mtime of a source file. */
extern int exec_mtime;
/* Virtual addresses of bounds of the two areas of memory in the core file. */
extern CORE_ADDR data_start;
extern CORE_ADDR data_end;
extern CORE_ADDR stack_start;
extern CORE_ADDR stack_end;
/* Virtual addresses of bounds of two areas of memory in the exec file.
Note that the data area in the exec file is used only when there is no core file. */
extern CORE_ADDR text_start;
extern CORE_ADDR text_end;
extern CORE_ADDR exec_data_start;
extern CORE_ADDR exec_data_end;
/* Address in executable file of start of text area data. */
extern int text_offset;
/* Address in executable file of start of data area data. */
extern int exec_data_offset;
/* Address in core file of start of data area data. */
extern int data_offset;
/* Address in core file of start of stack area data. */
extern int stack_offset;
#ifdef COFF_FORMAT
/* various coff data structures */
extern FILHDR file_hdr;
extern SCNHDR text_hdr;
extern SCNHDR data_hdr;
#endif /* not COFF_FORMAT */
/* a.out header saved in core file. */
extern AOUTHDR core_aouthdr;
/* a.out header of exec file. */
extern AOUTHDR exec_aouthdr;
extern void validate_files ();
core_file_command (filename, from_tty)
char *filename;
int from_tty;
{
int val;
extern char registers[];
/* Discard all vestiges of any previous core file
and mark data and stack spaces as empty. */
if (corefile)
free (corefile);
corefile = 0;
if (corechan >= 0)
close (corechan);
corechan = -1;
data_start = 0;
data_end = 0;
stack_start = STACK_END_ADDR;
stack_end = STACK_END_ADDR;
/* Now, if a new core file was specified, open it and digest it. */
if (filename)
{
filename = tilde_expand (filename);
make_cleanup (free, filename);
if (have_inferior_p ())
error ("To look at a core file, you must kill the inferior with \"kill\".");
corechan = open (filename, O_RDONLY, 0);
if (corechan < 0)
perror_with_name (filename);
/* 4.2-style (and perhaps also sysV-style) core dump file. */
{
struct user u;
int reg_offset;
val = myread (corechan, &u, sizeof u);
if (val < 0)
perror_with_name (filename);
data_start = exec_data_start;
data_end = data_start + NBPG * u.u_dsize;
stack_start = stack_end - NBPG * u.u_ssize;
data_offset = NBPG * UPAGES;
stack_offset = NBPG * (UPAGES + u.u_dsize);
reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR;
/* I don't know where to find this info.
So, for now, mark it as not available. */
N_SET_MAGIC (core_aouthdr, 0);
/* Read the register values out of the core file and store
them where `read_register' will find them. */
{
register int regno;
for (regno = 0; regno < NUM_REGS; regno++)
{
char buf[MAX_REGISTER_RAW_SIZE];
val = lseek (corechan, register_addr (regno, reg_offset), 0);
if (val < 0)
perror_with_name (filename);
val = myread (corechan, buf, sizeof buf);
if (val < 0)
perror_with_name (filename);
supply_register (regno, buf);
}
}
}
if (filename[0] == '/')
corefile = savestring (filename, strlen (filename));
else
{
corefile = concat (current_directory, "/", filename);
}
set_current_frame ( create_new_frame (read_register (FP_REGNUM),
read_pc ()));
select_frame (get_current_frame (), 0);
validate_files ();
}
else if (from_tty)
printf ("No core file now.\n");
}
exec_file_command (filename, from_tty)
char *filename;
int from_tty;
{
int val;
/* Eliminate all traces of old exec file.
Mark text segment as empty. */
if (execfile)
free (execfile);
execfile = 0;
data_start = 0;
data_end -= exec_data_start;
text_start = 0;
text_end = 0;
exec_data_start = 0;
exec_data_end = 0;
if (execchan >= 0)
close (execchan);
execchan = -1;
/* Now open and digest the file the user requested, if any. */
if (filename)
{
filename = tilde_expand (filename);
make_cleanup (free, filename);
execchan = openp (getenv ("PATH"), 1, filename, O_RDONLY, 0,
&execfile);
if (execchan < 0)
perror_with_name (filename);
#ifdef COFF_FORMAT
{
int aout_hdrsize;
int num_sections;
if (read_file_hdr (execchan, &file_hdr) < 0)
error ("\"%s\": not in executable format.", execfile);
aout_hdrsize = file_hdr.f_opthdr;
num_sections = file_hdr.f_nscns;
if (read_aout_hdr (execchan, &exec_aouthdr, aout_hdrsize) < 0)
error ("\"%s\": can't read optional aouthdr", execfile);
if (read_section_hdr (execchan, _TEXT, &text_hdr, num_sections) < 0)
error ("\"%s\": can't read text section header", execfile);
if (read_section_hdr (execchan, _DATA, &data_hdr, num_sections) < 0)
error ("\"%s\": can't read data section header", execfile);
text_start = exec_aouthdr.text_start;
text_end = text_start + exec_aouthdr.tsize;
text_offset = text_hdr.s_scnptr;
exec_data_start = exec_aouthdr.data_start;
exec_data_end = exec_data_start + exec_aouthdr.dsize;
exec_data_offset = data_hdr.s_scnptr;
data_start = exec_data_start;
data_end += exec_data_start;
exec_mtime = file_hdr.f_timdat;
}
#else /* not COFF_FORMAT */
{
struct stat st_exec;
#ifdef HEADER_SEEK_FD
HEADER_SEEK_FD (execchan);
#endif
val = myread (execchan, &exec_aouthdr, sizeof (AOUTHDR));
if (val < 0)
perror_with_name (filename);
text_start = N_TXTADDR (exec_aouthdr);
exec_data_start = N_DATADDR (exec_aouthdr);
text_offset = N_TXTOFF (exec_aouthdr);
exec_data_offset = N_TXTOFF (exec_aouthdr) + exec_aouthdr.a_text;
text_end = text_start + exec_aouthdr.a_text;
exec_data_end = exec_data_start + exec_aouthdr.a_data;
data_start = exec_data_start;
data_end += exec_data_start;
fstat (execchan, &st_exec);
exec_mtime = st_exec.st_mtime;
}
#endif /* not COFF_FORMAT */
validate_files ();
}
else if (from_tty)
printf ("No exec file now.\n");
/* Tell display code (if any) about the changed file name. */
if (exec_file_display_hook)
(*exec_file_display_hook) (filename);
}

View File

@ -57,8 +57,16 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Symbol types to ignore. */
#if defined (N_MONPT)
#define IGNORE_SYMBOL(TYPE) \
(((TYPE) & ~N_EXT) == N_TBSS || ((TYPE) & ~N_EXT) == N_TDATA)
(((TYPE) & ~N_EXT) == N_TBSS \
|| ((TYPE) & ~N_EXT) == N_TDATA \
|| ((TYPE) & ~N_EXT) == N_MONPT)
#else /* no N_MONPT */
#define IGNORE_SYMBOL(TYPE) \
(((TYPE) & ~N_EXT) == N_TBSS \
|| ((TYPE) & ~N_EXT) == N_TDATA)
#endif /* no N_MONPT */
/* Use SIGCONT rather than SIGTSTP because convex Unix occasionally
turkeys SIGTSTP. I think. */
@ -119,7 +127,7 @@ extern unsigned text_end;
#define SAVED_PC_AFTER_CALL(frame) \
read_memory_integer (read_register (SP_REGNUM), 4)
/* Address of end of stack space.
/* Address of end of stack space.
This is ((USRSTACK + 0xfff) & -0x1000)) from <convex/vmparam.h> but
that expression depends on the kernel version; instead, fetch a
page-zero pointer and get it from that. This will be invalid if
@ -149,7 +157,7 @@ extern unsigned text_end;
#define BREAKPOINT {0x7d,0x50}
/* Amount PC must be decremented by after a breakpoint.
This is often the number of bytes in BREAKPOINT but not always.
This is often the number of bytes in BREAKPOINT but not always.
(The break PC needs to be decremented by 2, but we do it when the
break frame is recognized and popped. That way gdb can tell breaks
from trace traps with certainty.) */
@ -228,7 +236,7 @@ extern unsigned text_end;
#define REGISTER_BYTES (4*10 + 8*8)
/* Index within `registers' of the first byte of the space for
register N.
register N.
NB: must match structure of struct syscall_context for correct operation */
#define REGISTER_BYTE(N) ((N) < s7_REGNUM ? 4*(N) : \
@ -370,7 +378,7 @@ extern struct value *value_of_trapped_internalvar ();
/* A macro that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it
does not, FRAMELESS is set to 1, else 0.
does not, FRAMELESS is set to 1, else 0.
On convex, check at the return address for `callq' -- if so, frameless,
otherwise, not. */

View File

@ -287,34 +287,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
/* on the 386, the instruction following the call could be:
* popl %ecx - one arg
* addl $imm, %esp - imm/4 args; imm may be 8 or 32 bits
* anything else - zero args
*/
#define FRAME_NUM_ARGS(numargs, fi) { \
int retpc; \
unsigned char op; \
struct frame_info *pfi; \
pfi = get_prev_frame_info ((fi)); \
retpc = pfi->pc; \
numargs = 0; \
op = read_memory_integer (retpc, 1); \
if (op == 0x59) \
/* pop %ecx */ \
(numargs) = 1; \
else if (op == 0x83) { \
op = read_memory_integer (retpc+1, 1); \
if (op == 0xc4) \
/* addl $<signed imm 8 bits>, %esp */ \
(numargs) = (read_memory_integer (retpc+2,1)&0xff)/4;\
} else if (op == 0x81) { /* add with 32 bit immediate */\
op = read_memory_integer (retpc+1, 1); \
if (op == 0xc4) \
/* addl $<imm 32>, %esp */ \
(numargs) = read_memory_integer (retpc+2, 4) / 4;\
} \
}
#define FRAME_NUM_ARGS(numargs, fi) (numargs) = i386_frame_num_args(fi)
/* Return number of bytes at start of arglist that are not really args. */

View File

@ -52,6 +52,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
argument is in the upper half of the word reserved on the stack,
but puts it in the lower half. */
/* #define BELIEVE_PCC_PROMOTION 1 */
/* OK, I've added code to dbxread.c to deal with this case. */
#define BELIEVE_PCC_PROMOTION_TYPE
/* Offset from address of function to start of its code.
Zero on most machines. */

View File

@ -101,6 +101,18 @@ fix to bug-gdb@prep.ai.mit.edu. */
#define KERNEL_U_ADDR (0x80000000 - (UPAGES * NBPG))
/* Same as offsetof macro from stddef.h (which 4.3BSD doesn't have). */
#define my_offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
/* On the VAX, sigtramp is in the u area. Note that this definition
includes both the subroutine at u_pcb.pcb_sigc[3], and the
routine at u_pcb.pcb_sigc[0] (which does a calls to u_pcb.pcb_sigc[3]).
I think this is what we want. */
#define IN_SIGTRAMP(pc, name) \
((pc) >= KERNEL_U_ADDR + my_offsetof (struct user, u_pcb.pcb_sigc[0]) \
&& (pc) < KERNEL_U_ADDR + my_offsetof (struct user, u_pcb.pcb_sigc[5]) \
)
/* Address of end of stack space. */
#define STACK_END_ADDR (0x80000000 - (UPAGES * NBPG))
@ -285,13 +297,27 @@ fix to bug-gdb@prep.ai.mit.edu. */
#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 16, 4))
/* Cannot find the AP register value directly from the FP value.
Must find it saved in the frame called by this one, or in the AP register
for the innermost frame. */
/* Cannot find the AP register value directly from the FP value. Must
find it saved in the frame called by this one, or in the AP
register for the innermost frame. However, there is no way to tell
the difference between the innermost frame and a frame for which we
just don't know the frame that it called (e.g. "info frame
0x7ffec789"). For the sake of argument suppose that the stack is
somewhat trashed (which is one reason that "info frame" exists).
So return Frame_unknown (indicating we don't know the address of
the arglist) if we don't know what frame this frame calls. */
#define FRAME_ARGS_ADDRESS_CORRECT(fi) \
(((fi)->next_frame \
? read_memory_integer ((fi)->next_frame + 8, 4) \
: /* read_register (AP_REGNUM) */ Frame_unknown))
/* In most of GDB, getting the args address is too important to
just say "I don't know". This is sometimes wrong, but c'est
la vie. */
#define FRAME_ARGS_ADDRESS(fi) \
(((fi)->next_frame \
? read_memory_integer ((fi)->next_frame + 8, 4) \
: read_register (AP_REGNUM)))
: read_register (AP_REGNUM) /* Frame_unknown */))
#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)

View File

@ -773,6 +773,10 @@ print_base (regno, disp, stream)
fprintf_filtered (stream, "%d(%s)", disp, reg_names[regno]);
}
/* Nonzero if the host system has a 68881 (or compatible)
floating-point unit. This does *not* indicate whether the target
system has a co-processor, just whether the host system does.
There might be a difference in the case of remote debugging. */
static int have_fpu = 1;
/* This is not part of insn printing, but it is machine-specific,

View File

@ -347,6 +347,36 @@ main (argc, argv, envp)
/* -t /def/ttyp1: use /dev/ttyp1 for inferior I/O. */
else if (!strcmp (arg, "-t") || !strcmp (arg, "-tty"))
tty_command (argv[i], 0);
/* -help: print a summary of command line switches. */
else if (!strcmp (arg, "-help"))
{
fputs ("\
This is GDB, the GNU debugger. Use the command\n\
gdb [options] [executable [core-file]]\n\
to enter the debugger.\n\
\n\
Options available are:\n\
-help Print this message.\n\
-quiet Do not print version number on startup.\n\
-fullname Output information used by emacs-GDB interface.\n\
-batch Exit after processing options.\n\
-nx Do not read .gdbinit file.\n\
-tty TTY Use TTY for input/output by the program being debugged.\n\
-cd DIR Change current directory to DIR.\n\
-directory DIR Search for source files in DIR.\n\
-command FILE Execute GDB commands from FILE.\n\
-symbols SYMFILE Read symbols from SYMFILE.\n\
-exec EXECFILE Use EXECFILE as the executable.\n\
-se FILE Use FILE as symbol file and executable file.\n\
-core COREFILE Analyze the core dump COREFILE.\n\
\n\
For more information, type \"help\" from within GDB, or consult the\n\
GDB manual (available as on-line info or a printed manual).\n", stderr);
/* Exiting after printing this message seems like
the most useful thing to do. */
exit (0);
}
else
error ("Unknown command-line switch: \"%s\"\n", arg);
}

View File

@ -708,8 +708,10 @@ x_command (exp, from_tty)
*exp = 0;
old_chain = make_cleanup (free_current_contents, &expr);
val = evaluate_expression (expr);
if (last_format == 'i'
&& TYPE_CODE (VALUE_TYPE (val)) != TYPE_CODE_PTR
/* In rvalue contexts, such as this, functions are coerced into
pointers to functions. This makes "x/i main" work. */
if (/* last_format == 'i'
&& */ TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_FUNC
&& VALUE_LVAL (val) == lval_memory)
next_address = VALUE_ADDRESS (val);
else

View File

@ -1,3 +1,18 @@
Thu Oct 19 17:18:40 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* Move vi_doing_insert from vi_mode.c to readline.c
* readline.c: Move compare_strings before its use.
Remove definitions.
* readline.c: Move defining_kbd_macro above rl_dispatch.
(rl_dispatch): Remove "extern int defining_kbd_macro".
Mon Oct 16 11:56:03 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* readline.c (rl_set_signals): Remove unnecessary "static int
rl_signal_handler()".
Sat Sep 30 14:51:56 1989 Jim Kingdon (kingdon at hobbes.ai.mit.edu)
* readline.c (rl_initialize): Change parsing_conditionalized_out

View File

@ -65,7 +65,7 @@ all: libreadline.a
libreadline.a: readline.o history.o funmap.o keymaps.o
$(RM) -f libreadline.a
$(AR) clq libreadline.a readline.o history.o funmap.o keymaps.o
if [ -f $(RANLIB) ]; then $(RANLIB) libreadline.a; fi
# if [ -f $(RANLIB) ]; then $(RANLIB) libreadline.a; fi
readline.o: readline.h chardefs.h keymaps.h history.h readline.c vi_mode.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
@ -111,4 +111,4 @@ clean:
$(DESTDIR)/libreadline.a: libreadline.a
-mv $(DESTDIR)/libreadline.a $(DESTDIR)/libreadline.old
cp libreadline.a $(DESTDIR)/libreadline.a
$(RANLIB) -t $(DESTDIR)/libreadline.a
# $(RANLIB) -t $(DESTDIR)/libreadline.a

View File

@ -34,6 +34,11 @@ static char *xmalloc (), *xrealloc ();
FUNMAP **funmap = (FUNMAP **)NULL;
static int funmap_size = 0;
static int just_testing_ar_tmp = 0;
static int just_testing_ar_tmp_2 = 5;
int foo_testing_ar;
static int funmap_entry = 0;
static FUNMAP default_funmap[] = {

View File

@ -139,6 +139,14 @@ static SigHandler *old_sigwinch = (SigHandler *)NULL;
#endif
#endif
/* Stupid comparison routine for qsort () ing strings. */
static int
compare_strings (s1, s2)
char **s1, **s2;
{
return (strcmp (*s1, *s2));
}
/* **************************************************************** */
/* */
@ -390,6 +398,40 @@ readline_internal ()
return (savestring (the_line));
}
/* Variables for keyboard macros. */
/* The currently executing macro string. If this is non-zero,
then it is a malloc ()'ed string where input is coming from. */
static char *executing_macro = (char *)NULL;
/* The offset in the above string to the next character to be read. */
static int executing_macro_index = 0;
/* Non-zero means to save keys that we dispatch on in a kbd macro. */
static int defining_kbd_macro = 0;
/* The current macro string being built. Characters get stuffed
in here by add_macro_char (). */
static char *current_macro = (char *)NULL;
/* The size of the buffer allocated to current_macro. */
static int current_macro_size = 0;
/* The index at which characters are being added to current_macro. */
static int current_macro_index = 0;
/* A structure used to save nested macro strings.
It is a linked list of string/index for each saved macro. */
struct saved_macro {
struct saved_macro *next;
char *string;
int index;
};
/* The list of saved macros. */
struct saved_macro *macro_list = (struct saved_macro *)NULL;
/* **************************************************************** */
/* */
@ -472,9 +514,8 @@ rl_signal_handler (sig, code, scp)
rl_set_signals ()
{
static int rl_signal_handler ();
old_int = (SigHandler *)signal (SIGINT, rl_signal_handler);
if (old_int == (SigHandler *)SIG_IGN)
signal (SIGINT, SIG_IGN);
@ -685,10 +726,12 @@ rl_dispatch (key, map)
register int key;
Keymap map;
{
static int defining_kbd_macro;
if (defining_kbd_macro)
add_macro_char (key);
{
static add_macro_char ();
add_macro_char (key);
}
if (key > 127 && key < 256)
{
@ -769,43 +812,14 @@ rl_dispatch (key, map)
/* */
/* **************************************************************** */
/* The currently executing macro string. If this is non-zero,
then it is a malloc ()'ed string where input is coming from. */
static char *executing_macro = (char *)NULL;
/* The offset in the above string to the next character to be read. */
static int executing_macro_index = 0;
/* Non-zero means to save keys that we dispatch on in a kbd macro. */
static int defining_kbd_macro = 0;
/* The current macro string being built. Characters get stuffed
in here by add_macro_char (). */
static char *current_macro = (char *)NULL;
/* The size of the buffer allocated to current_macro. */
static int current_macro_size = 0;
/* The index at which characters are being added to current_macro. */
static int current_macro_index = 0;
/* A structure used to save nested macro strings.
It is a linked list of string/index for each saved macro. */
struct saved_macro {
struct saved_macro *next;
char *string;
int index;
};
/* The list of saved macros. */
struct saved_macro *macro_list = (struct saved_macro *)NULL;
/* Set up to read subsequent input from STRING.
STRING is free ()'ed when we are done with it. */
static
with_macro_input (string)
char *string;
{
static push_executing_macro ();
push_executing_macro ();
executing_macro = string;
executing_macro_index = 0;
@ -821,6 +835,8 @@ next_macro_key ()
if (!executing_macro[executing_macro_index])
{
static pop_executing_macro ();
pop_executing_macro ();
return (next_macro_key ());
}
@ -933,6 +949,10 @@ rl_call_last_kbd_macro (count, ignore)
with_macro_input (savestring (current_macro));
}
/* Non-zero means do not parse any lines other than comments and
parser directives. */
static unsigned char parsing_conditionalized_out = 0;
/* **************************************************************** */
/* */
@ -980,7 +1000,6 @@ rl_initialize ()
/* Parsing of key-bindings begins in an enabled state. */
{
static unsigned char parsing_conditionalized_out;
parsing_conditionalized_out = 0;
}
}
@ -2571,6 +2590,11 @@ rl_tab_insert (count)
rl_insert (count, '\t');
}
#ifdef VI_MODE
/* Non-zero means enter insertion mode. */
static vi_doing_insert = 0;
#endif
/* What to do when a NEWLINE is pressed. We accept the whole line.
KEY is the key that invoked this command. I guess it could have
meaning in the future. */
@ -2582,7 +2606,6 @@ rl_newline (count, key)
#ifdef VI_MODE
{
static int vi_doing_insert;
if (vi_doing_insert)
{
rl_end_undo_group ();
@ -3097,7 +3120,7 @@ rl_complete_internal (what_to_do)
if (rl_ignore_completion_duplicates)
{
char *lowest_common;
int compare_strings (), j, newlen = 0;
int j, newlen = 0;
/* Sort the items. */
/* It is safe to sort this array, because the lowest common
@ -3308,7 +3331,6 @@ rl_complete_internal (what_to_do)
/* Sort the items if they are not already sorted. */
if (!rl_ignore_completion_duplicates)
{
int compare_strings ();
qsort (matches, len, sizeof (char *), compare_strings);
}
@ -3362,14 +3384,6 @@ rl_complete_internal (what_to_do)
}
}
/* Stupid comparison routine for qsort () ing strings. */
static int
compare_strings (s1, s2)
char **s1, **s2;
{
return (strcmp (*s1, *s2));
}
/* A completion function for usernames.
TEXT contains a partial username preceded by a random
character (usually `~'). */
@ -4910,6 +4924,7 @@ rl_named_function (string)
char *string;
{
register int i;
static int stricmp ();
for (i = 0; funmap[i]; i++)
if (stricmp (funmap[i]->name, string) == 0)
@ -5006,10 +5021,6 @@ function_exit:
/* Calling programs set this to have their argv[0]. */
char *rl_readline_name = "other";
/* Non-zero means do not parse any lines other than comments and
parser directives. */
static unsigned char parsing_conditionalized_out = 0;
/* Stack of previous values of parsing_conditionalized_out. */
static unsigned char *if_stack = (unsigned char *)NULL;
static int if_stack_depth = 0;
@ -5020,6 +5031,7 @@ parser_if (args)
char *args;
{
register int i;
static int stricmp ();
/* Push parser state. */
if (if_stack_depth + 1 >= if_stack_size)
@ -5090,6 +5102,7 @@ handle_parser_directive (statement)
{
register int i;
char *directive, *args;
static int stricmp ();
/* Isolate the actual directive. */
@ -5128,7 +5141,7 @@ rl_parse_and_bind (string)
{
extern char *possible_control_prefixes[], *possible_meta_prefixes[];
char *rindex (), *funname, *kname;
static int substring_member_of_array ();
static int substring_member_of_array (), stricmp ();
register int c;
int key, i;
@ -5280,7 +5293,7 @@ rl_parse_and_bind (string)
rl_variable_bind (name, value)
char *name, *value;
{
static int strnicmp ();
static int strnicmp (), stricmp ();
if (stricmp (name, "editing-mode") == 0)
{
@ -5335,6 +5348,7 @@ glean_key_from_name (name)
char *name;
{
register int i;
static int stricmp ();
for (i = 0; name_key_alist[i].name; i++)
if (stricmp (name, name_key_alist[i].name) == 0)

View File

@ -13,9 +13,6 @@
static char *vi_last_search = (char *)NULL;
static int vi_histpos;
/* Non-zero means enter insertion mode. */
static vi_doing_insert = 0;
/* *** UNCLEAN *** */
/* Command keys which do movement for xxx_to commands. */
static char *vi_motion = " hl^$0ftFt;,%wbeWBE|";

View File

@ -301,6 +301,16 @@ parse_frame_specification (frame_exp)
/* NOTREACHED */
}
/* FRAME_ARGS_ADDRESS_CORRECT is just like FRAME_ARGS_ADDRESS except
that if it is unsure about the answer, it returns Frame_unknown
instead of guessing (this happens on the VAX, for example).
On most machines, we never have to guess about the args address,
so FRAME_ARGS_ADDRESS{,_CORRECT} are the same. */
#if !defined (FRAME_ARGS_ADDRESS_CORRECT)
#define FRAME_ARGS_ADDRESS_CORRECT FRAME_ARGS_ADDRESS
#endif
/* Print verbosely the selected frame or the frame at address ADDR.
This means absolutely all information in the frame is printed. */
@ -316,7 +326,6 @@ frame_info (addr_exp)
FRAME calling_frame;
int i, count;
char *funname = 0;
int numargs;
if (!(have_inferior_p () || have_core_file_p ()))
error ("No inferior or core file.");
@ -359,20 +368,31 @@ frame_info (addr_exp)
printf (" caller of frame at 0x%x", fi->next_frame);
if (fi->next_frame || calling_frame)
printf ("\n");
printf (" Arglist at 0x%x,", FRAME_ARGS_ADDRESS (fi));
FRAME_NUM_ARGS (i, fi);
if (i < 0)
printf (" args: ");
else if (i == 0)
printf (" no args.");
else if (i == 1)
printf (" 1 arg: ");
else
printf (" %d args: ", i);
FRAME_NUM_ARGS (numargs, fi);
print_frame_args (func, fi, numargs, stdout);
printf ("\n");
{
/* Address of the argument list for this frame, or Frame_unknown. */
CORE_ADDR arg_list = FRAME_ARGS_ADDRESS_CORRECT (fi);
/* Number of args for this frame, or -1 if unknown. */
int numargs;
if (arg_list != Frame_unknown)
{
printf (" Arglist at 0x%x,", arg_list);
FRAME_NUM_ARGS (numargs, fi);
if (numargs < 0)
printf (" args: ");
else if (numargs == 0)
printf (" no args.");
else if (numargs == 1)
printf (" 1 arg: ");
else
printf (" %d args: ", numargs);
print_frame_args (func, fi, numargs, stdout);
printf ("\n");
}
}
/* The sp is special; what's returned isn't the save address, but
actually the value of the previous frame's sp. */
printf (" Previous frame's sp is 0x%x\n", fsr.regs[SP_REGNUM]);

View File

@ -1567,7 +1567,13 @@ decode_line_1 (argptr, funfirstline, default_symtab, default_line)
that depends on knowing the name of D. */
if (class_name)
{
while (*class_name++ != ' ');
/* We just want the class name. In the context
of C++, stripping off "struct " is always
sensible. */
if (strncmp("struct ", class_name, 7) == 0)
class_name += 7;
if (strncmp("union ", class_name, 6) == 0)
class_name += 6;
sym_class = lookup_symbol (class_name, 0, STRUCT_NAMESPACE, 0);
for (method_counter = TYPE_NFN_FIELDS (SYMBOL_TYPE (sym_class)) - 1;

View File

@ -287,7 +287,9 @@ fatal_dump_core (string, arg)
char *string;
int arg;
{
fprintf (stderr, "gdb: ");
/* "internal error" is always correct, since GDB should never dump
core, no matter what the input. */
fprintf (stderr, "gdb internal error: ");
fprintf (stderr, string, arg);
fprintf (stderr, "\n");
signal (SIGQUIT, SIG_DFL);
@ -698,7 +700,7 @@ fprintf_filtered (stream, format, arg1, arg2, arg3, arg4, arg5, arg6)
/* This won't blow up if the restrictions described above are
followed. */
(void) sprintf (linebuffer, format, arg1, arg2, arg3);
(void) sprintf (linebuffer, format, arg1, arg2, arg3, arg4, arg5, arg6);
fputs_filtered (linebuffer, stream);
}

View File

@ -392,9 +392,12 @@ value_ind (arg1)
if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_MEMBER)
error ("not implemented: member types in value_ind");
/* Allow * on an integer so we can cast it to whatever we want. */
/* Allow * on an integer so we can cast it to whatever we want.
This returns an int, which seems like the most C-like thing
to do. "long long" variables are rare enough that
BUILTIN_TYPE_LONGEST would seem to be a mistake. */
if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_INT)
return value_at (BUILTIN_TYPE_LONGEST,
return value_at (builtin_type_int,
(CORE_ADDR) value_as_long (arg1));
else if (TYPE_CODE (VALUE_TYPE (arg1)) == TYPE_CODE_PTR)
return value_at (TYPE_TARGET_TYPE (VALUE_TYPE (arg1)),

View File

@ -17,4 +17,4 @@ You should have received a copy of the GNU General Public License
along with GDB; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
char *version = "3.3";
char *version = "3.4";