summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/binutils/gdb/alpha/freebsd-nat-stubs.c
blob: 08183d8bace7e018e2d7866d6fbf8758ea2ef903 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* $FreeBSD$ */

#include "defs.h"

/* Size of elements in jmpbuf */

#define JB_ELEMENT_SIZE 8

#define JB_PC 2

int kernel_debugging = 0;

fetch_kcore_registers (pcbp)
  struct pcb *pcbp;
{
  return;
}

void
fetch_inferior_registers (regno)
     int regno;
{
  return;
}

void
store_inferior_registers (regno)
     int regno;
{
  return;
}

/* From gdb/alpha-nat.c.  */

/* Figure out where the longjmp will land.
   We expect the first arg to be a pointer to the jmp_buf structure from which
   we extract the pc (JB_PC) that we will land at.  The pc is copied into PC.
   This routine returns true on success. */

int
get_longjmp_target (pc)
     CORE_ADDR *pc;
{
  CORE_ADDR jb_addr;
  char raw_buffer[MAX_REGISTER_RAW_SIZE];

  jb_addr = read_register(A0_REGNUM);

  if (target_read_memory(jb_addr + JB_PC * JB_ELEMENT_SIZE, raw_buffer,
			 sizeof(CORE_ADDR)))
    return 0;

  *pc = extract_address (raw_buffer, sizeof(CORE_ADDR));
  return 1;
}
OpenPOWER on IntegriCloud