Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@javierhonduco
Created August 30, 2018 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save javierhonduco/cdaf167fe29ca3c5ada72dea3db7478e to your computer and use it in GitHub Desktop.
Save javierhonduco/cdaf167fe29ca3c5ada72dea3db7478e to your computer and use it in GitHub Desktop.
java_helloworld_gdb.txt
[javierhonduco@ ~/experiments] cat HelloWorld.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
[javierhonduco@ ~/experiments] javac HelloWorld.java
[javierhonduco@ ~/experiments] gdb --args java HelloWorld
GNU gdb (GDB) 8.1
Copyright (C) 2018 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.
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"...
3.6.3rc1+ (default, May 30 2018, 17:32:30)
[GCC 5.x]
Script information not found in binary, assuming oldest version
Reading symbols from java...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/local/bin/java HelloWorld
warning: File "/usr/lib64/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "/opt/gdb-dev:/usr/local/".
To enable execution of this file add
add-auto-load-safe-path /usr/lib64/libthread_db-1.0.so
line to your configuration file "/home/javierhonduco/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/javierhonduco/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[New LWP 869571]
Thread 2 "java" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 869571]
0x00007fffe10002b4 in ?? ()
(gdb) bt
#0 0x00007fffe10002b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe1000160 in ?? ()
#3 0x00007ffff738ba58 in VM_Operation::_names () from /usr/local/[...]/libjvm.so
#4 0x00007ffff7fe4980 in ?? ()
#5 0x00007ffff6eb79ad in VM_Version::get_processor_features() () from /usr/local/[...]/libjvm.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment