-
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.
| 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+.
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 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 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 usually
lighter on the device.
Run build.sh from this directory 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.
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 buildingfileandmagic.mgc. -
wget,tar,xz,scp, andsshpass.
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 |
-
stracelinks statically withLIBS="-lrt -lpthread"; glibc 2.28 keeps the needed pthread symbols outsidelibrt. -
gdbis built without TUI, curses, expat, Python, or Guile to avoid extra on-device dependencies. -
filebuilds a same-version nativefilefirst, because the ARM binary cannot run on the build host while compilingmagic.mgc. -
MAKEINFO=trueskips the optional documentation build step.
⬅️ Previous Article
Deployment and Testing
Next Article ➡️
TBD