Deleted Added
full compact
gdb_machdep.c (138212) gdb_machdep.c (138253)
1/*
2 * Copyright (c) 2004 Marcel Moolenaar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 11 unchanged lines hidden (view full) ---

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2004 Marcel Moolenaar
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 11 unchanged lines hidden (view full) ---

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/amd64/amd64/gdb_machdep.c 138212 2004-11-30 00:55:49Z peter $");
28__FBSDID("$FreeBSD: head/sys/amd64/amd64/gdb_machdep.c 138253 2004-12-01 06:40:35Z marcel $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kdb.h>
33#include <sys/kernel.h>
34#include <sys/proc.h>
35#include <sys/signal.h>
36

--- 39 unchanged lines hidden (view full) ---

76 case 15: return (&kdb_thrctx->pcb_r15);
77 case 16: return (&kdb_thrctx->pcb_rip);
78 case 17: return (&kdb_thrctx->pcb_rflags);
79 }
80 return (NULL);
81}
82
83void
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kdb.h>
33#include <sys/kernel.h>
34#include <sys/proc.h>
35#include <sys/signal.h>
36

--- 39 unchanged lines hidden (view full) ---

76 case 15: return (&kdb_thrctx->pcb_r15);
77 case 16: return (&kdb_thrctx->pcb_rip);
78 case 17: return (&kdb_thrctx->pcb_rflags);
79 }
80 return (NULL);
81}
82
83void
84gdb_cpu_setreg(int regnum, register_t val)
84gdb_cpu_setreg(int regnum, void *val)
85{
86
85{
86
87 val = __bswap64(val);
88 switch (regnum) {
89 case GDB_REG_PC:
87 switch (regnum) {
88 case GDB_REG_PC:
90 kdb_thrctx->pcb_rip = val;
89 kdb_thrctx->pcb_rip = *(register_t *)val;
91 if (kdb_thread == curthread)
90 if (kdb_thread == curthread)
92 kdb_frame->tf_rip = val;
91 kdb_frame->tf_rip = *(register_t *)val;
93 }
94}
92 }
93}