Discussion:
How is the Debugging Symbol File supposed to be used?
(too old to reply)
Richard Levitte
2017-03-14 22:56:49 UTC
Permalink
Raw Message
Hi,

I'm trying to read the debugger manual, and the example in there tells me this:

$ CC/DEBUG/NOOPTIMIZE TESTPROGRAM
$ LINK/DSF=TESTDISK:[TESTDIR]TESTPROGRAM.DSF TESTPROGRAM
$ DEFINE DBG$IMAGE_DSF_PATH TESTDISK:[TESTDIR]
$ DEBUG/KEEP TESTPROGRAM

So I'm trying the same with OpenSSL (after having compiler with /debug and linked with /dsf):

$ sh log dbg$image_dsf_path
"DBG$IMAGE_DSF_PATH" = "PROGRAM:[LEVITTE-BUILDS.OPENSSL-EXPERIMENTAL.ALIKGB]"
(LNM$PROCESS_TABLE)
$ sh sym DIR
DIR == "DIRECTORY/SIZE=ALL/DATE=CREATED/PROT"
$ dir dbg$image_dsf_path:openssl.dsf

Directory PROGRAM:[LEVITTE-BUILDS.OPENSSL-EXPERIMENTAL.ALIKGB]

OPENSSL.DSF;2 15245/15288 14-MAR-2017 23:45:49.15 (RWED,RWED,RE,RE)
OPENSSL.DSF;1 15245/15288 14-MAR-2017 23:33:26.41 (RWED,RWED,RE,RE)

Total of 2 files, 30490/30576 blocks.
$ dir [.apps]openssl.exe

Directory PROGRAM:[LEVITTE-BUILDS.OPENSSL-EXPERIMENTAL.ALIKGB.apps]

OPENSSL.EXE;1 3669/3675 14-MAR-2017 23:45:49.28 (RWED,RWED,RE,RE)

Total of 1 file, 3669/3675 blocks.

So ok, let's try this:

$ run [.apps]openssl.exe
OpenSSL> *EXIT*
$ debug/keep

OpenVMS I64 Debug64 Version V8.4-002


DBG> run [.apps]openssl.exe
%DEBUG-I-NODSTS, no Debugger Symbol Table: no DSF file found and
-DEBUG-I-NODSTIMG, no symbols in PROGRAM:[LEVITTE-BUILDS.OPENSSL-EXPERIMENTAL.ALIKGB.apps]OPENSSL.EXE;1
%DEBUG-I-INITIAL, Language: C, Module: OPENSSL
%DEBUG-I-NOTATMAIN, Type GO to reach MAIN program
DBG>

... and this is where I go "whaddyamean 'no Debugger Symbol Table'?????"

Does someone want to try shedding some light on this?

A note, [.APPS]OPENSSL.EXE is linked with shareable images for the OpenSSL libraries. This should take care of that:

$ sh log ossl*

(LNM$PROCESS_TABLE)

"OSSL$LIBCRYPTO0101_SHR" = "PROGRAM:[LEVITTE-BUILDS.OPENSSL-EXPERIMENTAL.ALIKGB]OSSL$LIBCRYPTO0101_SHR.EXE"
"OSSL$LIBSSL0101_SHR" = "PROGRAM:[LEVITTE-BUILDS.OPENSSL-EXPERIMENTAL.ALIKGB]OSSL$LIBSSL0101_SHR.EXE"
...
$ dir dbg$image_dsf_path:ossl*.exe;

Directory PROGRAM:[LEVITTE-BUILDS.OPENSSL-EXPERIMENTAL.ALIKGB]

OSSL$LIBCRYPTO0101_SHR.EXE;1
17983/17983 14-MAR-2017 23:32:01.50 (RWED,RWED,RE,RE)
OSSL$LIBSSL0101_SHR.EXE;1
3346/3381 14-MAR-2017 23:32:08.09 (RWED,RWED,RE,RE)

Total of 2 files, 21329/21364 blocks.

Cheers,
Richard ( VSI OpenVMS V8.4-2L1 )
Stephen Hoffman
2017-03-14 23:21:10 UTC
Permalink
Raw Message
Some background? Are you exploring the debugger manual and/or
exploring the DSF implementation, or are you "just" trying to debug
some code?

Because if it's the latter, the DSF isn't necessary.
Post by Richard Levitte
DBG> run [.apps]openssl.exe
%DEBUG-I-NODSTS, no Debugger Symbol Table: no DSF file found and
-DEBUG-I-NODSTIMG, no symbols in
PROGRAM:[LEVITTE-BUILDS.OPENSSL-EXPERIMENTAL.ALIKGB.apps]OPENSSL.EXE;1
%DEBUG-I-INITIAL, Language: C, Module: OPENSSL
%DEBUG-I-NOTATMAIN, Type GO to reach MAIN program
DBG>
...
Does someone want to try shedding some light on this?
I usually compile and link with /DEBUG when that's feasible, and don't
bother with the DSF.

