linux openjdk debug

2023-07-11  本文已影响0人  草小孟
user@DESKTOP-3N0D5JH:~$ echo $HOME
/home/user
user@DESKTOP-3N0D5JH:~$ echo ~
/home/user
user@DESKTOP-3N0D5JH:~$
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"
PATH="/jdkpath/bin:$PATH"
加在最后一行 bashrc. 因为profile也是读取的bashrc脚本生成, 所以关掉后打开还可以
export http_proxy=http://192.168.119.241:7890;
export https_proxy=http://192.168.119.241:7890;
在 Linux 系统中,文件夹是用于组织和存储文件的一种特殊类型的对象。它们也被称为目录,用于创建文件系统层次结构,并帮助用户更好地组织和管理文件。

下面是一些常见的文件夹及其含义:

1. /(根目录):根目录是 Linux 文件系统的最顶层目录,它包含了整个文件系统的层次结构。

2. /bin:这个目录包含了一些常用的系统命令(可执行文件),如 ls、cp、mv 等。

3. /etc:这个目录包含了系统的配置文件,如网络配置、用户配置、服务配置等。

4. /home:这个目录包含了用户的主目录,每个用户都有一个独立的子目录,用于存储其个人文件和设置。

5. /var:这个目录包含了可变数据文件,如日志文件、临时文件、缓存等。

6. /tmp:这个目录用于存储临时文件,通常是在系统重新启动时会清空其中的内容。

7. /dev:这个目录包含了设备文件,用于访问系统硬件设备。

8. /mnt:这个目录用于挂载其他文件系统或存储设备。

9. /opt:这个目录用于安装额外的软件包或应用程序。

10. /usr:这个目录包含了用户安装的应用程序、库文件、文档等。

这只是一些常见的文件夹,实际上,Linux 文件系统中的目录结构非常丰富和复杂,用于组织各种类型的文件和数据。

希望这些信息对你有所帮助!如果你还有其他问题,请随时提问。
修改 vim /etc/apt/sources.list
https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11BmMBfZ
sudo apt-get update
sudo bash configure --build=x86_64-unknown-linux-gnu --openjdk-target=x86_64-unknown-linux-gnu --with-boot-jdk=/projects/jdk-20.0.1 --enable-debug --with-jvm-variants=server --enable-dtrace

sudo bash configure --build=x86_64-unknown-linux-gnu --openjdk-target=x86_64-unknown-linux-gnu --with-boot-jdk=/projects/jdk-20.0.1 --enable-debug --with-jtreg=/projects/jtreg/build//images/jtreg

sudo make test TEST="jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java"
--with-native-debug-symbols=internal
-with-debug-level=slowdebug 和--enable-debug 选一
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 用于在指定的行号设置断点。
sudo bash configure --with-toolchain-path=/mnt/c/dev/tool/visual\ studio/VC/Tools/MSVC/14.35.32215bin/Hostx64/x64 --with-boot-jdk=/mnt/c/dev/enviroment/java/jdk-20.0.1/

sudo bash configure   --with-toolchain-version=2022  --with-tools-dir=/mnt/c/dev/tool/visual\ studio/VC/Auxiliary/Build  --with-boot-jdk=/mnt/c/dev/enviroment/java/jdk-20.0.1/ 
上一篇下一篇

猜你喜欢

热点阅读