* Ada + Assembly ...
@ 1997-06-20 0:00 Albert K. Lee
1997-06-23 0:00 ` Robert Dewar
0 siblings, 1 reply; 2+ messages in thread
From: Albert K. Lee @ 1997-06-20 0:00 UTC (permalink / raw)
I am trying to create a program with Ada and Assembly components on a
Pentium Linux (2.0.30) system with GNAT 3.09. I have achieved
successful linking, but the program segfaults at the point where the
Ada program calls the assembly language routine.
I've had previous experience with assembly only under DOS on a '286;
Linux on a 32-bit processor is quite a different environment. I am
using pragma Import with the C calling convention. For now, the
assembly routine (declared as a procedure) just does a 'ret'.
I compile first the Ada file to an object file using "gnatmake
<blah>.o", then I run the assembly file through gcc, then run
"gnatbind -x" on the .ali file, and finally run gnatlink on the .ali
file plus the assembly object file.
Since I am winging this mini-project (the only documentation I found
was in the RM), I'd rather see snippets of working code than have
others attempt to correct my error-filled trials.
One last note ... I made one or two simple programs using just
assembly (they simply do some register addition and exit, *without*
segfaulting, heh), but I cannot debug them (and check what they're
actually doing) under gdb 4.16 with GNAT extensions -- gdb reports "no
debugging symbols found" and "can't find a default source file". Yes,
I used the -g flag during compilation and linkage.
I'd really appreciate any pointers, hints, tips, or techniques. TIA
-Albert
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Ada + Assembly ...
1997-06-20 0:00 Ada + Assembly Albert K. Lee
@ 1997-06-23 0:00 ` Robert Dewar
0 siblings, 0 replies; 2+ messages in thread
From: Robert Dewar @ 1997-06-23 0:00 UTC (permalink / raw)
Albert asked
<<One last note ... I made one or two simple programs using just
assembly (they simply do some register addition and exit, *without*
segfaulting, heh), but I cannot debug them (and check what they're
actually doing) under gdb 4.16 with GNAT extensions -- gdb reports "no
debugging symbols found" and "can't find a default source file". Yes,
I used the -g flag during compilation and linkage.
>>
If you write in assembly, it is your responsibility to generate the
necessary debugging directives, the assembler will not do it for you!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1997-06-23 0:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-06-20 0:00 Ada + Assembly Albert K. Lee
1997-06-23 0:00 ` Robert Dewar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox