π Click the blue text "Linux Armory" at the top, and select "Add to Favorites" in the upper right corner
to not miss out on great articles and see valuable content first.
π FollowLinux Armory, to receive hardcore Linux learning materials and code.
To quickly locate program issues, it is necessary to compile gdb16.2 on the RK3399 development board and use gdb16.2 to debug the program.
UnsetUnsetCompilation EnvironmentUnsetUnset
-
Ubuntu 24.04
-
gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu
UnsetUnsetPrerequisitesUnsetUnset
-
GDB Official Website: https://sourceware.org/gdb/
-
Source Code Download Link: https://sourceware.org/pub/gdb/releases/?C=M;O=D
-
The gdb16.2 version requires dependencies on higher versions of gmp and mpfr, so these two software packages need to be cross-compiled first.
UnsetUnsetCompile gmp-6.3.0UnsetUnset

wget https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz
xz -d gmp-6.3.0.tar.xz
tar -xvf gmp-6.3.0.tar
cd gmp-6.3.0
./configure --prefix=/opt/software/gdb-16.2-aarch64-10.2.1/gmp --build=x86_64-pc-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu CC=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc CXX=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ LD=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-ld AR=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc-ar RANLIB=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-ranlib
make -j4
sudo make install

UnsetUnsetCompile mpfr-4.2.1UnsetUnset

wget https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.gz
tar -zxvf mpfr-4.2.1.tar.gz
cd mpfr-4.2.1
./configure --prefix=/opt/software/gdb-16.2-aarch64-10.2.1/mpfr-4.2.1 --build=x86_64-pc-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu CC=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc CXX=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ LD=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-ld AR=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc-ar RANLIB=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-ranlib --with-gmp=/opt/software/gdb-16.2-aarch64-10.2.1/gmp-6.3.0
make -j4
sudo make install
UnsetUnsetCompile gdb16.2UnsetUnset
./configure --prefix=/opt/software/gdb-16.2-aarch64-10.2.1/gdb-16.2 --build=x86_64-pc-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu CC=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc CXX=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ LD=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-ld AR=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc-ar RANLIB=/opt/tools/gcc-linaro-10.2.1-2021.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-ranlib --with-gmp=/opt/software/gdb-16.2-aarch64-10.2.1/gmp --with-mpfr=/opt/software/gdb-16.2-aarch64-10.2.1/mpfr-4.2.1 CFLAGS="-I/opt/software/gdb-16.2-aarch64-10.2.1/gmp/include" CXXFLAGS="-I/opt/software/gdb-16.2-aarch64-10.2.1/gmp/include"
make -j4
make install

ββ Recommended Articles ββ
π Detailed methods for creating library files in Linux
π Summary of the most commonly used commands in Linux (selected)
π Step-by-step guide to writing a Linux thread pool
π Summary of common methods in Linux shell programming
π Essence of C++ basic knowledge
ββ Recommended Collections ββ
π Collection of C Language Beginner Tutorials
π Collection of Common Software Tools
π Collection of Linux Knowledge
π Collection of Detailed Linux Libraries
π Collection of Linux Application Programming
For learning and communication, pleaseaddAssistant WeChatto join a high-quality learning group
π Learn from others’ strengths to make up for your own shortcomings π
Please clickβγTechnical Learning Groupγ
β
FollowLinux Armory, reply in the chat interface withγ1024γto get all Linux materials and code.
β
Technical work requires step-by-step accumulation, and only then can one achieve great results.γDo not regret wasting time, do not be ashamed of being unproductiveγ
Make a little progress every day, support the author, remember to like and share! Add the assistant’s WeChatto receivemany classic open-source project source codes, read anytime and anywhere, there is always one that can help you!
Support the author, please extend your hand to wealth
Share, collectπππππLike, view
Support quality content with action!