core.c File Reference

#include <pm/const.h>
#include "mdb.h"
#include <signal.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/ptrace.h>
#include <pm/type.h>
#include <pm/mproc.h>
#include <kernel/const.h>
#include <kernel/type.h>
#include <kernel/proc.h>
#include "proto.h"

Include dependency graph for core.c:

Go to the source code of this file.

Data Structures

struct  file

Defines

#define BSIZE   512
#define LOGBS   9
#define b1   tmap[0]
#define e1   tmap[1]
#define f1   tmap[2]
#define b2   dmap[0]
#define e2   dmap[1]
#define f2   dmap[2]
#define b3   smap[0]
#define e3   smap[1]
#define f3   smap[2]
#define SIZE_MP_SEG   (sizeof(struct mem_map) * NR_LOCAL_SEGS)
#define SIZE_KINFO   sizeof(struct proc)
#define SIZE_HEADER   SIZE_MP_SEG

Functions

FORWARD _PROTOTYPE (int kernel_info,(int fd))
FORWARD _PROTOTYPE (void setmap,(struct file *fp))
FORWARD _PROTOTYPE (void ill_addr,(long d, int segment))
FORWARD _PROTOTYPE (long map_addr,(long d, int segment))
FORWARD _PROTOTYPE (unsigned long c_status,(void))
FORWARD _PROTOTYPE (long getn,(long d, int s))
PRIVATE void setmap (struct file *fp)
PUBLIC void prtmap ()
PRIVATE void ill_addr (long d, int segment)
PRIVATE long map_addr (long d, int segment)
PRIVATE long getn (long d, int s)
PRIVATE int kernel_info (int fd)
PRIVATE unsigned long c_status ()
PRIVATE void read_info (struct file *fp)
PUBLIC unsigned long core_init (char *filename)
PUBLIC unsigned long file_init (char *filename)
PUBLIC long read_core (int req, long addr, long data)

Variables

procprc
PRIVATE struct file Core_File
PRIVATE struct filecore_file
PRIVATE long cnt [3]
PRIVATE int h_size
PRIVATE char def_name [] = "core"


Define Documentation

#define b1   tmap[0]
 

Definition at line 44 of file core.c.

Referenced by __diff(), and kill_buf().

#define b2   dmap[0]
 

Definition at line 47 of file core.c.

Referenced by __diff(), f_retsup(), and sel_mbuf().

#define b3   smap[0]
 

Definition at line 50 of file core.c.

#define BSIZE   512
 

Definition at line 31 of file core.c.

Referenced by check(), and getn().

#define e1   tmap[1]
 

Definition at line 45 of file core.c.

Referenced by add_ext(), adf4(), adf8(), b64_add(), b64_sft(), cmp_ext(), dvf4(), dvf8(), fif4(), fif8(), map_addr(), mlf4(), mlf8(), mul_ext(), sbf4(), sbf8(), sort(), and ten_mult().

#define e2   dmap[1]
 

Definition at line 48 of file core.c.

Referenced by add_ext(), adf4(), adf8(), b64_add(), cmp_ext(), dvf4(), dvf8(), fif4(), fif8(), map_addr(), mlf4(), mlf8(), mul_ext(), sbf4(), sbf8(), and sort().

#define e3   smap[1]
 

Definition at line 51 of file core.c.

Referenced by add_ext(), map_addr(), and mul_ext().

#define f1   tmap[2]
 

Definition at line 46 of file core.c.

Referenced by __diff(), atimecmp(), checkdir(), chk_dir(), cmpf(), ctimecmp(), file_changed(), mtimecmp(), namecmp(), revcmp(), test39a(), and typecmp().

#define f2   dmap[2]
 

Definition at line 49 of file core.c.

Referenced by __diff(), _hash_add(), _hash_lookup(), atimecmp(), checkdir(), chk_dir(), cmpf(), ctimecmp(), file_changed(), mtimecmp(), namecmp(), revcmp(), test39a(), and typecmp().

#define f3   smap[2]
 

Definition at line 52 of file core.c.

Referenced by checkdir(), chk_dir(), and test39a().

#define LOGBS   9
 

Definition at line 32 of file core.c.

Referenced by getn().

#define SIZE_HEADER   SIZE_MP_SEG
 

Definition at line 60 of file core.c.

Referenced by read_info().

#define SIZE_KINFO   sizeof(struct proc)
 

Definition at line 59 of file core.c.

Referenced by kernel_info().

#define SIZE_MP_SEG   (sizeof(struct mem_map) * NR_LOCAL_SEGS)
 

Definition at line 58 of file core.c.

Referenced by read_info().


Function Documentation

