tkchia / gcc-ia16

Fork of Lambertsen & Jenner (& al.)'s IA-16 (Intel 16-bit x86) port of GNU compilers ― added far pointers & more • use https://github.com/tkchia/build-ia16 to build • Ubuntu binaries at https://launchpad.net/%7Etkchia/+archive/ubuntu/build-ia16/ • DJGPP/MS-DOS binaries at https://gitlab.com/tkchia/build-ia16/-/releases • mirror of https://gitlab.com/tkchia/gcc-ia16
GNU General Public License v2.0
173 stars 13 forks source link

Debugging output is not supported. #38

Open JL2210 opened 5 years ago

JL2210 commented 5 years ago

When running ./build.sh gcc1 or anything that is compiled natively for ia16 from the build-ia16 repository, there are about ~1000 warnings that target system does not support debug output. How hard would it be to implement this? May I help?

tkchia commented 5 years ago

Hello @JL2210,

I imagine it will take quite a fair amount of work.

It should be quite feasible to tweak the GCC code's IA-16 backend to emit some form of debugging output (e.g. DWARF or stabs) in the intermediate .o files. But the real challenge is get the linker to propagate the information into the final .exe file, in a format that at least some existing DOS debuggers (e.g. Microsoft CodeView) can readily use.

If you do manage to implement this (☺), you would probably want to get and file a copyright assignment of your code to the Free Software Foundation, so that your code can eventually be included in mainline GCC. I have done this for my own modifications.

Thank you!

JL2210 commented 5 years ago

OK. A workaround for now might be to disable the warning in gcc/opts.c.

tkchia commented 5 years ago

Hello @JL2210,

That is possible; but I am still rather leery of getting rid of the warning (since it may well be useful for users who specify -g and expect some debugging information in the final .exe). I will try to see if there might be a better third way.

Thank you!

arbreng commented 4 years ago

Hi,

What about the work to get this working for remote targets?

Even single stepping and breakpoints with no symbols would be amazing for debugging bootloader code in QEMU. Current GDB does very poorly at this.

I'm willing to dig in and help with this if I have a better idea of where to begin

tkchia commented 4 years ago

Thanks @arbreng, and my apologies for the belated reply.

What about the work to get this working for remote targets?

Even single stepping and breakpoints with no symbols would be amazing for debugging bootloader code in QEMU. Current GDB does very poorly at this.

I'm willing to dig in and help with this if I have a better idea of where to begin

Actually I am not sure myself of a good place to begin. :-| Since GDB is in the Binutils packages, though, I am guessing that it might be useful to try modifying the GDB code in binutils-ia16 to make it work better with qemu-system-i386.

Currently, I do not actually build GDB in my build scripts (build-ia16), and I do not really use GDB for debugging my 16-bit code. If you would like to do something in this direction, though, I would be happy to merge your changes in.

Thank you!

asiekierka commented 1 year ago

Some early patches which are just barely enough to compile, but not yet link, objects with DWARF2 debugging information (minus unwind information; anyhow, at least with segelf linking fails - .debug_frame! is missing).

That's all the time I have for today, unfortunately. Thank you!

Notably, this doesn't seem to be enough to correctly emit line numbers. Odd.