Porting GDB 16.2 on RK3399



πŸ‘† 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.

Porting GDB 16.2 on RK3399

πŸ‘† 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/Porting GDB 16.2 on RK3399

  • Source Code Download Link: https://sourceware.org/pub/gdb/releases/?C=M;O=DPorting GDB 16.2 on RK3399

  • 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

Porting GDB 16.2 on RK3399
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
Porting GDB 16.2 on RK3399

UnsetUnsetCompile mpfr-4.2.1UnsetUnset

Porting GDB 16.2 on RK3399
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
Porting GDB 16.2 on RK3399

↓↓ 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

Porting GDB 16.2 on RK3399

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」

Porting GDB 16.2 on RK3399

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!

Leave a Comment