mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
better handling of failed setproc
This commit is contained in:
parent
4999080d5b
commit
783aadbdcd
1 changed files with 7 additions and 4 deletions
|
@ -14,6 +14,7 @@ sproc(int xpid)
|
|||
{
|
||||
Lsym *s;
|
||||
int i;
|
||||
Regs *regs;
|
||||
|
||||
if(symmap == 0)
|
||||
error("no map");
|
||||
|
@ -22,11 +23,11 @@ sproc(int xpid)
|
|||
return;
|
||||
|
||||
if(corhdr){
|
||||
free(correg);
|
||||
correg = nil;
|
||||
correg = coreregs(corhdr, xpid);
|
||||
if(correg == nil)
|
||||
regs = coreregs(corhdr, xpid);
|
||||
if(regs == nil)
|
||||
error("no such pid in core dump");
|
||||
free(correg);
|
||||
correg = regs;
|
||||
}else{
|
||||
/* XXX should only change register set here if cormap already mapped */
|
||||
if(xpid <= 0)
|
||||
|
@ -35,6 +36,8 @@ sproc(int xpid)
|
|||
unmapfile(corhdr, cormap);
|
||||
free(correg);
|
||||
correg = nil;
|
||||
pid = -1;
|
||||
corpid = -1;
|
||||
|
||||
if(mapproc(xpid, cormap, &correg) < 0)
|
||||
error("setproc %d: %r", xpid);
|
||||
|
|
Loading…
Reference in a new issue