binutils-gdb/gdb/nindy-tdep.c

74 lines
2.3 KiB
C
Raw Normal View History

1991-03-28 17:28:29 +01: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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
1991-03-28 17:28:29 +01: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
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
1991-03-28 17:28:29 +01: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;
FRAME curframe;
{
struct symbol *sym;
struct minimal_symbol *msymbol;
1991-03-28 17:28:29 +01: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 10:13:41 +01:00
a = SYMBOL_VALUE (sym);
1991-03-28 17:28:29 +01:00
} else {
msymbol = lookup_minimal_symbol (sf, (struct objfile *) NULL);
if (msymbol == NULL)
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 17:52:10 +01:00
a = SYMBOL_VALUE_ADDRESS (msymbol);
1991-03-28 17:28:29 +01:00
}
return ( chain != read_memory_integer(a,4) );
}