Deleted Added
full compact
trgt.c (178713) trgt.c (246893)
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/gnu/usr.bin/gdb/kgdb/trgt.c 178713 2008-05-01 20:36:48Z jhb $");
28__FBSDID("$FreeBSD: head/gnu/usr.bin/gdb/kgdb/trgt.c 246893 2013-02-17 02:15:19Z marcel $");
29
30#include <sys/param.h>
31#include <sys/proc.h>
32#include <sys/sysctl.h>
33#include <sys/user.h>
34#include <err.h>
35#include <fcntl.h>
36#include <kvm.h>

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

48#include <language.h>
49#include <regcache.h>
50#include <solib.h>
51#include <target.h>
52#include <ui-out.h>
53
54#include "kgdb.h"
55
29
30#include <sys/param.h>
31#include <sys/proc.h>
32#include <sys/sysctl.h>
33#include <sys/user.h>
34#include <err.h>
35#include <fcntl.h>
36#include <kvm.h>

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

48#include <language.h>
49#include <regcache.h>
50#include <solib.h>
51#include <target.h>
52#include <ui-out.h>
53
54#include "kgdb.h"
55
56static CORE_ADDR stoppcbs;
57
56static void kgdb_core_cleanup(void *);
57
58static char *vmcore;
59static struct target_ops kgdb_trgt_ops;
60
61kvm_t *kvm;
62static char kvm_err[_POSIX2_LINE_MAX];
63

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

347
348 add_target(&kgdb_trgt_ops);
349
350 add_com ("proc", class_obscure, kgdb_set_proc_cmd,
351 "Set current process context");
352 add_com ("tid", class_obscure, kgdb_set_tid_cmd,
353 "Set current thread context");
354}
58static void kgdb_core_cleanup(void *);
59
60static char *vmcore;
61static struct target_ops kgdb_trgt_ops;
62
63kvm_t *kvm;
64static char kvm_err[_POSIX2_LINE_MAX];
65

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

349
350 add_target(&kgdb_trgt_ops);
351
352 add_com ("proc", class_obscure, kgdb_set_proc_cmd,
353 "Set current process context");
354 add_com ("tid", class_obscure, kgdb_set_tid_cmd,
355 "Set current thread context");
356}
357
358CORE_ADDR
359kgdb_trgt_stop_pcb(u_int cpuid, u_int pcbsz)
360{
361 static int once = 0;
362
363 if (stoppcbs == 0 && !once) {
364 once = 1;
365 stoppcbs = kgdb_lookup("stoppcbs");
366 }
367 if (stoppcbs == 0)
368 return 0;
369
370 return (stoppcbs + pcbsz * cpuid);
371}