For example, in case of GDB it is possible to debug itself by itself. I have not been able to find any JVM that can debug itself or even allows debugging on source level. I was just wondering if someone can suggest on how the systems are made self debuggable. If you have references, please paste it here. I wanted to read on it in detail.
1 Answer
This has nothing to do with GDB being able to debug itself. GDB is a debugger for C. It can debug any C program. GDB also happens to be written written in C, therefore you can debug GDB with GDB.
The JVM Debug Interface is an interface for debugging Java. You can debug any Java program. Most JVMs aren't written in Java, and even if they are written in Java, they don't run inside of themselves.
There is however a JVM, which is written in Java and runs inside of itself: the Maxine Research JVM, and it can debug itself.
-
2Isn't GDB a native debugger? It can debug anything that looks sufficiently C-like, even if it's not C. The most obvious "other" language is C++.– MSaltersApr 8, 2013 at 14:27
-
1Does it even have to be C-like? If the code was compiled with the debug info, and the source files are available, shouldn't GDB be able to display the source and symbol tables for pretty much any language (e.g., Ada, COBOL, FORTRAN; obviously non-native code like Java or Python would require a different debugger)?– TMNApr 8, 2013 at 17:19
-
1From the current gdb docs: gdb supports C, C++, D, Go, Objective-C, Fortran, Java, OpenCL C, Pascal, assembly, Modula-2, and Ada. Apr 8, 2013 at 17:50
-