mknight
mknight

Reputation: 45

How can i make GNAT generate program listing?

Make it look like tasm-generated listing)

Upvotes: 1

Views: 406

Answers (2)

Jacob Sparre Andersen
Jacob Sparre Andersen

Reputation: 6611

Call 'gnatmake' with '-S' as one of the arguments:

$ cat hello_world.adb
with Ada.Text_IO;

procedure Hello_World is
begin
   Ada.Text_IO.Put_Line ("Hello world!");
end Hello_World;
$ gnatmake -S hello_world
[...]
$ head hello_world.s
        .file       "hello_world.adb"
        .section    .rodata
.LC1:
        .ascii      "Hello world!"
        .align 4
.LC0:
        .long       1
        .long       12
        .text
        .globl      _ada_hello_world

Upvotes: 3

T.E.D.
T.E.D.

Reputation: 44824

According to the docs,

Any uppercase or multi-character switch that is not a gnatmake switch is passed to gcc (e.g. -O, -gnato, etc.)

, so you would probably do it the exact same way you'd do it with gcc.

I don't know the exact format you refer to, but -gnatl looks interesting.

Upvotes: 2

Related Questions