From ecf5ea389f2cee70a25da3e4b236e8ba4d349542 Mon Sep 17 00:00:00 2001 From: 190n Date: Fri, 30 May 2025 19:33:03 -0700 Subject: [PATCH] Move LLDB initialization commands to make attach configuration work (#20085) --- .lldbinit | 17 +---------------- misctools/lldb/init.lldb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 misctools/lldb/init.lldb diff --git a/.lldbinit b/.lldbinit index b2012a63b9..e10d3e72a6 100644 --- a/.lldbinit +++ b/.lldbinit @@ -1,16 +1 @@ -# Tell LLDB what to do when the debugged process receives SIGPWR: pass it through to the process -# (-p), but do not stop the process (-s) or notify the user (-n). -# -# JSC's garbage collector sends this signal (as configured by Bun WebKit in -# Thread::initializePlatformThreading() in ThreadingPOSIX.cpp) to the JS thread to suspend or resume -# it. So stopping the process would just create noise when debugging any long-running script. -process handle -p true -s false -n false SIGPWR - -command script import misctools/lldb/lldb_pretty_printers.py -type category enable zig.lang -type category enable zig.std - -command script import misctools/lldb/lldb_webkit.py - -command script delete btjs -command alias btjs p {printf("gathering btjs trace...\n");printf("%s\n", (char*)dumpBtjsTrace())} \ No newline at end of file +command source -C -s true -e true misctools/lldb/init.lldb diff --git a/misctools/lldb/init.lldb b/misctools/lldb/init.lldb new file mode 100644 index 0000000000..bb80deeebe --- /dev/null +++ b/misctools/lldb/init.lldb @@ -0,0 +1,19 @@ +# This file is separate from .lldbinit because it has to be in the same directory as the Python +# modules in order for the "attach" action to work. + +# Tell LLDB what to do when the debugged process receives SIGPWR: pass it through to the process +# (-p), but do not stop the process (-s) or notify the user (-n). +# +# JSC's garbage collector sends this signal (as configured by Bun WebKit in +# Thread::initializePlatformThreading() in ThreadingPOSIX.cpp) to the JS thread to suspend or resume +# it. So stopping the process would just create noise when debugging any long-running script. +process handle -p true -s false -n false SIGPWR + +command script import -c lldb_pretty_printers.py +type category enable zig.lang +type category enable zig.std + +command script import -c lldb_webkit.py + +command script delete btjs +command alias btjs p {printf("gathering btjs trace...\n");printf("%s\n", (char*)dumpBtjsTrace())}