OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [nindy-tdep.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/* Target-machine dependent code for the NINDY monitor running on the Intel 960
2
   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 2000
3
   Free Software Foundation, Inc.
4
   Contributed by Intel Corporation.
5
 
6
   This file is part of GDB.
7
 
8
   This program is free software; you can redistribute it and/or modify
9
   it under the terms of the GNU General Public License as published by
10
   the Free Software Foundation; either version 2 of the License, or
11
   (at your option) any later version.
12
 
13
   This program is distributed in the hope that it will be useful,
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
   GNU General Public License for more details.
17
 
18
   You should have received a copy of the GNU General Public License
19
   along with this program; if not, write to the Free Software
20
   Foundation, Inc., 59 Temple Place - Suite 330,
21
   Boston, MA 02111-1307, USA.  */
22
 
23
/* Miscellaneous NINDY-dependent routines.
24
   Some replace macros normally defined in "tm.h".  */
25
 
26
#include "defs.h"
27
#include "symtab.h"
28
#include "frame.h"
29
#include "gdbcore.h"
30
 
31
/* 'start_frame' is a variable in the NINDY runtime startup routine
32
   that contains the frame pointer of the 'start' routine (the routine
33
   that calls 'main').  By reading its contents out of remote memory,
34
   we can tell where the frame chain ends:  backtraces should halt before
35
   they display this frame.  */
36
 
37
int
38
nindy_frame_chain_valid (CORE_ADDR chain, struct frame_info *curframe)
39
{
40
  struct symbol *sym;
41
  struct minimal_symbol *msymbol;
42
 
43
  /* crtnindy.o is an assembler module that is assumed to be linked
44
   * first in an i80960 executable.  It contains the true entry point;
45
   * it performs startup up initialization and then calls 'main'.
46
   *
47
   * 'sf' is the name of a variable in crtnindy.o that is set
48
   *      during startup to the address of the first frame.
49
   *
50
   * 'a' is the address of that variable in 80960 memory.
51
   */
52
  static char sf[] = "start_frame";
53
  CORE_ADDR a;
54
 
55
 
56
  chain &= ~0x3f;               /* Zero low 6 bits because previous frame pointers
57
                                   contain return status info in them.  */
58
  if (chain == 0)
59
    {
60
      return 0;
61
    }
62
 
63
  sym = lookup_symbol (sf, 0, VAR_NAMESPACE, (int *) NULL,
64
                       (struct symtab **) NULL);
65
  if (sym != 0)
66
    {
67
      a = SYMBOL_VALUE (sym);
68
    }
69
  else
70
    {
71
      msymbol = lookup_minimal_symbol (sf, NULL, NULL);
72
      if (msymbol == NULL)
73
        return 0;
74
      a = SYMBOL_VALUE_ADDRESS (msymbol);
75
    }
76
 
77
  return (chain != read_memory_integer (a, 4));
78
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.