[BACK]Return to symbol.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / pmdb

Diff for /src/usr.bin/pmdb/Attic/symbol.c between version 1.3 and 1.4

version 1.3, 2002/03/15 17:49:51 version 1.4, 2002/03/15 18:04:41
Line 28 
Line 28 
 #include <stdio.h>  #include <stdio.h>
 #include <string.h>  #include <string.h>
 #include <err.h>  #include <err.h>
   #include <errno.h>
   
 #include "pmdb.h"  #include "pmdb.h"
 #include "symbol.h"  #include "symbol.h"
Line 149 
Line 150 
                         return (st);                          return (st);
         }          }
   
         warnx("Loading symbols from %s", name);          warnx("Loading symbols from %s at 0x%lx", name, offs);
   
         if ((st = (*ps->ps_sops->sop_open)(name)) != NULL) {          if ((st = (*ps->ps_sops->sop_open)(name)) != NULL) {
                 TAILQ_INSERT_TAIL(&ps->ps_syms, st, st_list);                  TAILQ_INSERT_TAIL(&ps->ps_syms, st, st_list);
Line 161 
Line 162 
         return (st);          return (st);
 }  }
   
   /*
    * Load a symbol table from file argv[1] at offset argv[2].
    */
   int
   cmd_sym_load(int argc, char **argv, void *arg)
   {
           struct pstate *ps = arg;
           char *fname, *ep;
           reg offs;
   
           fname = argv[1];
           errno = 0;
           offs = strtol(argv[2], &ep, 0);
           if (argv[2][0] == '\0' || *ep != '\0' || errno == ERANGE) {
                   fprintf(stderr, "%s is not a valid offset\n", argv[2]);
                   return (0);
           }
   
           if (st_open(ps, fname, offs) == NULL) {
                   warnx("symbol loading failed");
           }
   
           return (0);
   }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4