postmort.c File Reference

#include <sys/types.h>
#include <minix/config.h>
#include <minix/const.h>
#include <minix/type.h>
#include <minix/ipc.h>
#include <limits.h>
#include <timers.h>
#include <signal.h>
#include <stdlib.h>
#include "../../kernel/const.h"
#include "../../kernel/type.h"
#include "../../kernel/proc.h"
#include "../../servers/pm/mproc.h"
#include <a.out.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

Include dependency graph for postmort.c:

Go to the source code of this file.

Data Structures

struct  sym

Defines

#define EXTERN
#define FALSE   0
#define TRUE   ~FALSE
#define OK   1
#define FAILED   -1
#define CORE   "core"
#define AOUT   "a.out"
#define SYMB   "symbol.out"
#define LINE_LEN   16
#define MAXSYM   200
#define SYMLEN   8

Functions

 _PROTOTYPE (int binary,(int uc, char *sp))
 _PROTOTYPE (void dump_all_segs,(int fd))
 _PROTOTYPE (void dump_maps,(struct mem_map *mp))
 _PROTOTYPE (void dump_one_seg,(int fd, int segindex))
 _PROTOTYPE (void dump_proc_table,(struct proc *pt))
 _PROTOTYPE (void dump_sym_tab,(struct sym *st))
 _PROTOTYPE (void dump_stack,(struct stackframe_s *sp))
 _PROTOTYPE (int main,(int argc, char *argv[]))
 _PROTOTYPE (int parse_line,(char *ps))
 _PROTOTYPE (int read_symbol,(int fd))
 _PROTOTYPE (void usage,(void))
int binary (int ucc, char *sp)
void dump_all_segs (int fd)
void dump_maps (struct mem_map *mp)
void dump_one_seg (int fd, int segindex)
void dump_proc_table (struct proc *pt)
void dump_registers (struct proc *pt)
void dump_sym_tab (struct sym *st)
void dump_stack (struct stackframe_s *sp)
 main (int argc, argv)
int parse_line (char *ps)
int read_symbol (int fd)
void stack_trace (int fd)
void usage ()

Variables

int opt_c = FALSE
int opt_d = FALSE
int opt_p = FALSE
int opt_s = FALSE
int opt_t = FALSE
int opt_x = FALSE
char progname [20]
char * segment_name []
int dbglvl = 0
int maxsym
unsigned int baseptr
unsigned int stackptr
long int lengths [NR_LOCAL_SEGS]
long int bases [NR_LOCAL_SEGS]
sym symtab [MAXSYM]
int optind
int opterr
int optopt
char * optarg


Define Documentation

#define AOUT   "a.out"
 

Definition at line 58 of file postmort.c.

Referenced by main().

#define CORE   "core"
 

Definition at line 57 of file postmort.c.

Referenced by main().

#define EXTERN
 

Definition at line 35 of file postmort.c.

#define FAILED   -1
 

Definition at line 55 of file postmort.c.

Referenced by find_user(), main(), parse_line(), processrequest(), and read_symbol().

#define FALSE   0
 

Definition at line 51 of file postmort.c.

#define LINE_LEN   16
 

Definition at line 60 of file postmort.c.

Referenced by bottom_line(), change(), dump_one_seg(), eat_dir(), get_expression(), IF(), main(), VI(), WB(), and WT().

#define MAXSYM   200
 

Definition at line 61 of file postmort.c.

#define OK   1
 

Definition at line 54 of file postmort.c.

#define SYMB   "symbol.out"
 

Definition at line 59 of file postmort.c.

#define SYMLEN   8
 

Definition at line 62 of file postmort.c.

#define TRUE   ~FALSE
 

Definition at line 53 of file postmort.c.


Function Documentation

_PROTOTYPE void  usage,
(void) 
 

