Discussion:
Is there any way to debug a program with arguments in the kept debugger?
(too old to reply)
Richard Levitte
2017-03-15 00:38:11 UTC
Permalink
Raw Message
Debugging with the kept debugger seems to be an adventure...

$ DEBUG/KEEP
...
DBG> run [.apps]openssl
%DEBUG-I-INITIAL, Language: C, Module: OPENSSL
%DEBUG-I-NOTATMAIN, Type GO to reach MAIN program
DBG> set b main
DBG> go
break at routine OPENSSL\main in THREAD 1
60142: LHASH_OF(FUNCTION) *prog = NULL;
DBG> step
stepped to OPENSSL\main\%LINE 60143 in THREAD 1
60143: char **copied_argv = NULL;
DBG> exam argv
OPENSSL\main\argv: 7691600
DBG>

Ok, cool so far. But...

DBG> run/arg="help" [.apps]openssl

Standard commands
asn1parse ca ciphers cms
crl crl2pkcs7 dgst dhparam
dsa dsaparam ec ecparam
enc engine errstr exit
gendsa genpkey genrsa help
list nseq ocsp passwd
pkcs12 pkcs7 pkcs8 pkey
pkeyparam pkeyutl prime rand
rehash req rsa rsautl
s_client s_server s_time sess_id
smime speed spkac srp
ts verify version x509

Message Digest commands (see the `dgst' command for more details)
blake2b512 blake2s256 gost md4
md5 mdc2 rmd160 sha1
sha224 sha256 sha384 sha512

Cipher commands (see the `enc' command for more details)
aes-128-cbc aes-128-ecb aes-192-cbc aes-192-ecb
aes-256-cbc aes-256-ecb base64 bf
bf-cbc bf-cfb bf-ecb bf-ofb
camellia-128-cbc camellia-128-ecb camellia-192-cbc camellia-192-ecb
camellia-256-cbc camellia-256-ecb cast cast-cbc
cast5-cbc cast5-cfb cast5-ecb cast5-ofb
des des-cbc des-cfb des-ecb
des-ede des-ede-cbc des-ede-cfb des-ede-ofb
des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb
des-ofb des3 desx idea
idea-cbc idea-cfb idea-ecb idea-ofb
rc2 rc2-40-cbc rc2-64-cbc rc2-cbc
rc2-cfb rc2-ecb rc2-ofb rc4
rc4-40 seed seed-cbc seed-cfb
seed-ecb seed-ofb

DBG> set b main
%DEBUG-E-NOPROCESSES, the current command is targetted at an empty process set
DBG>

So just because I want to give the program some arguments to work around, I can suddenly not debug? Is there a trick somewhere that I'm just not seeing?

Cheers,
Richard
Richard Levitte
2017-03-15 00:48:01 UTC
Permalink
Raw Message
Never mind, solved, the CALL_DEBUG flag must be on for that to work.

I gotta say, this difference in behavior, caused by the absence or existence of /ARG, is quite frustrating.
Post by Richard Levitte
Debugging with the kept debugger seems to be an adventure...
$ DEBUG/KEEP
...
DBG> run [.apps]openssl
%DEBUG-I-INITIAL, Language: C, Module: OPENSSL
%DEBUG-I-NOTATMAIN, Type GO to reach MAIN program
DBG> set b main
DBG> go
break at routine OPENSSL\main in THREAD 1
60142: LHASH_OF(FUNCTION) *prog = NULL;
DBG> step
stepped to OPENSSL\main\%LINE 60143 in THREAD 1
60143: char **copied_argv = NULL;
DBG> exam argv
OPENSSL\main\argv: 7691600
DBG>
Ok, cool so far. But...
DBG> run/arg="help" [.apps]openssl
Standard commands
asn1parse ca ciphers cms
crl crl2pkcs7 dgst dhparam
dsa dsaparam ec ecparam
enc engine errstr exit
gendsa genpkey genrsa help
list nseq ocsp passwd
pkcs12 pkcs7 pkcs8 pkey
pkeyparam pkeyutl prime rand
rehash req rsa rsautl
s_client s_server s_time sess_id
smime speed spkac srp
ts verify version x509
Message Digest commands (see the `dgst' command for more details)
blake2b512 blake2s256 gost md4
md5 mdc2 rmd160 sha1
sha224 sha256 sha384 sha512
Cipher commands (see the `enc' command for more details)
aes-128-cbc aes-128-ecb aes-192-cbc aes-192-ecb
aes-256-cbc aes-256-ecb base64 bf
bf-cbc bf-cfb bf-ecb bf-ofb
camellia-128-cbc camellia-128-ecb camellia-192-cbc camellia-192-ecb
camellia-256-cbc camellia-256-ecb cast cast-cbc
cast5-cbc cast5-cfb cast5-ecb cast5-ofb
des des-cbc des-cfb des-ecb
des-ede des-ede-cbc des-ede-cfb des-ede-ofb
des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb
des-ofb des3 desx idea
idea-cbc idea-cfb idea-ecb idea-ofb
rc2 rc2-40-cbc rc2-64-cbc rc2-cbc
rc2-cfb rc2-ecb rc2-ofb rc4
rc4-40 seed seed-cbc seed-cfb
seed-ecb seed-ofb
DBG> set b main
%DEBUG-E-NOPROCESSES, the current command is targetted at an empty process set
DBG>
So just because I want to give the program some arguments to work around, I can suddenly not debug? Is there a trick somewhere that I'm just not seeing?
Cheers,
Richard
Stephen Hoffman
2017-03-15 15:44:31 UTC
Permalink
Raw Message
Post by Richard Levitte
Debugging with the kept debugger seems to be an adventure...
...
Using kept debugging and the DSF and a few other parts of the debugger
are unnecessary for most debugging cases. Kept debugging and the
multiprocess debugger was useful when systems were slow and process
creation was slow, and it's still sometimes helpful when there's a
stack corruption around (sometimes, doesn't always get around that),
and a few other odd cases.
Post by Richard Levitte
So just because I want to give the program some arguments to work
around, I can suddenly not debug? Is there a trick somewhere that I'm
just not seeing?
I much prefer the simpler approach...

$ COMPILE /DEBUG /NOOPTIMIZE whatever
$ LINK /DEBUG whatever

then SET IMAGE disable debugging at Itanium image startup or patch the
Alpha executable to disable the debug flag at image startup,
...or use a DBG$INIT to get to a GO to prevent stopping at the debugger,
....and then invoke the image with RUN, or via a symbol or automatic
foreign command...
...or invoke the executable manually and enter a GO...

If the image is running without the debugger prompt available, then use
^C or ^Y and the DEBUG command, or embed a lib$signal of SS$_DEBUG in
the image to activate the debugger, or hit a breakpoint that's been set
or (for triple complexity points) send a signal or message to the
process to get it into the debugger...

If there's a need to debug detached processes, I usually use an
application-created DECterm for the character cell debugger, or a
dedicated serial port for the character cell debugger, or the
DECwindows debugger.

Having remote access to the debugger other than via character cell or
the DECwindows debugger UI would be handy, and at least one third-party
IDE was working on providing that as part of an IDE. Having all that
available in a VSI IDE would be handy, but that's a decade or more away
given how much other work is ahead of VSI.
--
Pure Personal Opinion | HoffmanLabs LLC
Loading...