x64 C (or C++) compiler & debugger for realtime applications
x64 C (or C++) compiler & debugger for realtime applications
So, are there any free C / C++ compilers for x64 (long mode) that have a lean libc that is not Posix compliant (and thus not enormous in size and effort to port to a new environment), which comes with a decent source-level debugger for Windows that can run over TCP/IP using a well-documented protocol? I don't need files or stdio, but having good math and possibly signal processing functions would be an advantage.
-
- Member
- Posts: 5513
- Joined: Mon Mar 25, 2013 7:01 pm
Re: x64 C (or C++) compiler & debugger for realtime applicat
GCC (or Clang) and GDB with your choice of frontend. On Windows, you might need run them with WSL, MSYS2, or Cygwin.
Compilers don't include a C library, that's separate. I'm not familiar with many different C libraries, but newlib looks like it has pretty good math functions. You might also want to check the list of C libraries here if you haven't already.
Compilers don't include a C library, that's separate. I'm not familiar with many different C libraries, but newlib looks like it has pretty good math functions. You might also want to check the list of C libraries here if you haven't already.
Re: x64 C (or C++) compiler & debugger for realtime applicat
I've looked at GDB before, but it requires autoconf, building crosscompilers and a lot of other stuff too. I obviously cannot build gdbserver on RDOS since I cannot handle autoconf, and RDOS target is not supported in the GNU toolchain. This is the hopelessly difficult path that I rather not go down. Also note that Windows is not supported, and so you must use Cygwin, which cannot run the debugger in graphics mode.Octocontrabass wrote:GCC (or Clang) and GDB with your choice of frontend. On Windows, you might need run them with WSL, MSYS2, or Cygwin.
Compilers don't include a C library, that's separate. I'm not familiar with many different C libraries, but newlib looks like it has pretty good math functions. You might also want to check the list of C libraries here if you haven't already.
There has to be a better solution than this....
-
- Member
- Posts: 5513
- Joined: Mon Mar 25, 2013 7:01 pm
Re: x64 C (or C++) compiler & debugger for realtime applicat
This isn't difficult in WSL. It can be a bit more of a challenge in MSYS2 or Cygwin, since you may need to use patched tools.rdos wrote:I've looked at GDB before, but it requires autoconf, building crosscompilers and a lot of other stuff too.
The GDB protocol is well-defined, so you can make your own gdbserver replacement. Or, you could port a GDB stub, but those are designed for kernel and embedded debugging, so you'd need to make some modifications if you want to use it in ring 3.rdos wrote:I obviously cannot build gdbserver on RDOS since I cannot handle autoconf, and RDOS target is not supported in the GNU toolchain.
The very first frontend on the list from earlier (gdbgui) is browser-based, so GDB itself can run in Cygwin while you use a native browser.rdos wrote:Also note that Windows is not supported, and so you must use Cygwin, which cannot run the debugger in graphics mode.
Re: x64 C (or C++) compiler & debugger for realtime applicat
That's a bit interesting. So then the primary issue becomes if I can compile & build a binary that is OS independent and then debug it in an "embedded" target with gdbgui? I suppose newlib for an embedded system can fix that, but the GNU environment requires specific targets that are implemented in all the tools. Maybe there is an embedded target that fulfills that?Octocontrabass wrote:This isn't difficult in WSL. It can be a bit more of a challenge in MSYS2 or Cygwin, since you may need to use patched tools.rdos wrote:I've looked at GDB before, but it requires autoconf, building crosscompilers and a lot of other stuff too.
The GDB protocol is well-defined, so you can make your own gdbserver replacement. Or, you could port a GDB stub, but those are designed for kernel and embedded debugging, so you'd need to make some modifications if you want to use it in ring 3.rdos wrote:I obviously cannot build gdbserver on RDOS since I cannot handle autoconf, and RDOS target is not supported in the GNU toolchain.
The very first frontend on the list from earlier (gdbgui) is browser-based, so GDB itself can run in Cygwin while you use a native browser.rdos wrote:Also note that Windows is not supported, and so you must use Cygwin, which cannot run the debugger in graphics mode.
Re: x64 C (or C++) compiler & debugger for realtime applicat
rdos wrote:I've looked at GDB before, but it requires autoconf, building crosscompilers and a lot of other stuff too. I obviously cannot build gdbserver on RDOS since I cannot handle autoconf, and RDOS target is not supported in the GNU toolchain. This is the hopelessly difficult path that I rather not go down. Also note that Windows is not supported, and so you must use Cygwin, which cannot run the debugger in graphics mode.Octocontrabass wrote:GCC (or Clang) and GDB with your choice of frontend. On Windows, you might need run them with WSL, MSYS2, or Cygwin.
Compilers don't include a C library, that's separate. I'm not familiar with many different C libraries, but newlib looks like it has pretty good math functions. You might also want to check the list of C libraries here if you haven't already.
There has to be a better solution than this....
This may not be useful, but I've built gdb on Windows (native not Cygwin) and on DOS with djgpp (older version of gcc/gdb). I built gdb with pdcurses so that the Text User Interface is available for a GUI (on Windows or DOS). I also investigated the possibility of running gdb with fldev at one point. (FLTK can be built using nano-x which can port to a wide variety of platforms including DOS.) If a configure file is already generated, you usually don't need autoconf, just bash and whatever tools the configure file needs. I've run across some older versions of gcc/gdb that can be built with just a makefile. I've also used CDetect on some projects to replace autoconf. It's not a one for one replacement, but I can usually code something in a day or two that does the same thing configure would do for a project and then autoconf and automake are no longer needed.
Re: x64 C (or C++) compiler & debugger for realtime applicat
Well, if it's enough to debug RDOS running in a VM, then there's an easy way out: qemu has a built-in gdbserver, ready to use, no modification needed on your part. Just add "-S -s" to the command line.rdos wrote:I obviously cannot build gdbserver on RDOS since I cannot handle autoconf, and RDOS target is not supported in the GNU toolchain. This is the hopelessly difficult path that I rather not go down.
For debugging on real hardware, you can implement your own version of gdbserver. It's not that difficult, but definitely not a beginner level task. I think you can cope. This documentation will be useful: Writing a GDB Remote Serial Protocol server.
There's a native Windows version wingdb, but it's not free. Why do you need graphics mode anyway? GDB TUI is pretty neat. But if you insist, you could give a try to gdbgui, which is written in Python, so there should be no problem running it under Windows. If everything else fails, I'm sure you can compile GDB with a GUI using MINGW which creates a native Windows app. You might need a Windows X11 server like Xming, but that's the worst case scenario.rdos wrote:Also note that Windows is not supported, and so you must use Cygwin, which cannot run the debugger in graphics mode.
(Note I haven't used these software, so I'm just suggesting to try them out. I don't want to imply any of them can fulfill your needs, just maybe. I've used Xming 10 years ago or so, there might be a better alternative. It was working great back then.)
Cheers,
bzt