Advanced Debugging of Native Images in GDB

Research output: ThesisMaster's / Diploma thesis

Abstract

Debugging is a fundamental step in software development, enabling developers to identify and fix program defects. As modern software systems grow in size and complexity, the likelihood of bugs increases. Adequate debugging support is vital in finding those bugs and ensuring robust and reliable software. This thesis focuses on debugging for GraalVM Native Image, more specifically, generating and utilizing debug information for ahead-of-time (AOT) and run-time compilations.
GraalVM Native Image can AOT-compile Java code, producing a native image. A native image combines application classes, statically linked native code from the JDK, and a language runtime into a single binary. Debugging these native images requires comprehensive debug information for the generated native code. GraalVM Native Image already provides solid debug information generation for AOT compiled code. As part of this thesis, we introduce enhancements to improve efficiency and reduce the complexity of debug information generation.
The Truffle Framework, part of the GraalVM ecosystem, enables embedding the Graal Compiler as a run-time compiler within a native image. This run-time compiler produces machine code dynamically at image run-time, optimizing performance. Generating and processing debug information at run-time is necessary to debug run-time compilations effectively. We present the design and implementation of a run-time debug information generator, leveraging the existing AOT debug information generation infrastructure. Evaluating the implemented solutions demonstrates significant improvements in debug information generation time, size, and processing efficiency. The debug information generator better utilizes available computing resources by introducing parallelization and reducing complexity. This reduces debug information generation times and speeds up native image builds.
Additionally, the integration of run-time debug information in GDB and the GDB JIT Compilation Interface allows seamless debugging of run-time compiled code in a state-of-the-art debugger for native code. Using the GDB Python API, we further improve the debugging experience in GDB by providing an enhanced view of native image debug information for both AOT-compiled and run-time compiled code. In conclusion, this thesis provides a comprehensive approach to debugging native images, addressing AOT and run-time compilations. The contributions made in this work pave the way for more efficient and effective debugging, ultimately leading to higher quality and performance of native images.
Original languageEnglish
QualificationMaster
Awarding Institution
  • Johannes Kepler University Linz
Supervisors/Reviewers
  • Mössenböck, Hanspeter, Supervisor
Award date26 May 2025
Publication statusPublished - May 2025

Fields of science

  • 102013 Human-computer interaction
  • 102011 Formal languages
  • 102022 Software development
  • 102029 Practical computer science
  • 102 Computer Sciences
  • 102024 Usability research

JKU Focus areas

  • Digital Transformation

Cite this