1 |
578 |
markom |
/* Definitions to make GDB run on an Alpha box under Linux. The
|
2 |
|
|
definitions here are used when the _target_ system is running Linux.
|
3 |
|
|
Copyright 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
|
4 |
|
|
|
5 |
|
|
This file is part of GDB.
|
6 |
|
|
|
7 |
|
|
This program is free software; you can redistribute it and/or modify
|
8 |
|
|
it under the terms of the GNU General Public License as published by
|
9 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
10 |
|
|
(at your option) any later version.
|
11 |
|
|
|
12 |
|
|
This program is distributed in the hope that it will be useful,
|
13 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
|
GNU General Public License for more details.
|
16 |
|
|
|
17 |
|
|
You should have received a copy of the GNU General Public License
|
18 |
|
|
along with this program; if not, write to the Free Software
|
19 |
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
20 |
|
|
Boston, MA 02111-1307, USA. */
|
21 |
|
|
|
22 |
|
|
#ifndef TM_LINUXALPHA_H
|
23 |
|
|
#define TM_LINUXALPHA_H
|
24 |
|
|
|
25 |
|
|
#include "alpha/tm-alpha.h"
|
26 |
|
|
|
27 |
|
|
/* Are we currently handling a signal ? */
|
28 |
|
|
|
29 |
|
|
extern long alpha_linux_sigtramp_offset (CORE_ADDR);
|
30 |
|
|
#undef IN_SIGTRAMP
|
31 |
|
|
#define IN_SIGTRAMP(pc, name) (alpha_linux_sigtramp_offset (pc) >= 0)
|
32 |
|
|
|
33 |
|
|
/* Get start and end address of sigtramp handler. */
|
34 |
|
|
|
35 |
|
|
#define SIGTRAMP_START(pc) (pc - alpha_linux_sigtramp_offset (pc))
|
36 |
|
|
#define SIGTRAMP_END(pc) (SIGTRAMP_START(pc) + 3*4)
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
/* Number of traps that happen between exec'ing the shell to run an
|
40 |
|
|
inferior, and when we finally get to the inferior code. This is 2
|
41 |
|
|
on Linux and most implementations. */
|
42 |
|
|
|
43 |
|
|
#undef START_INFERIOR_TRAPS_EXPECTED
|
44 |
|
|
#define START_INFERIOR_TRAPS_EXPECTED 2
|
45 |
|
|
|
46 |
|
|
/* Return TRUE if procedure descriptor PROC is a procedure descriptor
|
47 |
|
|
that refers to a dynamically generated sigtramp function. */
|
48 |
|
|
|
49 |
|
|
#undef PROC_DESC_IS_DYN_SIGTRAMP
|
50 |
|
|
#define PROC_SIGTRAMP_MAGIC 0x0e0f0f0f
|
51 |
|
|
#define PROC_DESC_IS_DYN_SIGTRAMP(proc) ((proc)->pdr.isym \
|
52 |
|
|
== PROC_SIGTRAMP_MAGIC)
|
53 |
|
|
#undef SET_PROC_DESC_IS_DYN_SIGTRAMP
|
54 |
|
|
#define SET_PROC_DESC_IS_DYN_SIGTRAMP(proc) ((proc)->pdr.isym \
|
55 |
|
|
= PROC_SIGTRAMP_MAGIC)
|
56 |
|
|
|
57 |
|
|
/* If PC is inside a dynamically generated sigtramp function, return
|
58 |
|
|
how many bytes the program counter is beyond the start of that
|
59 |
|
|
function. Otherwise, return a negative value. */
|
60 |
|
|
|
61 |
|
|
#undef DYNAMIC_SIGTRAMP_OFFSET
|
62 |
|
|
#define DYNAMIC_SIGTRAMP_OFFSET(pc) (alpha_linux_sigtramp_offset (pc))
|
63 |
|
|
|
64 |
|
|
/* Translate a signal handler frame into the address of the sigcontext
|
65 |
|
|
structure. */
|
66 |
|
|
|
67 |
|
|
#undef SIGCONTEXT_ADDR
|
68 |
|
|
#define SIGCONTEXT_ADDR(frame) ((frame)->frame - 0x298)
|
69 |
|
|
|
70 |
|
|
/* If FRAME refers to a sigtramp frame, return the address of the next frame.
|
71 |
|
|
|
72 |
|
|
Under Linux, sigtramp handlers have dynamically generated procedure
|
73 |
|
|
descriptors that make this hack unnecessary. */
|
74 |
|
|
|
75 |
|
|
#undef FRAME_PAST_SIGTRAMP_FRAME
|
76 |
|
|
#define FRAME_PAST_SIGTRAMP_FRAME(frame, pc) (0)
|
77 |
|
|
|
78 |
|
|
#include "tm-linux.h"
|
79 |
|
|
|
80 |
|
|
#endif /* TM_LINUXALPHA_H */
|