From ee1c46e44c17fff140775ed68f0bfbef0fff4f7e Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 3 Jul 2020 22:03:30 -0700 Subject: [PATCH] Debugging: add strace tip for shell script wrapper --- Debugging.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Debugging.md b/Debugging.md index 5c41208..f71ecf7 100644 --- a/Debugging.md +++ b/Debugging.md @@ -45,6 +45,13 @@ sudo sysdig -As999 --unbuffered -p '%evt.type %proc.name %evt.buffer' "proc.exe strace -s999 -e read,write -fp $(pgrep -fn ccls) ``` +To intercept early requests/responses, you can use a [shell script wrapper](Install#shell-script-wrapper) + +```sh +#!/bin/sh +exec strace -s999 -e read,write -o /tmp/strace.log -f path/to/ccls "$@" +``` + ### Stopping at the start to debug early issues To debug individual LSP requests, you can attach your debugger after ccls has