extract cmd in right place

This commit is contained in:
rsc 2005-01-18 20:49:11 +00:00
parent 58698c9c12
commit 1bdf170864
3 changed files with 6 additions and 6 deletions

View file

@ -6,7 +6,7 @@
static int mapelf(Fhdr *fp, ulong base, Map *map, Regs**);
static int mapcoreregs(Fhdr *fp, Map *map, Regs**);
static char *getcorecmd(Fhdr *fp, Map *map);
static char *getcorecmd(Fhdr *fp);
static struct
{
@ -141,6 +141,8 @@ crackelf(int fd, Fhdr *fp)
elf->corecmd = ctab[i].corecmd;
break;
}
if((fp->cmd = getcorecmd(fp)) == nil)
fprint(2, "warning: reading core command: %r");
return 0;
}
@ -259,8 +261,6 @@ mapelf(Fhdr *fp, ulong base, Map *map, Regs **regs)
if(fp->ftype == FCORE){
if(mapcoreregs(fp, map, regs) < 0)
fprint(2, "warning: reading core regs: %r");
if((fp->cmd = getcorecmd(fp, map)) == nil)
fprint(2, "warning: reading core command: %r");
}
return 0;
@ -352,7 +352,7 @@ mapcoreregs(Fhdr *fp, Map *map, Regs **rp)
}
static char*
getcorecmd(Fhdr *fp, Map *map)
getcorecmd(Fhdr *fp)
{
int i;
uchar *a, *sa, *ea;

View file

@ -108,7 +108,7 @@ corecmdfreebsd386(Elf *elf, ElfNote *note, char **pp)
return -1;
}
p = (Psinfo*)note->desc;
print("elf name %s\nelf args %s\n", p->name, p->psargs);
// print("elf name %s\nelf args %s\n", p->name, p->psargs);
t = malloc(80+1);
if(t == nil)
return -1;

View file

@ -83,7 +83,7 @@ corecmdlinux386(Elf *elf, ElfNote *note, char **pp)
return -1;
}
p = (Psinfo*)note->desc;
print("elf name %s\nelf args %s\n", p->fname, p->psargs);
// print("elf name %s\nelf args %s\n", p->fname, p->psargs);
t = malloc(80+1);
if(t == nil)
return -1;