HP3000-L Archives

November 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Gavin Scott <[log in to unmask]>
Reply To:
Gavin Scott <[log in to unmask]>
Date:
Mon, 20 Nov 2000 16:38:52 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (56 lines)
Emerson, Tom # El Monte writes:

> I'm encountering a strange problem calling the system intrinsic HPCIGETVAR
> from within a "C" program compiled with the gnu gcc compiler [2.95.2]  The
> program is aborting from within the SYSTEM code, not my user code, so it
> makes it difficult to debug "as a user"...
[...]
> One thing I did notice in the web-based documentation is that, so far as gcc
> is concerned, "#pragma intrinsic" isn't a valid pre-processor statement (the
> preprocessor simply ignores the line), so I'm curious -- is there a more
> appropriate mechanism in gcc to specify HP intrinsics?

This is indeed the problem.  Since gcc has no knowlege of the MPE Intrinsic
mechanism, you have to get the parameters right when you call an Intrinsic
from one of the Gnu languages.  This includes accounting for "hidden"
parameters, long versus short addresses, etc.

There are a number of ways of getting this information.  You can get a
listing of the SYSINTR file in a couple of different ways, or you can use a
tool like CSEQ (Calling SEQuence) from the Lund Toolbox product, or you can
write "helper" functions using HP's C, look at the actual parameters via
:DEBUG, etc.

FInding a more permanent solution to this problem is probably the most
popular enhancement request among our GCC support customers at the moment.

Looking at the code:

> HPCIGETVAR(varname,&status,
> 10,&strlen,
> 2, varvalu,
> 0, 0);

and the output from :CSEQ

Procedure HPCIGETVAR (
   Parm_0       : (# actual parameters)   {R26}
   varname      : anyvar record  ;        {R25}
   status       : anyvar record  ;        {R24, @32 -> 32} := nil
   keyword1     :        int32   ;        {R23} := 0
   keyvalue1    : anyvar record  ;        {SP-$0034} := nil
[...]

we see that the first parameter to HPCIGETVAR is a "hidden" integer
parameter (passed by value) indicating how many actual parameters are being
passed to this "extensible" Intrinsic.  So something like:

HPCIGETVAR(6, varname, &status, 10, &strlen, 2, varvalu);

Will probably work.  (I'm at home with a cold at the moment and my brain
isn't working well enough to actually go try this right now :-)

G.

www.gccsupport.com

ATOM RSS1 RSS2