Is it possible that there's an "OPENSSL" logical name defined around
here, and that's interfering with this sequence? Your RUN command
avoids translating that logical name (if it has been defined), but
subsequent translation attempts can still occur within the context of
the debugger. Try using a different name for the test program? Or
remove the logical name and test the debugger again?
--
Pure Personal Opinion | HoffmanLabs LLC
Richard Levitte
2017-03-14 23:41:19 UTC
Permalink
Raw Message
Post by Stephen Hoffman
I usually compile and link with /DEBUG when that's feasible, and don't
bother with the DSF.
I'm trying to get away from the total pain of having the debugger started as soon as I MCR the program. (I MCR because RUN won't allow me to give the program arguments). What I want to achieve is to debug when *I* choose to, not when the image activator chooses to.
Post by Stephen Hoffman
Is it possible that there's an "OPENSSL" logical name defined around
here, and that's interfering with this sequence?
Ah! Renaming OPENSSL.EXE to OPENSSL1.EXE and OPENSSL.DSF to OPENSSL1.DSF cleared this up, so yeah, that was the probable cause.

Thank you.

Cheers,
Richard
Stephen Hoffman
2017-03-14 23:45:17 UTC
Permalink
Raw Message
Post by Richard Levitte
Post by Stephen Hoffman
I usually compile and link with /DEBUG when that's feasible, and don't
bother with the DSF.
I'm trying to get away from the total pain of having the debugger
started as soon as I MCR the program. (I MCR because RUN won't allow
me to give the program arguments). What I want to achieve is to debug
when *I* choose to, not when the image activator chooses to.
Given you're on Itanium, issue SET IMAGE /FLAGS=( [NO]CALL_DEBUG,
[NO]DBG_IN_DSF, [NO]DBG_IN_IMG) as appropriate, and have at.
--
Pure Personal Opinion | HoffmanLabs LLC
Richard Levitte
2017-03-14 23:53:26 UTC
Permalink
Raw Message
Post by Stephen Hoffman
Given you're on Itanium, issue SET IMAGE /FLAGS=( [NO]CALL_DEBUG,
[NO]DBG_IN_DSF, [NO]DBG_IN_IMG) as appropriate, and have at.
Ok cool, didn't know about those... and I see the same can be used on Alpha as well. Soooo, I assume that if I LINK/DEBUG instead of /DSF and do SET IMAGE /FLAGS=NOCALL_DEBUG on my images, I might have better luck with the kept debugger too?

Cheers,
Richard
hb
2017-03-15 08:06:40 UTC
Permalink
Raw Message
Post by Richard Levitte
Ok cool, didn't know about those... and I see the same can be used on Alpha as well. Soooo, I assume that if I LINK/DEBUG instead of /DSF and do SET IMAGE /FLAGS=NOCALL_DEBUG on my images, I might have better luck with the kept debugger too?
On Alpha you can set the flags for an I64 image, not for an Alpha image.

$ HELP SET IMAGE
...
This command can be used to modify the initial values set by the
OpenVMS Integrity servers Linker for certain image attributes.
^^^^^^^^^^^^^^^^^^^^^^^^
Richard Levitte
2017-03-15 11:58:36 UTC
Permalink
Raw Message
Post by hb
Post by Richard Levitte
Ok cool, didn't know about those... and I see the same can be used on Alpha as well. Soooo, I assume that if I LINK/DEBUG instead of /DSF and do SET IMAGE /FLAGS=NOCALL_DEBUG on my images, I might have better luck with the kept debugger too?
On Alpha you can set the flags for an I64 image, not for an Alpha image.
$ HELP SET IMAGE
...
This command can be used to modify the initial values set by the
OpenVMS Integrity servers Linker for certain image attributes.
^^^^^^^^^^^^^^^^^^^^^^^^
Yeah, I noticed...

Richard Levitte
2017-03-14 23:49:54 UTC
Permalink
Raw Message
Post by Richard Levitte
Ah! Renaming OPENSSL.EXE to OPENSSL1.EXE and OPENSSL.DSF to OPENSSL1.DSF cleared this up, so yeah, that was the probable cause.
The next step, this with the kept debugger, is how to debug a program with program arguments. It seems that no matter what I do, trying to run with arguments will simply run the program and not allow me to debug, will ignore any breakpoints I might have set, etc...

$ DEBUG/KEEP
DBG> run [.apps]openssl1.exe
%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> step
stepped to OPENSSL\main\%LINE 60148 in THREAD 1
60148: int first, n, i, ret = 0;
DBG> rerun/arg="help"

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> run /arg="help" [.apps]openssl1.exe

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>

Cheers,
Richard
Craig A. Berry
2017-03-14 23:40:38 UTC
Permalink
Raw Message
Post by Richard Levitte
$ run [.apps]openssl.exe
OpenSSL> *EXIT*
$ debug/keep
OpenVMS I64 Debug64 Version V8.4-002
DBG> run [.apps]openssl.exe
%DEBUG-I-NODSTS, no Debugger Symbol Table: no DSF file found and
-DEBUG-I-NODSTIMG, no symbols in PROGRAM:[LEVITTE-BUILDS.OPENSSL-EXPERIMENTAL.ALIKGB.apps]OPENSSL.EXE;1
%DEBUG-I-INITIAL, Language: C, Module: OPENSSL
%DEBUG-I-NOTATMAIN, Type GO to reach MAIN program
DBG>
I have no idea why it doesn't work as documented, but SET WATCH FILE
could reveal where it thinks the DSF file should be, or at least where
it's looking for it and not finding it.
Loading...