1 |
--- gdb/amd64fbsd-nat.c.orig 2012-02-09 17:06:44.000000000 +0100 |
2 |
+++ gdb/amd64fbsd-nat.c 2012-08-30 10:58:55.000000000 +0200 |
3 |
@@ -21,11 +21,13 @@ |
4 |
#include "inferior.h" |
5 |
#include "regcache.h" |
6 |
#include "target.h" |
7 |
+#include "gregset.h" |
8 |
|
9 |
#include "gdb_assert.h" |
10 |
#include <signal.h> |
11 |
#include <stddef.h> |
12 |
#include <sys/types.h> |
13 |
+#include <sys/procfs.h> |
14 |
#include <sys/ptrace.h> |
15 |
#include <sys/sysctl.h> |
16 |
#include <machine/reg.h> |
17 |
@@ -93,6 +95,46 @@ |
18 |
}; |
19 |
|
20 |
|
21 |
+/* Transfering the registers between GDB, inferiors and core files. */ |
22 |
+ |
23 |
+/* Fill GDB's register array with the general-purpose register values |
24 |
+ in *GREGSETP. */ |
25 |
+ |
26 |
+void |
27 |
+supply_gregset (struct regcache *regcache, const gregset_t *gregsetp) |
28 |
+{ |
29 |
+ amd64_supply_native_gregset (regcache, gregsetp, -1); |
30 |
+} |
31 |
+ |
32 |
+/* Fill register REGNUM (if it is a general-purpose register) in |
33 |
+ *GREGSETPS with the value in GDB's register array. If REGNUM is -1, |
34 |
+ do this for all registers. */ |
35 |
+ |
36 |
+void |
37 |
+fill_gregset (const struct regcache *regcache, gdb_gregset_t *gregsetp, int regnum) |
38 |
+{ |
39 |
+ amd64_collect_native_gregset (regcache, gregsetp, regnum); |
40 |
+} |
41 |
+ |
42 |
+/* Fill GDB's register array with the floating-point register values |
43 |
+ in *FPREGSETP. */ |
44 |
+ |
45 |
+void |
46 |
+supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp) |
47 |
+{ |
48 |
+ amd64_supply_fxsave (regcache, -1, fpregsetp); |
49 |
+} |
50 |
+ |
51 |
+/* Fill register REGNUM (if it is a floating-point register) in |
52 |
+ *FPREGSETP with the value in GDB's register array. If REGNUM is -1, |
53 |
+ do this for all registers. */ |
54 |
+ |
55 |
+void |
56 |
+fill_fpregset (const struct regcache *regcache, gdb_fpregset_t *fpregsetp, int regnum) |
57 |
+{ |
58 |
+ amd64_collect_fxsave (regcache, regnum, fpregsetp); |
59 |
+} |
60 |
+ |
61 |
/* Support for debugging kernel virtual memory images. */ |
62 |
|
63 |
#include <sys/types.h> |