2

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 1

4

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.

4
  • 2
    Isn'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++.
    – MSalters
    Apr 8, 2013 at 14:27
  • 1
    Does 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)?
    – TMN
    Apr 8, 2013 at 17:19
  • 1
    From 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
  • I assume they mean Java that's been compiled to native code with GCJ.
    – TMN
    Apr 8, 2013 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.