Skip to content

Device Debugging Toolset

Luís Pinto edited this page Jun 22, 2026 · 7 revisions

Prebuilt binary-analysis and debugging tools for the Miyoo Mini+, which can be downloaded from the main MMP repository.
The bundle targets the device's ABI used by the steward-fu's toolchain: ARMv7-A, hard-float armhf, and glibc 2.28.

What's Included

File Version Linkage Use
addr2line binutils 2.32 dynamic glibc Map crash addresses back to source lines when debug info exists.
nm binutils 2.32 dynamic glibc List symbols from binaries and object files.
objdump binutils 2.32 dynamic glibc Disassemble binaries and inspect relocations.
readelf binutils 2.32 dynamic glibc Inspect ELF headers, sections, and dependencies.
file 5.39 dynamic glibc Identify file types; to be used with magic.mgc.
gdb 8.3.1 dynamic glibc Debug directly on the device.
gdbserver 8.3.1 static Run a debug target on the device while GDB connects from another machine.
strace 5.10 static Trace syscalls made by a process.
ldd Shell script -- Show dynamic library dependencies.

Dynamic tools use the device's existing glibc loader and libraries, including /lib/ld-linux-armhf.so.3, /lib/libc.so.6; and, where needed, /lib/libdl.so.2 or /lib/libm.so.6.
gdb has libstdc++ and libgcc linked in, so those do not need to be installed separately on the Miyoo Mini+.

Using the Prebuilt Bundle

Copy everything in binaries/ to persistent storage on the device. /tmp is temporary and is cleared on reboot; /mnt/SDCARD is persistent.

# SSH connection details for your Miyoo Mini+ device will depend on your firmware and LAN setup:
ipAddress="192.168.1.128"
user="root"
remoteDirectory="/mnt/SDCARD/.tmp_update/bin"

# Read the SSH password without displaying it in the terminal:
read -r -s -p "SSH password: " SSHPASS
export SSHPASS
printf '\n'

# Copy the contents of the 'binaries' directory to the '$remoteDirectory'.
# '-O' forces the legacy SCP protocol for SSH servers without SFTP support:
sshpass -e scp \
    -r \
    -o StrictHostKeyChecking=accept-new \
    -o MACs=hmac-sha1 \
    binaries/* \
    "$user@$ipAddress:$remoteDirectory/"

unset SSHPASS

Note

Remember to replace the ipAddress, user, and remoteDirectory variables with values that match your firmware and LAN setup.

Optional Steps

After copying the binaries over, you can SSH into the device and add the tools to its PATH:

export PATH="/mnt/SDCARD/.tmp_update/bin:$PATH"
# 'MAGIC' lets 'file' find 'magic.mgc' without passing '--magic-file' each time:
export MAGIC="/mnt/SDCARD/.tmp_update/bin/magic.mgc"

For remote debugging, start gdbserver on the device and connect from GDB on the host:

/mnt/SDCARD/.tmp_update/bin/gdbserver :1234 /mnt/SDCARD/path/To/Program
target remote 192.168.1.128:1234

A full on-device gdb is also included, but the gdbserver workflow is usually lighter on the device.

Rebuild From Source

Run build.sh from this directory when you need to regenerate binaries/.

./build.sh

The script downloads source archives into src/downloads/, extracts them under src/, cross-compiles the tools, and stages the result in binaries/. Source archives and extracted build trees are regenerated as needed and are not kept as repository source files.

For complete WSL and toolchain setup steps, see the companion wiki: https://github.com/Luspin/MMP/wiki.

Prerequisites:

  • WSL Ubuntu or another Linux environment.
  • The steward-fu Miyoo Mini+ toolchain extracted under /opt/prebuilt.
  • A native host gcc, used while building file and magic.mgc.
  • wget, tar, xz, scp, and sshpass.

The source versions are fixed in build.sh:

Tool(s) Source package Version
readelf, objdump, nm, addr2line binutils 2.32
strace strace 5.10
gdb, gdbserver gdb 8.3.1
file, magic.mgc file 5.39
ldd Shell script n/a

Maintainer Notes

  • strace links statically with LIBS="-lrt -lpthread"; glibc 2.28 keeps the needed pthread symbols outside librt.
  • gdb is built without TUI, curses, expat, Python, or Guile to avoid extra on-device dependencies.
  • file builds a same-version native file first, because the ARM binary cannot run on the build host while compiling magic.mgc.
  • MAKEINFO=true skips the optional documentation build step.

⬅️ Previous Article
Deployment and Testing

Next Article ➡️
TBD

Clone this wiki locally