Skip to content

TobiasWienand/asm-parser

 
 

Repository files navigation

asm-parser

Categorises and filters assembly in a way that's understood by Compiler Explorer.

Possible filters as command line parameters:

  • -binary changes to the Binary mode filtering that's based on the assembly output from GNU Objdump
  • -unused_labels try to filter out functions that aren't strongly used
  • -directives filter out .directives
  • -comment_only filter out comments
  • -whitespace
  • -library_functions try to filter out functions that belong in other libraries that are used (filtering is based on filepaths)
  • -dont_mask_filenames always output the filename if available

Other parameters:

  • -plt Also leaves out labels that End with @plt (without this, only labels that Start with .plt are left out)
  • -nocompat Leaves some experimental extra information
  • -stdin Reads assembly from STDIN instead of from a given file
  • -outputtext Instead of writing to JSON, output the filtered assemblys

Example usage

Feeding an objdump via stdin into asm-parser:

objdump --d a.out -l --insn-width=16 | asm-parser -stdin -binary

Building locally

You'll need:

Then you can

$ mkdir build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=<path/to/compiler/if/needed>
$ make -j$(nproc)
$ make test

(see https://github.com/compiler-explorer/asm-parser/blob/main/build.sh for an example, you might need to configure PATH first before doing so)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 74.6%
  • CMake 18.9%
  • Shell 6.3%
  • JavaScript 0.2%