I am trying to debug javadoc tool. I want to step in and see how javadoc (or even javac or other jdk tools) is actually working (and find potential bugs). Here are the steps I followed:
- Downloaded the openjdk src
- compiled successfully using
./configure --with-debug-level=slowdebug --with-boot-jdk=~/Downloads/jdk-18.0.2_linux-x64_bin/jdk-18.0.2
and thenmake images
- used the compiled javadoc to create javadoc. This executes correctly.
- But when used gdb I got
SIGSEGV
:gdb --args ~/Downloads/openjdk-18.0.2_src/openjdk/build/linux-x86_64-server-slowdebug/jdk/bin/javadoc "~/Downloads/Test.java"
This is what I got when used gdb:
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ~/Downloads/openjdk-18.0.2_src/openjdk/build/linux-x86_64-server-slowdebug/jdk/bin/javadoc...
Reading symbols from ~/Downloads/openjdk-18.0.2_src/openjdk/build/linux-x86_64-server-slowdebug/jdk/bin/javadoc.debuginfo...
(gdb) l
84 int WINAPI
85 WinMain(HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline, int cmdshow)
86 {
87 int margc;
88 char** margv;
89 int jargc;
90 char** jargv;
91 const jboolean const_javaw = JNI_TRUE;
92
93 __initenv = _environ;
(gdb) r
Starting program: ~/Downloads/openjdk-18.0.2_src/openjdk/build/linux-x86_64-server-slowdebug/jdk/bin/javadoc ~/Downloads/Test.java
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff5a10700 (LWP 65100)]
Thread 2 "javadoc" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff5a10700 (LWP 65100)]
0x00007fffe100064d in ?? ()
(gdb)
Probably I am using gbd the wrong way. Any help would be appreciated! Thanks.