Remix.run Logo
zahlman 5 days ago

> And for old legacy code that's sprawling, I find braces help a LOT with keeping track of scope.

How exactly are they more helpful than following the line of the indentation that you're supposed to have as a matter of good style anyway? Do you not have formatting tools? How do you not have a tool that can find the top of a level of indentation, but do have one that can find a paired brace?

>Assembly? I haven't touched raw assembly since college.

How exactly does your debugger know whether the compiled code it stepped into came from C++ or Fortran source?

fluoridation 5 days ago | parent | next [-]

>How exactly does your debugger know whether the compiled code it stepped into came from C++ or Fortran source?

I don't know what IDE GP might be using, but mixed-language debuggers for native code are pretty simple as long as you just want to step over. Adding support for Fortran to, say, Visual Studio wouldn't be a huge undertaking. The mechanism to detect where to put the cursor when you step into a function is essentially the same as for C and C++. Look at the instruction pointer, search the known functions for an address that matches, and jump to the file and line.

exDM69 4 days ago | parent | prev [-]

> How exactly does your debugger know whether the compiled code it stepped into came from C++ or Fortran source?

Executables with debug symbols contain the names of the source files it was built from. Your debugger understands the debug symbols, or you can use tools like `addr2line` to find the source file and line number of an instruction in an executable.

Debugger does not need to understand the source language. It's possible to cross language boundaries in just vanilla GDB for example.