1 /* GNU/Linux on ARM target support.
2 Copyright 1999, 2000 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
26 #ifdef GET_LONGJMP_TARGET
28 /* Figure out where the longjmp will land. We expect that we have
29 just entered longjmp and haven't yet altered r0, r1, so the
30 arguments are still in the registers. (A1_REGNUM) points at the
31 jmp_buf structure from which we extract the pc (JB_PC) that we will
32 land at. The pc is copied into ADDR. This routine returns true on
35 #define LONGJMP_TARGET_SIZE sizeof(int)
36 #define JB_ELEMENT_SIZE sizeof(int)
43 arm_get_longjmp_target (CORE_ADDR * pc)
46 char buf[LONGJMP_TARGET_SIZE];
48 jb_addr = read_register (A1_REGNUM);
50 if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
54 *pc = extract_address (buf, LONGJMP_TARGET_SIZE);
58 #endif /* GET_LONGJMP_TARGET */
60 /* Extract from an array REGBUF containing the (raw) register state
61 a function return value of type TYPE, and copy that, in virtual format,
65 arm_linux_extract_return_value (struct type *type,
66 char regbuf[REGISTER_BYTES],
69 /* ScottB: This needs to be looked at to handle the different
70 floating point emulators on ARM Linux. Right now the code
71 assumes that fetch inferior registers does the right thing for
72 GDB. I suspect this won't handle NWFPE registers correctly, nor
73 will the default ARM version (arm_extract_return_value()). */
75 int regnum = (TYPE_CODE_FLT == TYPE_CODE (type)) ? F0_REGNUM : A1_REGNUM;
76 memcpy (valbuf, ®buf[REGISTER_BYTE (regnum)], TYPE_LENGTH (type));
80 _initialize_arm_linux_tdep (void)