proc_bkpt.c (233402) | proc_bkpt.c (242723) |
---|---|
1/* 2 * Copyright (c) 2010 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Rui Paulo under sponsorship from the 6 * FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2010 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Rui Paulo under sponsorship from the 6 * FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/lib/libproc/proc_bkpt.c 233402 2012-03-23 23:07:02Z gonzo $"); | 31__FBSDID("$FreeBSD: head/lib/libproc/proc_bkpt.c 242723 2012-11-07 23:45:09Z jhibbits $"); |
32 33#include <sys/types.h> 34#include <sys/ptrace.h> 35#include <sys/wait.h> 36#include <machine/_inttypes.h> 37 38#include <assert.h> 39#include <err.h> 40#include <stdio.h> 41#include <errno.h> 42#include "_libproc.h" 43 44#if defined(__i386__) || defined(__amd64__) 45#define BREAKPOINT_INSTR 0xcc /* int 0x3 */ 46#define BREAKPOINT_INSTR_SZ 1 47#elif defined(__mips__) 48#define BREAKPOINT_INSTR 0xd /* break */ 49#define BREAKPOINT_INSTR_SZ 4 | 32 33#include <sys/types.h> 34#include <sys/ptrace.h> 35#include <sys/wait.h> 36#include <machine/_inttypes.h> 37 38#include <assert.h> 39#include <err.h> 40#include <stdio.h> 41#include <errno.h> 42#include "_libproc.h" 43 44#if defined(__i386__) || defined(__amd64__) 45#define BREAKPOINT_INSTR 0xcc /* int 0x3 */ 46#define BREAKPOINT_INSTR_SZ 1 47#elif defined(__mips__) 48#define BREAKPOINT_INSTR 0xd /* break */ 49#define BREAKPOINT_INSTR_SZ 4 |
50#elif defined(__powerpc__) 51#define BREAKPOINT_INSTR 0x7fe00008 /* trap */ 52#define BREAKPOINT_INSTR_SZ 4 |
|
50#else 51#error "Add support for your architecture" 52#endif 53 54int 55proc_bkptset(struct proc_handle *phdl, uintptr_t address, 56 unsigned long *saved) 57{ --- 130 unchanged lines hidden --- | 53#else 54#error "Add support for your architecture" 55#endif 56 57int 58proc_bkptset(struct proc_handle *phdl, uintptr_t address, 59 unsigned long *saved) 60{ --- 130 unchanged lines hidden --- |