Changeset View
Changeset View
Standalone View
Standalone View
gnu/usr.bin/gdb/kgdb/trgt_i386.c
Show All 25 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <machine/pcb.h> | #include <machine/pcb.h> | ||||
#include <machine/frame.h> | #include <machine/frame.h> | ||||
#include <machine/segments.h> | #include <machine/segments.h> | ||||
alc: vm/pmap.h has always included machine/pmap.h. | |||||
#include <machine/tss.h> | #include <machine/tss.h> | ||||
#include <err.h> | #include <err.h> | ||||
#include <kvm.h> | #include <kvm.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <defs.h> | #include <defs.h> | ||||
#include <target.h> | #include <target.h> | ||||
#include <gdbthread.h> | #include <gdbthread.h> | ||||
▲ Show 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
static struct kgdb_frame_cache * | static struct kgdb_frame_cache * | ||||
kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache) | kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache) | ||||
{ | { | ||||
char buf[MAX_REGISTER_SIZE]; | char buf[MAX_REGISTER_SIZE]; | ||||
struct kgdb_frame_cache *cache; | struct kgdb_frame_cache *cache; | ||||
char *pname; | char *pname; | ||||
CORE_ADDR pcx; | |||||
uintptr_t addr, setidt_disp; | |||||
cache = *this_cache; | cache = *this_cache; | ||||
if (cache == NULL) { | if (cache == NULL) { | ||||
cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache); | cache = FRAME_OBSTACK_ZALLOC(struct kgdb_frame_cache); | ||||
*this_cache = cache; | *this_cache = cache; | ||||
cache->pc = frame_func_unwind(next_frame); | pcx = frame_func_unwind(next_frame); | ||||
if (pcx >= 0xffc00000) { | |||||
Done Inline Actions#define? emaste: `#define`? | |||||
addr = kgdb_lookup("setidt_disp"); | |||||
if (addr != 0) { | |||||
if (kvm_read(kvm, addr, &setidt_disp, | |||||
sizeof(setidt_disp)) != | |||||
sizeof(setidt_disp)) | |||||
warnx("kvm_read: %s", kvm_geterr(kvm)); | |||||
else | |||||
pcx += setidt_disp; | |||||
} | |||||
} | |||||
cache->pc = pcx; | |||||
find_pc_partial_function(cache->pc, &pname, NULL, NULL); | find_pc_partial_function(cache->pc, &pname, NULL, NULL); | ||||
if (pname[0] != 'X') | if (pname[0] != 'X') | ||||
cache->frame_type = FT_NORMAL; | cache->frame_type = FT_NORMAL; | ||||
else if (strcmp(pname, "Xtimerint") == 0) | else if (strcmp(pname, "Xtimerint") == 0) | ||||
cache->frame_type = FT_TIMERFRAME; | cache->frame_type = FT_TIMERFRAME; | ||||
else if (strcmp(pname, "Xcpustop") == 0 || | else if (strcmp(pname, "Xcpustop") == 0 || | ||||
strcmp(pname, "Xrendezvous") == 0 || | strcmp(pname, "Xrendezvous") == 0 || | ||||
strcmp(pname, "Xipi_intr_bitmap_handler") == 0 || | strcmp(pname, "Xipi_intr_bitmap_handler") == 0 || | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |
vm/pmap.h has always included machine/pmap.h.