LLDB [DRAFT]
Created at 2017-07-08T09:00:10+09:00

Since I observed some weird behaviour (for me), it's time to look through llvm/lldb code base.

TODO

  • tty ui
  • client/server architecture
  • breakpoint
  • reading ELF and dwarf
  • interpreter (expr)
  • multi threads program
  • kernel feature (ptrace)
  • cpu feature (x86_64)

Build from source

tools/
  driver/      (lldb)
  lldb-server/ (lldb-server)
source/
  .. (liblldbBase, liblldbCore, ..)

Process hierarchy

- lldb
  - *stdio
  - *intern-state
  - *async
  - *wait4(pid=..)
  - lldb-server gdbserver --native-regs --setsid --reverse-connect 127.0.0.1:42583
    - <debugged-process>
  - *event-handler

(NOTE: * means that's thread)

Overview

[ Data structure ]
Driver (< SBBroadcaster)
'-' lldb::SBDebugger

[ Procedure ]
- main =>
  - SBDebugger::Initialize => ?
  - SBHostOS::ThreadCreated => ?
  - Driver driver =>
    - SBDebugger::Create => ?
  - Driver::ParseArgs => ?
  - Driver::MainLoop =>
    - ?

Reference