-
Notifications
You must be signed in to change notification settings - Fork 0
Device Debugging Toolset
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.
| Binary | Version | Linkage | Use Cases |
|---|---|---|---|
addr2line |
binutils 2.32 | dynamic glibc | Map addresses to source lines with DEBUG info. |
nm |
binutils 2.32 | dynamic glibc | List symbols in binaries and object files. |
objdump |
binutils 2.32 | dynamic glibc | Disassemble code and inspect relocations. |
readelf |
binutils 2.32 | dynamic glibc | Inspect ELF headers, sections, and dependencies. |
file |
5.39 | dynamic glibc | Identify file types using MAGIC <magic.mgc>. |
gdb |
8.3.1 | dynamic glibc | Debug programs directly on the device. |
gdbserver |
8.3.1 | static | Let host's GDB debug a program on the device. |
strace |
5.10 | static | Trace a process's system calls. |
ldd |
Shell script | -- | Show shared 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+.
# 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:
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 SSHPASSNote
Remember to replace the ipAddress, user, and remoteDirectory variables with values that match your firmware and LAN setup.
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 to it from GDB on the host:
/mnt/SDCARD/.tmp_update/bin/gdbserver :1234 /mnt/SDCARD/path/To/Programtarget remote 192.168.1.128:1234A full on-device gdb is also included, but the gdbserver workflow is generally more responsive and lighter on the Miyoo Mini+.
Run build.sh from the main MMP repository when you need to regenerate binaries/.
./build.shThe 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.
The source versions are fixed in build.sh:
| Tool(s) | Source package | Version |
|---|---|---|
readelf, objdump, nm, addr2line
|
binutils | 2.32 |
file, magic.mgc
|
file | 5.39 |
gdb, gdbserver
|
gdb | 8.3.1 |
ldd |
Shell script | -- |
strace |
strace | 5.10 |
-
filebuilds a same-version nativefilefirst, because the ARM binary cannot run on the build host while compilingmagic.mgc. -
gdbis built without TUI, curses, expat, Python, or Guile to avoid extra on-device dependencies. -
stracelinks statically withLIBS="-lrt -lpthread"; glibc 2.28 keeps the neededpthreadsymbols outsidelibrt. -
MAKEINFO=trueskips the optional documentation build step.
⬅️ Previous Article
Deployment and Testing
Next Article ➡️
TBD