diff options
author | rsc <devnull@localhost> | 2005-02-11 19:44:37 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-02-11 19:44:37 +0000 |
commit | 783aadbdcd39e3850c61528c77fcf878448824f4 (patch) | |
tree | ef950f8034584603f8c134071c85ed3ef1e2ec1e /src/cmd/acid | |
parent | 4999080d5b0c41a3aab78414a0329154441d1dce (diff) | |
download | plan9port-783aadbdcd39e3850c61528c77fcf878448824f4.tar.gz plan9port-783aadbdcd39e3850c61528c77fcf878448824f4.tar.bz2 plan9port-783aadbdcd39e3850c61528c77fcf878448824f4.zip |
better handling of failed setproc
Diffstat (limited to 'src/cmd/acid')
-rw-r--r-- | src/cmd/acid/proc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cmd/acid/proc.c b/src/cmd/acid/proc.c index 10923a91..0ae5a5bb 100644 --- a/src/cmd/acid/proc.c +++ b/src/cmd/acid/proc.c @@ -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); |