/nuttx-disassembly-chunker

Split a NuttX Disassembly into Chunks for display by NuttX Log Parser in PureScript

Primary LanguageRustApache License 2.0Apache-2.0

Split a NuttX Disassembly into Chunks for display by NuttX Log Parser in PureScript

Read the article...

For NuttX Log Parser to display the Disassembly for a given Address...

To chunk a NuttX Disassembly from qjs.S to qjs-chunk...

## Chunk NuttX Disassembly $HOME/qjs.S into
## $HOME/qjs-chunk/qjs-80001000.S
## $HOME/qjs-chunk/qjs-80002000.S
## ...

chunkpath=$HOME
chunkbase=qjs
mkdir -p $chunkpath/$chunkbase-chunk
rm -f $chunkpath/$chunkbase-chunk/*
cargo run -- $chunkpath $chunkbase

To create the NuttX Disassembly...

## Dump Disassembly of `qjs` to `qjs.S`
## For NuttX Kernel, change `qjs` to `nuttx`

riscv64-unknown-elf-objdump \
  --syms --source --reloc --demangle --line-numbers --wide \
  --debugging \
  ../apps/bin/qjs \
  >qjs.S \
  2>&1

NuttX Disassembly looks like this: qjs.S

0000000080007028 <_start>:
_start():
nuttx/arch/risc-v/src/common/crt0.c:166
void _start(int argc, char *argv[])
{
    80007028:	1141                	addi	sp,sp,-16

Which will be chunked into qjs-chunk/qjs-80008000.S