From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,efc4d105e185aa1d X-Google-Attributes: gid103376,public From: husseinp@logica.co.uk (Paul Hussein) Subject: Re: Help ! - Problems with Ada/X (using Apex & Axi-Serc X-Bindings) Date: 1996/08/14 Message-ID: <4usfg2$eug@romeo.logica.co.uk>#1/1 X-Deja-AN: 174115055 references: <01bb87e1.6df84880$277c02cb@default> <32107A42.41C67EA6@escmail.orl.mmc.com> organization: Logica UK Ltd. newsgroups: comp.lang.ada Date: 1996-08-14T00:00:00+00:00 List-Id: Ted Dennison wrote: >Bernie Rossi wrote: >> >> 1. Trying to get a Widgetlist. >> In my program I would like to modify some attributes of some >> children widgets, so I need to get the widgetlist so that I >> can access them. The code in 'C' is; >> >> WidgetList children; /* Defining a pointer to a WidgetList >> */ >> >> XtVaGetValues(Form, XmNchildren, &children, NULL); /* Get Ptr */ >... >> >> When I re-write this in Ada the results are un-predicatble & wrong >> causing core dumps etc. Note the problem is getting the WidgetList >... >It might help if you posted the Ada code that isn't working, rather than >the C that is. Someone familiar with your compiler/binding combination >might be able to spot the problem right away. >> 2. Trying to Override the Resize of a Widget. >> The 'C' code is; >> >> XtActionsRec rec; /* Defining Structure */ >> >> rec.string = "resize"; /* Setting up of >> structure */ >> rec.proc = resize; >> XtAppAddActions(app, &rec, 1); /* Overriding Resize actions */ >> XtOverrideTranslations(Form, >> XtParseTranslationTable(": resize()")); >> >> static void resize(w, event, args, num_args) /* Procedure to re-size */ >... >> >> When I re-write this code in Ada it compiles and runs without a dump >> but produces a message saying something like "Action: resize not found". >> So obviously I haven't defined something properly? >Yes. Again it would be nice to see the _Ada_ code, but I highly suspect >that you left out the appropriate pragmas for the definition of your >resize procedure that would make the symbol for it visible to the outside >world. Such pragmas are compiler-dependant things, and I don't know what >Apex uses, so you'll have to check your compiler docs yourself to find the >appropriate pragmas to use. >Also, many compilers have restrictions on how procedures can be defined if >they are to be externally-callable. ie: Your callback procedures may have to >be declared at the top level of a package body. Again, check your compiler >docs. >It may help if you check the material that came with your X Bindings. There >ought to be an example using callbacks or a discussion on how to code them >somewhere in there. >-- >T.E.D. > | Work - mailto:dennison@escmail.orl.mmc.com | > | Home - mailto:dennison@iag.net | > | URL - http://www.iag.net/~dennison | I agree, please post ADA code as this is more useful. Have you spoken to bindingd suppliers or looked in another bindings suppliers bindings to see how they perform call. It may even be something like a non null-terminated string. If the ADA is correct, it could be that you are getting a storag_error which is manifesting itself in a sigsegv. Try upping stack size of caller task. Also another good approach would be to write the problem bit in C and pragma interface to it to check that everything else is working OK.