• Re: cc/lis/machine on OpenVMS x86_64 Operating System, Version V9.2-3;

    From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Mon Jul 21 14:22:29 2025
    (this did not make it to any of the NNTP servers I use, but it
    did hit INFO-VAX)

    I cannot see the machine code produced by the cc compiler:

    $ type test.lis
    Source Listing 20-JUL-2025 09:57:31
    VSI C x86-64 V7.6-001-50YAN Page 1
    20-JUL-2025 09:52:01 DKA100:[ZRIDE]TEST.C;1

    1 #include <stdio.h>
    1 1665 int main() {
    1 1666 printf("Hello world\n");
    1 1667 }


    Command Line
    ------- ----

    CC/LIS/MACHINE TEST.C

    Any ideas?

    $ cc test
    $ anal/obj/disasm/out=hello.lis hello

    VSI is trying to get it in release notes for all compilers.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Townley@21:1/5 to All on Mon Jul 21 20:11:22 2025
    On 21/07/2025 19:22, Arne Vajhøj wrote:
    (this did not make it to any of the NNTP servers I use, but it
    did hit INFO-VAX)

    I cannot see the machine code produced by the cc compiler:

    $ type test.lis
                                     Source Listing 20-JUL-2025 09:57:31
    VSI C x86-64 V7.6-001-50YAN       Page 1
    20-JUL-2025 09:52:01  DKA100:[ZRIDE]TEST.C;1

                   1 #include <stdio.h>
           1    1665 int main() {
           1    1666 printf("Hello world\n");
           1    1667 }


    Command Line
    ------- ----

    CC/LIS/MACHINE TEST.C

    Any ideas?

    $ cc test
    $ anal/obj/disasm/out=hello.lis hello

    VSI is trying to get it in release notes for all compilers.

    Arne


    I thought it was...

    --
    Chris

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Chris Townley on Mon Jul 21 15:25:58 2025
    On 7/21/2025 3:11 PM, Chris Townley wrote:
    On 21/07/2025 19:22, Arne Vajhøj wrote:
    $ cc test
    $ anal/obj/disasm/out=hello.lis hello

    VSI is trying to get it in release notes for all compilers.

    I thought it was...

    It is in all the recent ones I have seen.

    But I don't know if it is all and how far back it goes.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From hb0815@21:1/5 to All on Tue Jul 22 01:02:13 2025
    On 7/21/25 20:22, Arne Vajhøj wrote:

    $ cc test
    $ anal/obj/disasm/out=hello.lis hello

    The line numbers in the disassembler output refer to the line numbers in
    the listing. So you want to have a compiler listing file. You can append
    the disassembler output to it without creating a temporary file with a
    command like:

    $ pipe (cc/lis=sys$output test ;anal/disa test) |copy sys$pipe test.lis

    For convenience you can put it into a DCL script or define a DCL symbol:

    $ ccl:="pipe (cc/lis=sys$output &f ;anal/disa &f) |copy sys$pipe &f.lis"
    $ f:=test
    $ ccl

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Waldek Hebisch@21:1/5 to arne@vajhoej.dk on Mon Sep 1 19:59:27 2025
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 7/21/2025 3:11 PM, Chris Townley wrote:
    On 21/07/2025 19:22, Arne Vajhøj wrote:
    $ cc test
    $ anal/obj/disasm/out=hello.lis hello

    VSI is trying to get it in release notes for all compilers.

    I thought it was...

    It is in all the recent ones I have seen.

    But I don't know if it is all and how far back it goes.

    On Alpha:

    ANALYZ A01-07

    *** This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough. OTOH cc/list/machine_code works on Alpha...

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to Waldek Hebisch on Mon Sep 1 18:52:34 2025
    On 9/1/2025 3:59 PM, Waldek Hebisch wrote:
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 7/21/2025 3:11 PM, Chris Townley wrote:
    On 21/07/2025 19:22, Arne Vajhøj wrote:
    $ cc test
    $ anal/obj/disasm/out=hello.lis hello

    VSI is trying to get it in release notes for all compilers.

    I thought it was...

    It is in all the recent ones I have seen.

    But I don't know if it is all and how far back it goes.

    On Alpha:

    ANALYZ A01-07

    *** This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough. OTOH cc/list/machine_code works on Alpha...

    Itanium and x86-64 use ELF format.

    VAX and Alpha use the VMS custom "double var" format. But
    slightly different some definitions are xxx$ on VAX and
    Exxx$ on Alpha.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From hb0815@21:1/5 to All on Tue Sep 2 12:07:36 2025
    On 9/2/25 00:52, Arne Vajhøj wrote:
    On 9/1/2025 3:59 PM, Waldek Hebisch wrote:
    On Alpha:

    ANALYZ A01-07

    ***  This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough.  OTOH
    cc/list/machine_code works on Alpha...

    Itanium and x86-64 use ELF format.

    VAX and Alpha use the VMS custom "double var" format. But
    slightly different some definitions are xxx$ on VAX and
    Exxx$ on Alpha.

    This indicates, that for (VAX and) Alpha nobody saw the need for a
    disassembler (integrated into ANALYZE).

    I don't know if there are (freeware) tools that can disassemble such
    object files. (A quick search didn't find any. I'm sure ChatGPT can
    write one if you ask it!) It shouldn't be so hard (for VSI) to write
    such a tool. The debugger and SDA can disassemble: it's just a matter of knowing the API and calling the corresponding code (which as far as I
    can see is not exposed in a shareable image). But I doubt that anyone at
    VSI wants to spend the time to create such a tool for Alpha.

    If you really need to see the machine code that is in an object file,
    for which you don't have the source code ...

    In an own program, you can read the code psect(s) of the object
    module(s) into memory and start the debugger (remember the ZAP tool?) to disassemble it

    There is also SRM_CHECK. It can disassemble code sections in Alpha
    images. But that was not the main purpose of this tool. So I don't know
    how good the disassembly output really is. However it's available as
    freeware and the ZIP archive contains the source code.

    And yes, ANALYZE/DISASSEMBLE (/OBJECT is default) is only for ELF
    (Executable and Linkable Format) objects. There was obviously a need for
    this and adding a disassembler to a tool that already knew the format of
    the object module was the preferred solution.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Reagan@21:1/5 to Waldek Hebisch on Tue Sep 2 12:49:30 2025
    On 9/1/2025 3:59 PM, Waldek Hebisch wrote:
    Arne Vajhøj <arne@vajhoej.dk> wrote:
    On 7/21/2025 3:11 PM, Chris Townley wrote:
    On 21/07/2025 19:22, Arne Vajhøj wrote:
    $ cc test
    $ anal/obj/disasm/out=hello.lis hello

    VSI is trying to get it in release notes for all compilers.

    I thought it was...

    It is in all the recent ones I have seen.

    But I don't know if it is all and how far back it goes.

    On Alpha:

    ANALYZ A01-07

    *** This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough. OTOH cc/list/machine_code works on Alpha...


    The Alpha/Itanium compilers support /LIST/MACHINE. [The Itanium C++ uses ANAL/OBJ/DISASSEMBLE behind the scenes]. For x86, hacking LLVM to do
    BOTH an object file and a machine code listing is awkward. For x86
    compilers only, you can also say /SWITCH=ASSEMBLY and get an .S file and
    not an OBJ file. Most of the time the S file should work with llvm-mc,
    but all of the time [which is why we don't document it - long story]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Arne_Vajh=C3=B8j?=@21:1/5 to All on Tue Sep 2 16:05:09 2025
    On 9/2/2025 6:07 AM, hb0815 wrote:
    On 9/2/25 00:52, Arne Vajhøj wrote:
    On 9/1/2025 3:59 PM, Waldek Hebisch wrote:
    On Alpha:

    ANALYZ A01-07

    ***  This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough.  OTOH
    cc/list/machine_code works on Alpha...

    Itanium and x86-64 use ELF format.

    VAX and Alpha use the VMS custom "double var" format. But
    slightly different some definitions are xxx$ on VAX and
    Exxx$ on Alpha.

    This indicates, that for (VAX and) Alpha nobody saw the need for a disassembler (integrated into ANALYZE).

    I don't know if there are (freeware) tools that can disassemble such
    object files. (A quick search didn't find any. I'm sure ChatGPT can
    write one if you ask it!) It shouldn't be so hard (for VSI) to write
    such a tool. The debugger and SDA can disassemble: it's just a matter of knowing the API and calling the corresponding code (which as far as I
    can see is not exposed in a shareable image). But I doubt that anyone at
    VSI wants to spend the time to create such a tool for Alpha.

    If you really need to see the machine code that is in an object file,
    for which you don't have the source code ...

    DEC did not provide a disassembler.

    But at least for VAX other did:

    https://www.digiater.nl/openvms/freeware/v80/dism32/

    worked pretty well as I remember it.

    But Alpha is a different story.

    Arne

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Waldek Hebisch@21:1/5 to mw40171@mucweb.de on Tue Sep 2 23:53:50 2025
    hb0815 <mw40171@mucweb.de> wrote:
    On 9/2/25 00:52, Arne Vajhøj wrote:
    On 9/1/2025 3:59 PM, Waldek Hebisch wrote:
    On Alpha:

    ANALYZ A01-07

    ***  This file is not an ELF object file

    I guess that by VSI policy Alpha is not recent enough.  OTOH
    cc/list/machine_code works on Alpha...

    Itanium and x86-64 use ELF format.

    VAX and Alpha use the VMS custom "double var" format. But
    slightly different some definitions are xxx$ on VAX and
    Exxx$ on Alpha.

    This indicates, that for (VAX and) Alpha nobody saw the need for a disassembler (integrated into ANALYZE).

    I don't know if there are (freeware) tools that can disassemble such
    object files. (A quick search didn't find any. I'm sure ChatGPT can
    write one if you ask it!) It shouldn't be so hard (for VSI) to write
    such a tool. The debugger and SDA can disassemble: it's just a matter of knowing the API and calling the corresponding code (which as far as I
    can see is not exposed in a shareable image). But I doubt that anyone at
    VSI wants to spend the time to create such a tool for Alpha.

    objdump can disassemble, just use 'objdump -d' (or 'objdump -D' is you
    expect code in nominally non-code sections). Works for me
    with Alpha VMS .obj files (and executables). My main use is to check potentially confusing assembler mnemonics (which encoding is used
    by the assembler).

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)