Changeset View
Changeset View
Standalone View
Standalone View
gnu/usr.bin/gdb/kgdb/trgt_i386.c
Show All 23 Lines | |||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
*/ | */ | ||||
#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 <vm/vm.h> | |||||
#include <vm/pmap.h> | |||||
#include <machine/pcb.h> | #include <machine/pcb.h> | ||||
alc: vm/pmap.h has always included machine/pmap.h. | |||||
#include <machine/frame.h> | #include <machine/frame.h> | ||||
#include <machine/segments.h> | #include <machine/segments.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> | ||||
▲ Show 20 Lines • Show All 233 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_pc_unwind(next_frame); | ||||
if (pcx >= PMAP_TRM_MIN_ADDRESS) { | |||||
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 72 Lines • ▼ Show 20 Lines | |||||
const struct frame_unwind * | const struct frame_unwind * | ||||
kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame) | kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame) | ||||
{ | { | ||||
char *pname; | char *pname; | ||||
CORE_ADDR pc; | CORE_ADDR pc; | ||||
pc = frame_pc_unwind(next_frame); | pc = frame_pc_unwind(next_frame); | ||||
if (pc >= PMAP_TRM_MIN_ADDRESS) | |||||
return (&kgdb_trgt_trapframe_unwind); | |||||
pname = NULL; | pname = NULL; | ||||
find_pc_partial_function(pc, &pname, NULL, NULL); | find_pc_partial_function(pc, &pname, NULL, NULL); | ||||
if (pname == NULL) | if (pname == NULL) | ||||
return (NULL); | return (NULL); | ||||
if (strcmp(pname, "dblfault_handler") == 0) | if (strcmp(pname, "dblfault_handler") == 0) | ||||
return (&kgdb_trgt_dblfault_unwind); | return (&kgdb_trgt_dblfault_unwind); | ||||
if (strcmp(pname, "calltrap") == 0 || | if (strcmp(pname, "calltrap") == 0 || | ||||
(pname[0] == 'X' && pname[1] != '_')) | (pname[0] == 'X' && pname[1] != '_')) | ||||
Show All 17 Lines |
vm/pmap.h has always included machine/pmap.h.