1991-03-28 16:28:29 +00:00
|
|
|
/* Target-machine dependent code for the NINDY monitor running on the Intel 960
|
|
|
|
Copyright (C) 1991 Free Software Foundation, Inc.
|
|
|
|
Contributed by Intel Corporation.
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
1991-06-04 07:31:55 +00:00
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
1991-03-28 16:28:29 +00:00
|
|
|
|
|
|
|
This program 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
|
1991-06-04 07:31:55 +00:00
|
|
|
along with this program; if not, write to the Free Software
|
1995-08-02 03:41:12 +00:00
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
1991-03-28 16:28:29 +00:00
|
|
|
|
|
|
|
/* Miscellaneous NINDY-dependent routines.
|
|
|
|
Some replace macros normally defined in "tm.h". */
|
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
#include "symtab.h"
|
|
|
|
#include "frame.h"
|
|
|
|
|
|
|
|
/* 'start_frame' is a variable in the NINDY runtime startup routine
|
|
|
|
that contains the frame pointer of the 'start' routine (the routine
|
|
|
|
that calls 'main'). By reading its contents out of remote memory,
|
|
|
|
we can tell where the frame chain ends: backtraces should halt before
|
|
|
|
they display this frame. */
|
|
|
|
|
|
|
|
int
|
|
|
|
nindy_frame_chain_valid (chain, curframe)
|
|
|
|
unsigned int chain;
|
Replace useless FRAME, FRAME_ADDR types with struct frame_info *
and CORE_ADDR, respectively.
* frame.h (FRAME, FRAME_INFO_ID, FRAME_ADDR): Remove.
* blockframe.c (get_frame_info): Remove.
* a29k-tdep.c, alpha-tdep.c, blockframe.c, breakpoint.c,
breakpoint.h, energize.c, findvar.c, gdbtk.c, gould-pinsn.c,
h8300-tdep.c, h8500-tdep.c, hppa-tdep.c, i386-tdep.c, i960-tdep.c,
infcmd.c, inferior.h, infrun.c, m68k-tdep.c, m88k-tdep.c,
mips-tdep.c, nindy-tdep.c, printcmd.c, pyr-tdep.c, rs6000-tdep.c,
sh-tdep.c, sparc-tdep.c, stack.c, valops.c, z8k-tdep.c,
config/a29k/tm-a29k.h, config/alpha/tm-alpha.h,
config/gould/tm-pn.h, config/h8300/tm-h8300.h,
config/h8500/tm-h8500.h, config/mips/tm-mips.h,
config/ns32k/tm-merlin.h, config/ns32k/tm-umax.h,
config/pyr/tm-pyr.h, config/sparc/tm-sparc.h): Replace FRAME with
struct frame_info * everywhere, replace FRAME_ADDR with CORE_ADDR,
rename variables consistently (using `frame' or `fi'), remove
calls to get_frame_info and FRAME_INFO_ID, remove comments about
FRAME and FRAME_ADDR cruftiness.
1994-11-04 01:19:29 +00:00
|
|
|
struct frame_info *curframe;
|
1991-03-28 16:28:29 +00:00
|
|
|
{
|
|
|
|
struct symbol *sym;
|
1992-02-22 01:46:16 +00:00
|
|
|
struct minimal_symbol *msymbol;
|
1991-03-28 16:28:29 +00:00
|
|
|
|
|
|
|
/* crtnindy.o is an assembler module that is assumed to be linked
|
|
|
|
* first in an i80960 executable. It contains the true entry point;
|
|
|
|
* it performs startup up initialization and then calls 'main'.
|
|
|
|
*
|
|
|
|
* 'sf' is the name of a variable in crtnindy.o that is set
|
|
|
|
* during startup to the address of the first frame.
|
|
|
|
*
|
|
|
|
* 'a' is the address of that variable in 80960 memory.
|
|
|
|
*/
|
|
|
|
static char sf[] = "start_frame";
|
|
|
|
CORE_ADDR a;
|
|
|
|
|
|
|
|
|
|
|
|
chain &= ~0x3f; /* Zero low 6 bits because previous frame pointers
|
|
|
|
contain return status info in them. */
|
|
|
|
if ( chain == 0 ){
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
sym = lookup_symbol(sf, 0, VAR_NAMESPACE, (int *)NULL,
|
|
|
|
(struct symtab **)NULL);
|
|
|
|
if ( sym != 0 ){
|
1993-01-14 09:13:41 +00:00
|
|
|
a = SYMBOL_VALUE (sym);
|
1991-03-28 16:28:29 +00:00
|
|
|
} else {
|
* config/sparc/tm-sun4sol2.h, dbxread.c: Rename
N_SO_ADDRESS_MAYBE_MISSING to SOFUN_ADDRESS_MAYBE_MISSING.
* symtab.h (minimal_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]: Add
filename field.
* elfread.c (record_minimal_symbol_and_info),
minsyms.c, symtab.h (prim_record_minimal_symbol_and_info): Return
newly created symbol.
* elfread.c (elf_symtab_read) [SOFUN_ADDRESS_MAYBE_MISSING]:
Set filename field of minimal symbol.
* symmisc.c (dump_msymbols) [SOFUN_ADDRESS_MAYBE_MISSING]:
Print filename field.
* minsyms.c, symtab.h (lookup_minimal_symbol): New arg sfile.
* symm-tdep.c, somsolib.c, hppa-tdep.c, c-exp.y, f-exp.y,
m2-exp.y, nindy-tdep.c, m3-nat.c, irix5-nat.c, hpread.c,
os9kread.c, breakpoint.c, alpha-tdep.c, valops.c, symtab.c,
printcmd.c, dbxread.c: Change callers to pass NULL for sfile.
* dbxread.c (process_one_symbol) [SOFUN_ADDRESS_MAYBE_MISSING]:
Find address of function from minimal symbols.
* partial-stab.h, case 'f', 'F': Call find_stab_function_addr
instead of getting pst->textlow from the stab.
* minsyms.c (find_stab_function_addr): New function.
1995-02-09 07:00:45 +00:00
|
|
|
msymbol = lookup_minimal_symbol (sf, NULL, NULL);
|
1992-02-22 01:46:16 +00:00
|
|
|
if (msymbol == NULL)
|
1991-09-28 02:20:09 +00:00
|
|
|
return 0;
|
* defs.h (HOST_CHAR_BIT): New macro, defaults to either CHAR_BIT
from a configuration file (typically including <limits.h>), or to
TARGET_CHAR_BIT if CHAR_BIT is not defined.
* eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro.
* eval.c (evaluate_subexp): Add case for OP_BITSTRING.
* expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro.
* exppritn.c (print_subexp, dump_expression): Add case for
OP_BITSTRING.
* expression.h (OP_BITSTRING): New expression element type for
packed bitstrings.
* expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New
macros to convert between number of expression elements and bytes
to store that many elements.
* i960-tdep.c (leafproc_return): Use new macros to access
minimal symbol name and address fields.
* m88k-pinsn.c (sprint_address): Use new macros to access
minimal symbol name and address fields.
* nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access
minimal symbol address field.
* parse.c (write_exp_elt, write_exp_string, prefixify_expression,
parse_exp_1): Use new EXP_ELEM_TO_BYTES macro.
* parse.c (write_exp_string, length_of_subexp, prefixify_expression):
Use new BYTES_TO_EXP_ELEM macro.
* parse.c (write_exp_bitstring): New function to write packed
bitstrings into the expression element vector.
* parse.c (length_of_subexp, prefixify_subexp): Add case for
OP_BITSTRING.
* parser-defs.h (struct stoken): Document that it is used for
OP_BITSTRING as well as OP_STRING.
* parser-defs.h (write_exp_bitstring): Add prototype.
**** start-sanitize-chill ****
* ch-exp.y (BIT_STRING_LITERAL): Change token type to sval.
* ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER,
LOWER, LENGTH): New tokens for keywords.
* ch-exp.y (chill_value_built_in_routine_call, mode_argument,
upper_lower_argument, length_argument, array_mode_name,
string_mode_name, variant_structure_mode_name): New non-terminals
and productions.
* ch-exp.y (literal): Useful production for BIT_STRING_LITERAL.
* ch-exp.y (match_bitstring_literal): New lexer support function
to recognize bitstring literals.
* ch-exp.y (tokentab6): New token table for 6 character keywords.
* ch-exp.y (tokentab5): Add LOWER, UPPER.
* ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE.
* ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX.
* ch-exp.y (yylex): Check tokentab6.
* ch-exp.y (yylex): Call match_bitstring_literal.
**** end-sanitize-chill ****
1993-01-06 16:52:10 +00:00
|
|
|
a = SYMBOL_VALUE_ADDRESS (msymbol);
|
1991-03-28 16:28:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ( chain != read_memory_integer(a,4) );
|
|
|
|
}
|