Giter Site home page Giter Site logo

llmdb's Introduction

Overview

llmdb is "mdb for lldb", in other words a modular shell pipeline approach to debugging.

Example

$ make install
$ . ./venv/bin/activate
$ llmdb -c /cores/core.22702 ./test
> ::walk thread | ::stack
Thread #1
frame #0: 0x00007fff8e3310ae libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x00007fff8cce6500 libsystem_pthread.dylib`pthread_kill + 90
frame #2: 0x00007fff96b0737b libsystem_c.dylib`abort + 129
frame #3: 0x000000010a1ccf40 test`foobar(argv=0x00007fff55a33698) + 48 at t.c:6
frame #4: 0x000000010a1ccf58 test`main(argc=1, argv=0x00007fff55a33698) + 24 at t.c:10
frame #5: 0x00007fff9ba0e5ad libdyld.dylib`start + 1
frame #6: 0x00007fff9ba0e5ad libdyld.dylib`start + 1
> 

Notes

True to how mdb works, llmdb interprets numbers as hex unless otherwise given an explicit input format. The expression 1000,10 is equivalent to 0x1000,0x10

Number formatting:

  • ['0i', '0I', '0b', '0B'] are interpreted as binary
  • ['0o', '0O'] are interpreted as octal
  • ['0t', '0T'] are interpreted as decimal
  • ['0x', '0X'] are interpreted as hexidecimal

Works

  • defining commands and walkers
  • loading modules
  • paged output
  • repeat expressions
  • pipelined commands
  • bang operator (redirect output to shell pipeline)
  • ::nm ! grep foobar | less

Commands

  • ::dump -- display arbitrary regions of mapped memory
  • missing ascii representation
  • still needs to align and dedupe memory it reads
  • ::walkers -- list walkers
  • ::walk -- execute given walker
  • ::which -- describe which module a command comes from
  • ::stack -- for a given thread id (0 based index) print backtrace
  • ::nm -- list all symbols for the target
  • missing options to limit and search output
  • ::print -- print the address contents
  • this is currently just a wrapper around lldb's print so passing type information is required
  • ::lldb -- execute arbitrary lldb command
  • if you're missing functionality from llmdb but know how to do it in lldb

Walkers

  • ::walk thread

TODO

  • semi-colon parsing
  • dot expressions
  • argparse style decorator for command option parsing
  • format expressions (i.e. 0xffffff/nap)
  • as many commands as we can
  • attach
  • branches
  • cat
  • cpuregs / cpustack
  • disasm / dismode
  • dump's arguments
  • echo
  • eval
  • files
  • formats
  • fpregs
  • grep
  • list
  • log
  • map
  • mappings
  • nm's arguments, and add/del
  • objects
  • offsetof
  • print's arguments and type deduction
  • quit
  • regs
  • release
  • sizeof
  • stack's arguments
  • status
  • tls
  • unload
  • non-tty interaction
  • aliases for $ and : commands

Known Issues

  • prompt not always immediately restored on output that doesn't fill paged window

llmdb's People

Contributors

tjfontaine avatar

Stargazers

Alexey Ugnichev avatar antonio nikishaev avatar shamanito avatar Vilis Sviklis avatar Andriy Gapon avatar Aria Stewart avatar Matt Widmann avatar Daniel avatar Jeffry Molanus avatar

Watchers

 avatar Julien Gilli avatar James Cloos avatar antonio nikishaev avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.