Commit Graph
100 Commits
Author SHA1 Message Date
Nikita Smith 12b53f4174 move register layout struct to Linux OS layer; use only GPR portion of
the layout struct for reg r/w; handle orig_rax
2026-01-12 16:48:31 -08:00
Nikita Smith fd6c3ef0e0 move GNU and ELF specific struct readers to appropriate layers 2025-12-28 01:16:55 -08:00
Nikita Smith f150662cc4 update logic for tracking new threads 2025-12-20 14:41:01 -08:00
Nikita Smith 13ce0cf020 fix race condition in artifact cache 2025-12-19 17:34:35 -08:00
Nikita Smith 717781e0a3 adjust cursor by delta read size 2025-12-19 17:34:14 -08:00
Nikita Smith 99fe1bc2f2 typo 2025-12-18 20:06:20 -08:00
Nikita Smith cf849f7875 add missing GNU expr opcodes 2025-12-18 20:06:14 -08:00
Nikita Smith cc01c04b8a use p_vaddr for computing dynamic segment address 2025-12-18 20:05:47 -08:00
Nikita Smith ce4d09d431 WIP DW_OP_piece 2025-12-17 17:32:03 -08:00
Nikita Smith 43cb8b7b1a handle DW_Op_FBReg, DW_ExprOp_Deref, DW_ExprOp_BReg*, and DW_ExprOp_BRegX 2025-12-16 17:32:12 -08:00
Nikita Smith 0aea6c4e8f finish value in register test 2025-12-16 13:49:23 -08:00
Nikita Smith da57259379 move DWARF expressions test to the torture 2025-12-16 11:14:17 -08:00
Nikita Smith 823cbf6a72 missing func decls 2025-12-16 11:13:56 -08:00
Nikita Smith 2b4e0f8b77 WIP DWARF expression eval
- fixup jump offsets after expression is serialized
- use generalized machine ops for register reads
- add option to limit number of executed opcodes
2025-12-16 11:12:43 -08:00
Nikita Smith 44123e9712 extend regs with DWARF registers mappings and read/write machine ops 2025-12-16 10:47:05 -08:00
Nikita Smith 952afd49a7 generalize machine ops 2025-12-16 10:40:48 -08:00
Nikita Smith 782f87e512 WIP DWARF expression encoder 2025-12-12 17:39:56 -08:00
Nikita Smith 7d0e168f8f typoes 2025-12-12 12:16:28 -08:00
Nikita Smith 7947d4dc55 outline DWARF expression evaluator 2025-12-11 16:43:21 -08:00
Nikita Smith 5b6ffd5a49 clean up instrumentation inherited during fork 2025-12-09 16:08:19 -08:00
Nikita Smith 094370c028 bugfix last string query 2025-12-09 14:02:06 -08:00
Nikita Smith 962f0e30ae WIP fork 2025-12-09 09:56:43 -08:00
Nikita Smith c221286ab8 WIP process attaching 2025-12-08 13:29:24 -08:00
Nikita Smith 9659ab4ad2 remove privileged registers 2025-12-05 17:03:05 -08:00
Nikita Smith 8005c31276 remove x86 register code 2025-12-05 16:39:02 -08:00
Nikita Smith ce77442d37 fix x87 register layout 2025-12-05 16:36:46 -08:00
Nikita Smith f4ceaecf75 set flags in xstate_bv for updated registers 2025-12-05 13:35:10 -08:00
Nikita Smith 38dbcde3f4 debug info path entity is needed otherwise unwinder fails to map key to RDI 2025-12-02 17:00:05 -08:00
Nikita Smith 81f08a01bc inline anonymous members 2025-12-02 14:39:36 -08:00
Nikita Smith f8f3f95d33 set trace options in PTRACE_SEIZE and remove unnecessary PTRACE_SETOPTIONS 2025-11-27 15:45:36 -08:00
Nikita Smith 1602a9e6ea runtime target OS handling 2025-11-27 11:17:47 -08:00
Nikita Smith 7f701dd806 minor fix 2025-11-26 20:31:34 -08:00
Nikita Smith f9561cb618 add support for CFA in the eval system
Canonical Frame Address is a DWARF-only concept encoded in the unwind info.
Debugger must store this data for each call frame and provide it to
the eval system based on selected stack frame.

