Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with image linked to CLD-module on IA64

 
SOLVED
Go to solution
Cor Mom
Advisor

Problem with image linked to CLD-module on IA64

Hi,

I have a problem with an image that has been linked to the object file of a CLD-module.
The CLD-module has been compiled with:
SET COMMAND/OBJECT mytool$commands

In the calling C-module:
#ifdef __ia64
extern void *mytool$commands;
#else
int mytool$commands();
#endif

and

#ifdef __ia64
status = CLI$DCL_PARSE(&line_descr,
&mytool$commands,
LIB$GET_INPUT,
LIB$GET_INPUT,
0);
#else
status = CLI$DCL_PARSE(&line_descr,
mytool$commands,
LIB$GET_INPUT,
LIB$GET_INPUT,
0);
#endif

Linking gives no messages, but running this images results in an access violation when calling the CLI$DCL_PARSE. Has anybody an idea how to solve this problem?

Thanks.

Cor Mom
OpenVMS - Nothing stops it
6 REPLIES
Steven Schweda
Honored Contributor

Re: Problem with image linked to CLD-module on IA64

I don't claim to know anything, but why are
the declarations and "&" usage different on
IA64? Sounds wrong to me.
Joseph Huber_1
Honored Contributor

Re: Problem with image linked to CLD-module on IA64

Yes definitely, in the ia64 case You are passing a pointer to the pointer to mytool$commands, not the pointer to mytools$commands.

As Steven said, why should C be different on ia64 ?
http://www.mpp.mpg.de/~huber
Kris Clippeleyr
Honored Contributor
Solution

Re: Problem with image linked to CLD-module on IA64

Cor,
This is what I did when writing QDSB.

In the .CLD file

MODULE QDSB_CLD
DEFINE VERB QDSB
...

In the C module that parses the command line:

globalref void *QDSB_CLD;
...
unsigned int sts;
struct descriptor_s cmd_d;
...
sts = cli$dcl_parse (
&cmd_d
, (void **) &QDSB_CLD
, lib$get_input
, lib$get_input
, 0
);

Works like a charm on all three architectures.

Regards,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Cor Mom
Advisor

Re: Problem with image linked to CLD-module on IA64

It also sounds weird to me, but I copied it from:

Hoff Hoffman, 03-25-2005, 05:05 PM
http://www.techiegroups.com/t56450-p-cld-symbol-table-object-on-itanium.html

And for C references for cli$dcl_parse, here is what I am using:


...
extern void *mumble$$CLI_TABLES;
...

Do remember you need to use `&mumble$$CLI_TABLES' to reference the
external symbol in the cli$dcl_parse call; you need to pass it by
reference.

I will give your idea a try Kris


OpenVMS - Nothing stops it
Cor Mom
Advisor

Re: Problem with image linked to CLD-module on IA64

Kris,

It works. Thanks a lot!

regards,
Cor
OpenVMS - Nothing stops it
Joseph Huber_1
Honored Contributor

Re: Problem with image linked to CLD-module on IA64

I have to withdraw my stupid comment, didn't see the () making mytool$commands a (pointer to) a routine.
http://www.mpp.mpg.de/~huber