• Supported debug info formats

    From Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Fri Jan 9 12:25:50 2026
    From Newsgroup: comp.os.msdos.djgpp

    Hi,

    GDB maintainer here. I'm in the process of cleaning up obsolete things,
    like debug info formats that are not longer relevant. I am now looking
    at COFF [1]. I am wondering if this is still useful for DJGPP, or if
    nowadays you can use DWARF like most other targets (or if people use GDB
    for DJGPP at all).

    In the gcc source code [1] I see this, so I guess that DWARF 2 is the
    default debug format now?

    /* Support generation of DWARF2 debugging info. */
    #define DWARF2_DEBUGGING_INFO 1

    #undef PREFERRED_DEBUGGING_TYPE
    #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG

    ..

    /* Don't emit DWARF3/4 unless specifically selected. */ \
    /* DWARF3/4 currently does not work for DJGPP. */ \
    if (!OPTION_SET_P (dwarf_version)) \
    dwarf_version = 2; \
    \
    } \

    Note that I am only talking about the debug info aspects of COFF,
    there are probably some things in coffread.c that would still be needed
    in order to read executable files on Windows and/or DJGPP.

    Thanks,

    Simon

    [1] https://gitlab.com/gnutools/gcc/-/blob/c10076b34d3ede485bfb306b2a91feeee8368cd5/gcc/config/i386/djgpp.h#L20-24
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From DJ Delorie (dj@delorie.com) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Fri Jan 9 12:33:00 2026
    From Newsgroup: comp.os.msdos.djgpp


    IIRC we switched to dwarf a long time ago. We still use COFF for some
    internal things, but I think gdb doesn't need to worry about it any
    more.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com]@djgpp@delorie.com to DJ Delorie on Fri Jan 9 12:39:22 2026
    From Newsgroup: comp.os.msdos.djgpp

    On 1/9/26 12:33 PM, DJ Delorie wrote:

    IIRC we switched to dwarf a long time ago. We still use COFF for some internal things, but I think gdb doesn't need to worry about it any
    more.

    Ok thanks, I will propose a patch to remove the obsolete stuff from
    coffread.c. Is it fine if I CC you on it so you can verify that it
    doesn't remove anything still important?

    Simon
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From DJ Delorie (dj@delorie.com) [via djgpp@delorie.com]@djgpp@delorie.com to Simon Marchi on Fri Jan 9 12:40:14 2026
    From Newsgroup: comp.os.msdos.djgpp

    Simon Marchi <simon.marchi@polymtl.ca> writes:
    Ok thanks, I will propose a patch to remove the obsolete stuff from coffread.c. Is it fine if I CC you on it so you can verify that it
    doesn't remove anything still important?

    I've been out of the loop so long I don't think my opinion would be
    useful any more ;-)
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com]@djgpp@delorie.com to DJ Delorie (dj@delorie.com) [via djgpp@delorie.com] on Fri Jan 9 12:53:24 2026
    From Newsgroup: comp.os.msdos.djgpp

    On 1/9/26 12:40 PM, DJ Delorie (dj@delorie.com) [via djgpp@delorie.com] wrote:
    Simon Marchi <simon.marchi@polymtl.ca> writes:
    Ok thanks, I will propose a patch to remove the obsolete stuff from
    coffread.c. Is it fine if I CC you on it so you can verify that it
    doesn't remove anything still important?

    I've been out of the loop so long I don't think my opinion would be
    useful any more ;-)

    All right, thanks for the information :). I will do the change and hope
    for the best (because I can't easily test).

    In case you would like to update it, this section of the FAQ talks about
    COFF and stabs debug info.

    https://www.delorie.com/djgpp/v2faq/faq12_1.html

    Simon
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Louis Santillan (lpsantil@gmail.com) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Fri Jan 9 15:22:23 2026
    From Newsgroup: comp.os.msdos.djgpp

    --000000000000e388750647fcccbd
    Content-Type: text/plain; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    There's a few other communities that care about this toolchain. I'd ask
    that you make an announcement there as well. I don't think COFF is a big
    part of their use cases but it might be helpful to announce anyways.

    https://github.com/andrewwutw/build-djgpp

    https://gitlab.com/tkchia/gcc-ia16
    https://gitlab.com/tkchia/build-ia16
    https://gitlab.com/tkchia/binutils-ia16

    https://github.com/ghaerr/elks

    On Fri, Jan 9, 2026 at 9:53=E2=80=AFAM Simon Marchi (simon.marchi@polymtl.c=
    a) [via
    djgpp@delorie.com] <djgpp@delorie.com> wrote:

    On 1/9/26 12:40 PM, DJ Delorie (dj@delorie.com) [via djgpp@delorie.com] wrote:
    Simon Marchi <simon.marchi@polymtl.ca> writes:
    Ok thanks, I will propose a patch to remove the obsolete stuff from
    coffread.c. Is it fine if I CC you on it so you can verify that it
    doesn't remove anything still important?

    I've been out of the loop so long I don't think my opinion would be
    useful any more ;-)

    All right, thanks for the information :). I will do the change and hope
    for the best (because I can't easily test).

    In case you would like to update it, this section of the FAQ talks about
    COFF and stabs debug info.

    https://www.delorie.com/djgpp/v2faq/faq12_1.html

    Simon


    --000000000000e388750647fcccbd
    Content-Type: text/html; charset="UTF-8"
    Content-Transfer-Encoding: quoted-printable

    <div dir=3D"ltr">There&#39;s a few other communities that care about this t= oolchain.=C2=A0 I&#39;d ask that you make an announcement there as well.=C2= =A0 I don&#39;t think COFF is a big part of their use cases but it might be=
    helpful to announce anyways.<br><br><a href=3D"https://github.com/andrewwu= tw/build-djgpp">https://github.com/andrewwutw/build-djgpp</a><br><br><a hre= f=3D"https://gitlab.com/tkchia/gcc-ia16">https://gitlab.com/tkchia/gcc-ia16= </a><br><a href=3D"https://gitlab.com/tkchia/build-ia16">https://gitlab.com= /tkchia/build-ia16</a><br><a href=3D"https://gitlab.com/tkchia/binutils-ia1= 6">https://gitlab.com/tkchia/binutils-ia16</a><br><br><a href=3D"https://gi= thub.com/ghaerr/elks">https://github.com/ghaerr/elks</a></div><br><div clas= s=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_att= r">On Fri, Jan 9, 2026 at 9:53=E2=80=AFAM Simon Marchi (<a href=3D"mailto:s= imon.marchi@polymtl.ca">simon.marchi@polymtl.ca</a>) [via <a href=3D"mailto= :djgpp@delorie.com">djgpp@delorie.com</a>] &lt;<a href=3D"mailto:djgpp@delo= rie.com">djgpp@delorie.com</a>&gt; wrote:<br></div><blockquote class=3D"gma= il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2= 04,204);padding-left:1ex">On 1/9/26 12:40 PM, DJ Delorie (<a href=3D"mailto= :dj@delorie.com" target=3D"_blank">dj@delorie.com</a>) [via <a href=3D"mail= to:djgpp@delorie.com" target=3D"_blank">djgpp@delorie.com</a>] wrote:<br>
    &gt; Simon Marchi &lt;<a href=3D"mailto:simon.marchi@polymtl.ca" target=3D"= _blank">simon.marchi@polymtl.ca</a>&gt; writes:<br>
    &gt;&gt; Ok thanks, I will propose a patch to remove the obsolete stuff fro= m<br>
    &gt;&gt; coffread.c.=C2=A0 Is it fine if I CC you on it so you can verify t= hat it<br>
    &gt;&gt; doesn&#39;t remove anything still important?<br>
    &gt; <br>
    &gt; I&#39;ve been out of the loop so long I don&#39;t think my opinion wou=
    ld be<br>
    &gt; useful any more ;-)<br>

    All right, thanks for the information :).=C2=A0 I will do the change and ho= pe<br>
    for the best (because I can&#39;t easily test).<br>

    In case you would like to update it, this section of the FAQ talks about<br=

    COFF and stabs debug info.<br>

    <a href=3D"https://www.delorie.com/djgpp/v2faq/faq12_1.html" rel=3D"norefer= rer" target=3D"_blank">https://www.delorie.com/djgpp/v2faq/faq12_1.html</a>=


    Simon<br>
    </blockquote></div>

    --000000000000e388750647fcccbd--
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Rugxulo (rugxulo@gmail.com) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Fri Jan 9 22:33:12 2026
    From Newsgroup: comp.os.msdos.djgpp

    Hi,

    On Fri, Jan 9, 2026 at 5:23rC>PM Louis Santillan (lpsantil@gmail.com)
    [via djgpp@delorie.com] <djgpp@delorie.com> wrote:

    There's a few other communities that care about this toolchain. I'd ask that you make an announcement
    there as well. I don't think COFF is a big part of their use cases but it might be helpful to announce anyways.

    DJGPP did get a new GNU Emacs build (from Eli Z.) back in August,
    right? That uses COFF-specific unexec(), IIRC.

    Also, don't forget the Free Pascal (Go32v2) and FreeBASIC compilers.
    (But I'd have to check what specific GDB versions they come with.)

    * https://www.freepascal.org/
    * https://freebasic.net/forum/viewforum.php?f=4&sid=c685fd2ae864d20c31fb4883a640380c

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Sat Jan 10 11:10:28 2026
    From Newsgroup: comp.os.msdos.djgpp

    Date: Fri, 9 Jan 2026 12:25:50 -0500
    From: "Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com]" <djgpp@delorie.com>

    GDB maintainer here. I'm in the process of cleaning up obsolete things,
    like debug info formats that are not longer relevant. I am now looking
    at COFF [1]. I am wondering if this is still useful for DJGPP, or if nowadays you can use DWARF like most other targets (or if people use GDB
    for DJGPP at all).

    In the gcc source code [1] I see this, so I guess that DWARF 2 is the
    default debug format now?

    GCC tossed COFF debug info some time ago, so I think it's okay to
    remove that from GDB as well.

    We used to need this for building the DJGPP port of Emacs, but that is
    no longer required, since the next release 31.1 of Emacs will no
    longer force or need the -gcoff switch to GCC. So that reason is also
    no more valid.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Sat Jan 10 11:17:46 2026
    From Newsgroup: comp.os.msdos.djgpp

    Date: Fri, 9 Jan 2026 12:39:22 -0500
    From: "Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com]" <djgpp@delorie.com>

    On 1/9/26 12:33 PM, DJ Delorie wrote:

    IIRC we switched to dwarf a long time ago. We still use COFF for some internal things, but I think gdb doesn't need to worry about it any
    more.

    Ok thanks, I will propose a patch to remove the obsolete stuff from coffread.c. Is it fine if I CC you on it so you can verify that it
    doesn't remove anything still important?

    According to gdb/MAINTAINERS:

    Host/Native:
    [...]
    djgpp native Eli Zaretskii eliz@gnu.org

    Please do CC djgpp@delorie.com, though.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Sat Jan 10 11:21:26 2026
    From Newsgroup: comp.os.msdos.djgpp

    Date: Fri, 9 Jan 2026 12:53:24 -0500
    From: "Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com]" <djgpp@delorie.com>

    In case you would like to update it, this section of the FAQ talks about
    COFF and stabs debug info.

    https://www.delorie.com/djgpp/v2faq/faq12_1.html

    What do you think needs to be updated there? Old versions of GCC and
    GDB, which support COFF and stabs debug info are still available from
    the DJGPP download sites, so people could use them if they need that.
    And the DWARF debug info is mentioned there already.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Sat Jan 10 09:24:18 2026
    From Newsgroup: comp.os.msdos.djgpp



    On 2026-01-10 04:21, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] wrote:
    Date: Fri, 9 Jan 2026 12:53:24 -0500
    From: "Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com]" <djgpp@delorie.com>

    In case you would like to update it, this section of the FAQ talks about
    COFF and stabs debug info.

    https://www.delorie.com/djgpp/v2faq/faq12_1.html

    What do you think needs to be updated there? Old versions of GCC and
    GDB, which support COFF and stabs debug info are still available from
    the DJGPP download sites, so people could use them if they need that.
    And the DWARF debug info is mentioned there already.

    Using a modern gcc, if somebody tries to use -gstabs as first suggested,
    won't they get an error saying it's not supported?

    The text indeed talks about DWARF, but I interpreted it as "GCC doesn't currently support DWARF for DJGPP but it might one day". From what you
    said, I understood thought that DWARF has been available for DJGPP for a
    long time now.

    Simon
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Sat Jan 10 17:40:47 2026
    From Newsgroup: comp.os.msdos.djgpp

    Date: Sat, 10 Jan 2026 09:24:18 -0500
    From: "Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com]" <djgpp@delorie.com>



    On 2026-01-10 04:21, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] wrote:
    Date: Fri, 9 Jan 2026 12:53:24 -0500
    From: "Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com]" <djgpp@delorie.com>

    In case you would like to update it, this section of the FAQ talks about >> COFF and stabs debug info.

    https://www.delorie.com/djgpp/v2faq/faq12_1.html

    What do you think needs to be updated there? Old versions of GCC and
    GDB, which support COFF and stabs debug info are still available from
    the DJGPP download sites, so people could use them if they need that.
    And the DWARF debug info is mentioned there already.

    Using a modern gcc, if somebody tries to use -gstabs as first suggested, won't they get an error saying it's not supported?

    That's true, but how can we do better, given that people could use a
    wide variety of GCC and GDB versions?

    The text indeed talks about DWARF, but I interpreted it as "GCC doesn't currently support DWARF for DJGPP but it might one day". From what you
    said, I understood thought that DWARF has been available for DJGPP for a
    long time now.

    Yes.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Rugxulo (rugxulo@gmail.com) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Sat Jan 10 10:50:54 2026
    From Newsgroup: comp.os.msdos.djgpp

    Hi again,

    On Fri, Jan 9, 2026 at 10:33rC>PM Rugxulo <rugxulo@gmail.com> wrote:

    Also, don't forget the Free Pascal (Go32v2) and FreeBASIC compilers.
    (But I'd have to check what specific GDB versions they come with.)

    FreeBASIC 1.10.1 (2023-12-24) comes with GDB 7.7.1 circa 2014 (built?? 2023-12-22), stub says "2.05" (2015-06-08).

    Free Pascal 3.2.2 (from 2021) has GDB 8.0.1 (circa 2017) but dated 2021.

    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Mon Jan 12 15:25:06 2026
    From Newsgroup: comp.os.msdos.djgpp



    On 2026-01-10 11:50, Rugxulo (rugxulo@gmail.com) [via djgpp@delorie.com] wrote:
    Hi again,

    On Fri, Jan 9, 2026 at 10:33rC>PM Rugxulo <rugxulo@gmail.com> wrote:

    Also, don't forget the Free Pascal (Go32v2) and FreeBASIC compilers.
    (But I'd have to check what specific GDB versions they come with.)

    FreeBASIC 1.10.1 (2023-12-24) comes with GDB 7.7.1 circa 2014 (built?? 2023-12-22), stub says "2.05" (2015-06-08).

    Free Pascal 3.2.2 (from 2021) has GDB 8.0.1 (circa 2017) but dated 2021.

    I know that Free Pascal has some DWARF support (because of [1]).

    I just downloaded FreeBASIC and built a sample program with -g, it
    produced DWARF 5.

    Simon

    [1] https://gitlab.com/gnutools/binutils-gdb/-/commit/a8ea3fb759651f97e0340c30b200b7389daf436d
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Robert Sundling (rjs-djgpp@zensoft.com) [via djgpp@delorie.com]@djgpp@delorie.com to djgpp on Mon Jan 12 16:50:09 2026
    From Newsgroup: comp.os.msdos.djgpp

    This is a multi-part message in MIME format. --------------l0qssaH50nFaCdJA6uCOHq3F
    Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit

    Hi Simon,

    Just to add another data point: I use DJGPP extensively for quite a few closed-source DOS projects. My workflow involves using modern GCC (and
    Clang) cross-compilers, targeting i686-pc-msdosdjgpp, with
    cross-compiled DJGPP tools used to create the final executable files.

    I just double checked all of my projects. I am using DWARF Version 5 in
    all of them (generally using objcopy to split symbols into separate .dbg files). Modern DWARF works flawlessly for me, so removing COFF debug
    info support from GDB would not affect my workflow.

    I also make extensive use of NASM [1] in these projects, but when
    generating COFF object files (needed to link with the other files), NASM cannot output debugging information of any kind, so that also does not
    matter.

    Robert

    [1] https://www.nasm.us/


    On 1/9/2026 11:25 AM, Simon Marchi (simon.marchi@polymtl.ca) [via djgpp@delorie.com] wrote:
    Hi,

    GDB maintainer here. I'm in the process of cleaning up obsolete things,
    like debug info formats that are not longer relevant. I am now looking
    at COFF [1]. I am wondering if this is still useful for DJGPP, or if nowadays you can use DWARF like most other targets (or if people use GDB
    for DJGPP at all).

    In the gcc source code [1] I see this, so I guess that DWARF 2 is the
    default debug format now?

    /* Support generation of DWARF2 debugging info. */
    #define DWARF2_DEBUGGING_INFO 1

    #undef PREFERRED_DEBUGGING_TYPE
    #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG

    ...

    /* Don't emit DWARF3/4 unless specifically selected. */ \
    /* DWARF3/4 currently does not work for DJGPP. */ \
    if (!OPTION_SET_P (dwarf_version)) \
    dwarf_version = 2; \
    \
    } \

    Note that I am only talking about the debug info aspects of COFF,
    there are probably some things in coffread.c that would still be needed
    in order to read executable files on Windows and/or DJGPP.

    Thanks,

    Simon

    [1]https://gitlab.com/gnutools/gcc/-/blob/c10076b34d3ede485bfb306b2a91feeee8368cd5/gcc/config/i386/djgpp.h#L20-24

    --------------l0qssaH50nFaCdJA6uCOHq3F
    Content-Type: text/html; charset=UTF-8
    Content-Transfer-Encoding: 7bit

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body text="#000000" bgcolor="#FFFFFF">
    Hi Simon,<br>
    <br>
    Just to add another data point: I use DJGPP extensively for quite a
    few closed-source DOS projects. My workflow involves using modern
    GCC (and Clang) cross-compilers, targeting i686-pc-msdosdjgpp, with
    cross-compiled DJGPP tools used to create the final executable
    files.<br>
    <br>
    I just double checked all of my projects. I am using DWARF Version 5
    in all of them (generally using objcopy to split symbols into
    separate .dbg files). Modern DWARF works flawlessly for me, so
    removing COFF debug info support from GDB would not affect my
    workflow.<br>
    <br>
    I also make extensive use of NASM [1] in these projects, but when
    generating COFF object files (needed to link with the other files),
    NASM cannot output debugging information of any kind, so that also
    does not matter.<br>
    <br>
    Robert<br>
    <br>
    [1] <a class="moz-txt-link-freetext" href="https://www.nasm.us/">https://www.nasm.us/</a><br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 1/9/2026 11:25 AM, Simon Marchi
    (<a class="moz-txt-link-abbreviated" href="mailto:simon.marchi@polymtl.ca">simon.marchi@polymtl.ca</a>) [via <a class="moz-txt-link-abbreviated" href="mailto:djgpp@delorie.com">djgpp@delorie.com</a>] wrote:<br>
    </div>
    <blockquote type="cite"
    cite="mid:0752ebcc-24dd-4ea1-ad68-7822463d0eda@polymtl.ca">
    <pre wrap="" class="moz-quote-pre">Hi,

    GDB maintainer here. I'm in the process of cleaning up obsolete things,
    like debug info formats that are not longer relevant. I am now looking
    at COFF [1]. I am wondering if this is still useful for DJGPP, or if
    nowadays you can use DWARF like most other targets (or if people use GDB
    for DJGPP at all).

    In the gcc source code [1] I see this, so I guess that DWARF 2 is the
    default debug format now?

    /* Support generation of DWARF2 debugging info. */
    #define DWARF2_DEBUGGING_INFO 1

    #undef PREFERRED_DEBUGGING_TYPE
    #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG

    ..

    /* Don't emit DWARF3/4 unless specifically selected. */ \
    /* DWARF3/4 currently does not work for DJGPP. */ \
    if (!OPTION_SET_P (dwarf_version)) \
    dwarf_version = 2; \
    \
    } \

    Note that I am only talking about the debug info aspects of COFF,
    there are probably some things in coffread.c that would still be needed
    in order to read executable files on Windows and/or DJGPP.

    Thanks,

    Simon

    [1] <a class="moz-txt-link-freetext" href="https://gitlab.com/gnutools/gcc/-/blob/c10076b34d3ede485bfb306b2a91feeee8368cd5/gcc/config/i386/djgpp.h#L20-24">https://gitlab.com/gnutools/gcc/-/blob/c10076b34d3ede485bfb306b2a91feeee8368cd5/gcc/config/i386/djgpp.h#L20-24</a>
    </pre>
    </blockquote>
    <br>
    </body>
    </html>

    --------------l0qssaH50nFaCdJA6uCOHq3F--
    --- Synchronet 3.21a-Linux NewsLink 1.2