cat ~/.profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
jdb class
>> > stop in TestProcessImpl.main
>> run
gdb -p
break Java_java_lang_ProcessImpl_forkAndExec
cd (breakpoint 的工作目录)
print 变量
info 命令:
info 命令用于获取有关调试状态和程序结构的信息。它可以查看当前程序的状态,包括当前执行的函数、栈帧、寄存器的值、线程信息等。一些常用的 info 子命令包括:
info breakpoints:查看当前设置的断点信息。
info registers:查看当前的寄存器值。
info locals:查看当前函数的局部变量。
info threads:查看所有线程的信息。
info functions:查看程序中定义的所有函数。
等等。
show 命令:
show 命令用于查看和设置 GDB 的配置参数。它用于查看 GDB 的当前设置,包括显示风格、显示格式、断点设置等。一些常用的 show 子命令包括:
show style:查看当前的显示风格。
show print:查看打印格式的设置。
show breakpoints:查看所有断点的设置。
show pagination:查看分页设置,即是否在长输出中分页显示。
jdb
stop in 用于在指定的方法内设置断点。
stop at 用于在指定的行号设置断点。