_PROTOTYPE int  read_symbol,
(int fd
 

_PROTOTYPE int  parse_line,
(char *ps
 

_PROTOTYPE int  main,
(int argc, char *argv[]) 
 

_PROTOTYPE void  dump_stack,
(struct stackframe_s *sp
 

_PROTOTYPE void  dump_sym_tab,
(struct sym *st
 

_PROTOTYPE void  dump_proc_table,
(struct proc *pt) 
 

_PROTOTYPE void  dump_one_seg,
(int fd, int segindex) 
 

_PROTOTYPE void  dump_maps,
(struct mem_map *mp
 

_PROTOTYPE void  dump_all_segs,
(int fd
 

_PROTOTYPE int  binary,
(int uc, char *sp
 

int binary int  ucc,
char *  sp
 

Definition at line 114 of file postmort.c.

References j, and k.

void dump_all_segs int  fd  ) 
 

Definition at line 140 of file postmort.c.

References dump_one_seg(), j, lengths, long(), lseek, NR_LOCAL_SEGS, printf, and start.

Referenced by main().

void dump_maps struct mem_map mp  ) 
 

Definition at line 160 of file postmort.c.

References bases, CLICK_SHIFT, j, lengths, long(), NR_LOCAL_SEGS, printf, and segment_name.

Referenced by main().

void dump_one_seg int  fd,
int  segindex
 

Definition at line 184 of file postmort.c.

References dbglvl, dlen, exit(), i, lengths, LINE_LEN, offset, printf, read, and segment_name.

Referenced by dump_all_segs().

void dump_proc_table struct proc pt  ) 
 

Definition at line 226 of file postmort.c.

References NR_LOCAL_SEGS, and printf.

Referenced by main().

void dump_registers struct proc pt  ) 
 

Definition at line 283 of file postmort.c.

References binary(), buff, dump_stack(), and printf.

Referenced by main().

void dump_stack struct stackframe_s sp  ) 
 

Definition at line 321 of file postmort.c.

References baseptr, binary(), buff, dbglvl, printf, and stackptr.

Referenced by command(), dump_registers(), and main().

void dump_sym_tab struct sym st  ) 
 

Definition at line 306 of file postmort.c.

References addr, j, maxsym, printf, and symtab.

Referenced by main().

main int  argc,
argv 
 

Definition at line 361 of file postmort.c.

References AOUT, atoi, close, CORE, cp, dbglvl, dump_all_segs(), dump_maps(), dump_proc_table(), dump_registers(), dump_sym_tab(), EOF, exit(), FAILED, fds, fprintf(), getopt(), j, NR_LOCAL_SEGS, NULL, O_RDONLY, open, opt_c, opt_d, opt_p, opt_s, opt_t, opt_x, optarg, opterr, printf, progname, read, read_symbol(), stack_trace(), stderr, strncpy(), strrchr(), symtab, TRUE, and usage.

int parse_line char *  ps  ) 
 

Definition at line 481 of file postmort.c.

References addr, c, dbglvl, FAILED, isxdigit, j, k, MAXSYM, maxsym, printf, s, sscanf(), strlen(), and symtab.

Referenced by read_symbol().

int read_symbol int  fd  ) 
 

Definition at line 521 of file postmort.c.

References BADMAG, buff, BUFSIZ, ep, FAILED, j, k, m, maxsym, offset, parse_line(), read, and TRUE.

Referenced by main().

void stack_trace int  fd  ) 
 

Definition at line 599 of file postmort.c.

References addr, baseptr, bases, bp, dbglvl, j, L, lengths, lseek, NR_LOCAL_SEGS, offset, printf, read, symtab, and TRUE.

Referenced by main().

void usage void   ) 
 

Definition at line 653 of file postmort.c.

References fprintf(), progname, and stderr.


Variable Documentation

unsigned int baseptr
 

Definition at line 81 of file postmort.c.

Referenced by dump_stack(), and stack_trace().

long int bases[NR_LOCAL_SEGS]
 

Definition at line 84 of file postmort.c.

Referenced by dump_maps(), and stack_trace().

int dbglvl = 0
 

Definition at line 79 of file postmort.c.

Referenced by dump_one_seg(), dump_stack(), main(), parse_line(), and stack_trace().

long int lengths[NR_LOCAL_SEGS]
 

Definition at line 83 of file postmort.c.

Referenced by dump_all_segs(), dump_maps(), dump_one_seg(), dynamic(), fixed(), and stack_trace().

int maxsym
 

Definition at line 80 of file postmort.c.

Referenced by dump_sym_tab(), parse_line(), and read_symbol().

int opt_c = FALSE
 

Definition at line 65 of file postmort.c.

Referenced by main().

int opt_d = FALSE
 

Definition at line 66 of file postmort.c.

Referenced by get_pty(), getrequest(), main(), and sendreply().

int opt_p = FALSE
 

Definition at line 67 of file postmort.c.

Referenced by main().

int opt_s = FALSE
 

Definition at line 68 of file postmort.c.

Referenced by main().

int opt_t = FALSE
 

Definition at line 69 of file postmort.c.

Referenced by main().

int opt_x = FALSE
 

Definition at line 70 of file postmort.c.

Referenced by main().

char* optarg
 

Definition at line 59 of file options.c.

int opterr
 

Definition at line 28 of file getopt.c.

int optind
 

Definition at line 29 of file getopt.c.

int optopt
 

Definition at line 30 of file getopt.c.

char progname[20]
 

Definition at line 72 of file postmort.c.

char* segment_name[]
 

Initial value:

 {      
  "Text",
  "Data",
  "Stack"
}

Definition at line 73 of file postmort.c.

Referenced by disp_maps(), dump_maps(), and dump_one_seg().

unsigned int stackptr
 

Definition at line 82 of file postmort.c.

Referenced by dump_stack().

struct sym symtab[MAXSYM]
 

Definition at line 24 of file distabs.c.


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