FORWARD _PROTOTYPE long  getn,
(long d, int s
 

FORWARD _PROTOTYPE unsigned long  c_status,
(void) 
 

FORWARD _PROTOTYPE long  map_addr,
(long d, int segment
 

FORWARD _PROTOTYPE void  ill_addr,
(long d, int segment
 

FORWARD _PROTOTYPE void  setmap,
(struct file *fp
 

FORWARD _PROTOTYPE int  kernel_info,
(int fd
 

PRIVATE unsigned long c_status  ) 
 

Definition at line 232 of file core.c.

References ADDRSIZE, corepid, curpid, dasm(), disp_maps(), fprintf(), MASK, proc::p_nr, PC_MEMBER, prc, Printf(), stderr, and symbolic.

Referenced by core_init().

PUBLIC unsigned long core_init char *  filename  ) 
 

Definition at line 301 of file core.c.

References c_status(), file::cblock, Core_File, core_file, def_name, file::fid, file::name, NULL, open, Printf(), and read_info().

PUBLIC unsigned long file_init char *  filename  ) 
 

Definition at line 330 of file core.c.

References file::cblock, Core_File, core_file, corepid, curpid, def_name, FALSE, file::fid, file_size(), is_separate, file::name, NULL, open, and Printf().

PRIVATE long getn long  d,
int  s
 

Definition at line 182 of file core.c.

References b, BSIZE, file::buf, c, file::cblock, core_file, data, debug, DEBUG, file::fid, i, if(), LOGBS, lseek, map_addr(), Printf(), and read.

Referenced by brkcontin(), doexit(), doshift(), dowait(), getsig(), and read_core().

PRIVATE void ill_addr long  d,
int  segment
 

Definition at line 130 of file core.c.

References mdb_error(), and Printf().

Referenced by map_addr().

PRIVATE int kernel_info int  fd  ) 
 

Definition at line 216 of file core.c.

References lbuf, long(), r, read, and SIZE_KINFO.

Referenced by read_info().

PRIVATE long map_addr long  d,
int  segment
 

Definition at line 141 of file core.c.

References core_file, D, e1, e2, e3, ill_addr(), is_separate, S, and T.

Referenced by getn().

PUBLIC void prtmap  ) 
 

Definition at line 114 of file core.c.

References core_file, corepid, curpid, disp_maps(), is_separate, file::name, Printf(), setmap(), and update().

Referenced by command().

PUBLIC long read_core int  req,
long  addr,
long  data
 

Definition at line 358 of file core.c.

References ADDRSIZE, D, debug, getn(), i, int(), L, lbuf, MASK, mdb_error(), Printf(), T, T_EXIT, T_GETDATA, T_GETINS, T_GETUSER, T_OK, and val.

Referenced by mdbtrace().

PRIVATE void read_info struct file fp  ) 
 

Definition at line 248 of file core.c.

References CLICK_SHIFT, close, cnt, coreonly, D, ed_addr, end_addr, et_addr, h_size, i, is_separate, kernel_info(), L, lseek, mem_map::mem_len, mproc::mp_seg, Printf(), r, read, S, sd_addr, SIZE_HEADER, SIZE_MP_SEG, sk_addr, sk_size, st_addr, T, and TRUE.

Referenced by core_init().

PRIVATE void setmap struct file fp  ) 
 

Definition at line 73 of file core.c.

References cnt, core_file, D, end_addr, et_addr, h_size, is_separate, long(), Printf(), S, sd_addr, sk_addr, st_addr, and T.

Referenced by prtmap().


Variable Documentation

PRIVATE long cnt[3]
 

Definition at line 54 of file core.c.

Referenced by add_ext(), addstring(), appnd_start(), asciisize(), buf_fill(), buf_flush(), check_work_empty(), count_chars(), cp_file(), cw_inode_block(), d_backup(), doargs(), e_gowd(), e_search(), extract(), f_whatpage(), fgets(), get_args(), get_inode(), get_segment(), getw(), main(), next_file(), next_head(), nextblock(), nrm_ext(), parseDate(), print(), proc_dir(), putcol(), putw(), rd_skip(), rd_wrbuf(), rd_wrfile(), read_info(), readblock(), recvfile(), restore(), saveadv(), sb_open(), sbm_lmak(), sbm_nmak(), sbx_aout(), sbx_rdf(), sbx_ready(), sctrin(), setmap(), shellescape(), slineq(), t_docleol(), tbufls(), test30a(), test31a(), test34a(), test35a(), ustar_rd(), WB(), wlen(), wr_archive(), wr_rdbuf(), wr_rdfile(), and wr_skip().

PRIVATE struct file * core_file
 

Referenced by core_init(), file_init(), getn(), map_addr(), prtmap(), and setmap().

PRIVATE struct file Core_File
 

Referenced by core_init(), and file_init().

PRIVATE char def_name[] = "core"
 

Definition at line 56 of file core.c.

Referenced by core_init(), and file_init().

PRIVATE int h_size
 

Definition at line 55 of file core.c.

Referenced by read_info(), and setmap().

struct proc* prc
 

Definition at line 23 of file kernel.c.

Referenced by c_status(), command(), disp_maps(), disp_regs(), findbpnt(), main(), modify(), tstart(), and update().


Generated on Fri Apr 14 23:05:20 2006 for minix by  doxygen 1.4.6