From: David van Moolenbroek Date: Wed, 17 Jun 2009 14:59:22 +0000 (+0000) Subject: make mdb(1) compile again X-Git-Tag: v3.1.5~236 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=d8b9bf642bf48418d362c75d6a9727231529c67e;p=minix.git make mdb(1) compile again --- diff --git a/commands/mdb/Makefile b/commands/mdb/Makefile index 976da2cd4..0e74822e2 100644 --- a/commands/mdb/Makefile +++ b/commands/mdb/Makefile @@ -51,12 +51,6 @@ KERNEL =$(SYSTEM)/kernel PTRACE =$(INCLUDE)/sys/ptrace.h -# Header files from pm (used by core.c) -# -MMFILES= $(SYSTEM)/servers/pm/const.h \ - $(SYSTEM)/servers/pm/type.h \ - $(SYSTEM)/servers/pm/mproc.h - # Header files from system and kernel in "mdb.h" # SYSFILES= $(INCLUDE)/minix/config.h \ diff --git a/commands/mdb/core.c b/commands/mdb/core.c index 83fd86a2a..bf04d922b 100644 --- a/commands/mdb/core.c +++ b/commands/mdb/core.c @@ -4,8 +4,6 @@ * reads information from 'core' file * Partly derived from 'adb' by D. Dugger. */ -#include - #include "mdb.h" #include @@ -16,9 +14,6 @@ #include #include -#include -#include - #include #include #include @@ -249,16 +244,14 @@ PRIVATE unsigned long c_status() PRIVATE void read_info(fp) struct file *fp; { - struct mproc mm_info; - struct mproc *rmp; + struct mem_map seg[NR_LOCAL_SEGS]; int r; int i; - rmp = &mm_info; lseek(fp->fid, 0L, 0L); /* First read memory map of all segments. */ - if (read(fp->fid, (char *) rmp->mp_seg, (int) SIZE_MP_SEG) < 0) { + if (read(fp->fid, (char *) seg, (int) SIZE_MP_SEG) < 0) { close(fp->fid); Printf("mdb: cannot read core header\n"); fp->fid = -1; @@ -278,20 +271,20 @@ struct file *fp; /* copy info */ for (i = T; i <= S; i++) - cnt[i] = (long) rmp->mp_seg[i].mem_len << CLICK_SHIFT; + cnt[i] = (long) seg[i].mem_len << CLICK_SHIFT; /* This needs to be set for map_addr() below */ if(coreonly && cnt[T] != 0) is_separate = TRUE; - st_addr = (long) rmp->mp_seg[T].mem_vir << CLICK_SHIFT; - et_addr = st_addr + ((long) rmp->mp_seg[T].mem_len << CLICK_SHIFT); + st_addr = (long) seg[T].mem_vir << CLICK_SHIFT; + et_addr = st_addr + ((long) seg[T].mem_len << CLICK_SHIFT); - sd_addr = (long) rmp->mp_seg[D].mem_vir << CLICK_SHIFT; + sd_addr = (long) seg[D].mem_vir << CLICK_SHIFT; end_addr = ed_addr = - sd_addr + ((long) rmp->mp_seg[D].mem_len << CLICK_SHIFT); + sd_addr + ((long) seg[D].mem_len << CLICK_SHIFT); - sk_addr = (long) rmp->mp_seg[S].mem_vir << CLICK_SHIFT; - sk_size = (long) rmp->mp_seg[S].mem_len << CLICK_SHIFT; + sk_addr = (long) seg[S].mem_vir << CLICK_SHIFT; + sk_size = (long) seg[S].mem_len << CLICK_SHIFT; setmap(fp); }