To abstract over format details, we introduce a "Frame Unwind Context".
For DWARF, this context maintains the intermediate unwind state and exposes
the CFA, whereas for PE, it remains empty.
2025-11-26 15:42:40 -08:00
Nikita Smith 2a6d0d737c add CFA op to the bytecode 2025-11-26 15:13:24 -08:00
Nikita Smith a1884aaf5f WIP handle abnormal process initialization 2025-11-25 16:24:57 -08:00
Nikita Smith 0565fdef0a WIP add support for GNU LibC TLS model
Unlike on Windows, TLS index isn't part of the module format. glibc stores
it in the opaque link_map struct. There are many different heuristics
a debugger can use to locate it but most of them are unreliable and
prone to errors, or don't work when debugger attaches to a process.
We adopt the newer approach of looking for special symbols
in glibc that provide TLS index offset. These symbols were added in
2021, so programs linked with older glibc won't have TLS support.
2025-11-21 16:41:35 -08:00
Nikita Smith 7347d2f1bc pipe DW_ExprOp_FormTlsAddress through DW_ExprOp_GNU_PushTlsAddress 2025-11-21 16:11:16 -08:00
Nikita Smith 6fa71607e2 do not emit global vars for decls 2025-11-21 16:10:28 -08:00
Nikita Smith 533e7431e7 WIP switch to special mutex for syncing halts 2025-11-19 13:01:25 -08:00
Nikita Smith b7fb4fe04d WIP improved signal handling in multi-threaded programs 2025-11-19 11:38:22 -08:00
Nikita Smith 597ea44337 handle empty hash table case 2025-11-19 11:25:54 -08:00
Nikita Smith e0d0cf6e29 helper marco for dealing with syscalls that are interrupted 2025-11-19 11:25:16 -08:00
Nikita Smith a82cba0c87 cache env strings on startup 2025-11-19 11:24:11 -08:00
Nikita Smith 08f794527c updated hashing libraries 2025-11-13 11:45:34 -08:00
Nikita Smith 7cafde3376 revert DWARF changes to commit bda3a71379 2025-11-13 10:53:29 -08:00
Nikita SmithandRyan Fleury 1196de6916 move sys/wait.h to os_core_linux 2025-11-07 16:37:45 -08:00
Nikita SmithandRyan Fleury 32bdd14d8e image base for a dynamic ELF is always zero 2025-11-07 15:47:15 -08:00
Nikita SmithandRyan Fleury ddc57a0ac4 WIP changed backend to use ptrace seize and interrupt 2025-11-07 15:47:15 -08:00
Nikita SmithandRyan Fleury 920a3ab3b7 discard unknown FDEs 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury b00d3d9041 print out call stacks on crashes 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 69fe51ec94 set permissions on shared memory 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 1cb1522931 minor cleanup 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 90c4e1604e implement semaphore open and clsoe 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 857860fb27 remove unused includes and inline ptrace options define 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 880b8135cc add per-item purging to the hash table 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 66606b0327 use STAP probes to generate load and unload module events 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury c8c993d4e8 filter for threads 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury f832ac191c implement process API under Linux 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury e1a46f7d21 reader for STAP arguments 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury bda3a71379 argument parser for simple STAP arguments 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury c4c9ef5182 WIP: got Linux to the point where single stepping and breakpoint
events are being reported correctly to the debugger
2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 0d5df8f38d ELF includes 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury fdb1ad5ab6 do not unwind with PE when DWARF unwinder exits with stale flag 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 6cc7b5622c ELF note parser 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury b596a6ed8a dumper for SHT_NOTE 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 8bc1e4b21c explicitly update stack pointer 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 3f70cd6d05 handle CFI programs without meaningful instructions 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 7616767ed7 fix CFA_Expr instruction fill 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury f2392284d5 add missing case for the register rule 2025-11-07 14:39:46 -08:00
Nikita SmithandRyan Fleury 793cd90604 zero out IP when reached last frame 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury 16232b98d8 SP from arch helper 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury 9e965e345f string format expression op when version is below 3 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury 1b6e9e9d7b parse "Signal Frame" aug flag and fill out augmentation data size 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury 821af9b104 fix FDE binary search for case where PC is not exactly on first instruction 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury d44efc15c8 remove structs that are now in GNU layer and add 32 -> 64 bit struct converters 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury e6a01472c8 layer for x64 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury 942c354bd9 fix eh_frame dumping 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury f0bd30c89b layer for interfacing with GNU 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury b091233a33 infer path style from exe type 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury 36b22c06b1 moved eh_frame files to dwarf layer 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury 78f2e641bc fix program header rebase issue in non-PIE exes, and export program header
info through DEMON event
2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury 7f705923e6 parse CIE and FDE out of runtime ELF 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury 4e2c983b0f skip leading NOP opcodes, which caused extra CFI rows to be emitted 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury dad92610de dumper for .eh_frame_hdr and .eh_frame 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury 327645436a named semaphore impl for Linux 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury c32d85ea2d DWARF helper 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury 3b81e1a0e9 connect DWARF virtual stack unwinder 2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury da38f266d9 parser for .eh_frame versions of CIE and FDE and new helper for
mapping PC -> CFI Row
2025-11-07 14:39:45 -08:00
Nikita SmithandRyan Fleury ecbce1efdf add TR and LDTR registers 2025-11-07 14:39:45 -08:00
Nikita Smith 43fcc21490 clang build fixes 2025-10-10 10:19:47 -07:00
Nikita Smith 3bd89b1fad switch over to new MD5 hash lib 2025-10-10 10:15:22 -07:00
Nikita Smith 061b5c5955 added CFA instruction parser, interpreter, and a dumper 2025-10-10 10:09:46 -07:00
Nikita Smith 7eb64dbd13 metagen does not have this macro... 2025-10-07 20:42:52 -07:00
Nikita Smith e1986c9594 clang fixes 2025-10-07 20:37:00 -07:00
Nikita Smith 401d7b47df factor out C++ ABI exception handling 2025-10-07 20:28:06 -07:00
Nikita Smith 3560c7d3e7 dump CIE and FDE 2025-10-07 18:16:32 -07:00
Nikita Smith e4f6c0fc8e helper for querying arch bittness in byte size 2025-10-07 18:16:31 -07:00
Nikita Smith 7cf3eaf73f parsers for CIE and FDE 2025-10-07 18:16:31 -07:00
Nikita Smith 62ae5ca3f5 stringify format and cfa opcodes enums 2025-10-07 18:16:31 -07:00
Nikita Smith fb0d42e6d8 extend stb_sprintf.h with formatter for Rng1U64 via %r 2025-10-07 18:16:31 -07:00