Skip to content

Commit 02d80a1

Browse files
Review feedback and two more methods for printing hubs and objects.
1 parent 5a2e87b commit 02d80a1

File tree

3 files changed

+73
-40
lines changed

3 files changed

+73
-40
lines changed

docs/reference-manual/native-image/DebugInfo.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,3 +648,21 @@ end
648648
(gdb) hubname_indirect 0x1dc860
649649
0x7ffff78a52f0: "java.lang.Class"
650650
```
651+
652+
## Debug Helper Methods
653+
654+
On platforms where the debugging information is not fully supported, or when debugging complex issues, it can be helpful to print or query high-level information about the Native Image execution state.
655+
For those scenarios, Native Image provides debug helper methods that can be embedded into a native image by specifying the build-time option `-H:+IncludeDebugHelperMethods`.
656+
While debugging, it is then possible to invoke those debug helper methods like any normal C method.
657+
This functionality is compatible with pretty much any debugger.
658+
659+
While debugging with gdb, the following command can be used to list all debug helper methods that are embedded into the native image:
660+
```
661+
(gdb) info functions svm_dbg_
662+
```
663+
664+
Before invoking a method, it is best to directly look at the source code of the Java class `DebugHelper` to determine which arguments each method expects.
665+
For example, calling the method below prints high-level information about the Native Image execution state similar to what is printed for a fatal error:
666+
```
667+
(gdb) call svm_dbg_print_fatalErrorDiagnostics($r15, $rsp, $rip)
668+
```

0 commit comments

Comments
 (0)