mattboehm / vim-unstack

Vim plugin for parsing stack traces and opening the files
286 stars 15 forks source link

Can not deal newline in gdb call stack #34

Open theidexisted opened 5 years ago

theidexisted commented 5 years ago

Hi, thanks for this great project, I find a bug when deal gdb call stacks with newline in the middle.

Take this call stack as example:

#8  0x00007f2a7b70eeb7 in google_breakpad::ExceptionHandler::SignalHandler (sig=11, info=0x7f2a101ca730, uc=0x7f2a101ca600) at src/client/linux/handler/exception_handler.cc:376
#9  0x00007f2a6b3fc488 in Request::~Request (this=0xdc1ec750, __in_chrg=<optimized out>, __vtt_parm=<optimized out>)
    at /var/lib/Request.cpp:58
#10 0x00007f2a6a565b03 in Command::Release (this=0xdc1ec750) at /var/lib/Command.h:101

The frame 9 will be skipped in the result. I tried to fixed by modify the regex expression but failed, seems in the vim regex syntax there are no escaped newline character.

mattboehm commented 5 years ago

Thanks for reporting; I'll take a look. Off the top of my head, the simplest approach would be to generalize the pattern to something like .* at <file>:<line>$, but I need to think about this for a bit to confirm that at won't introduce a bug for any of the supported stack traces.

mattboehm commented 5 years ago

While waiting for me to fix this, feel free to customize unstack by adding the line I mentioned in #35 to your vimrc:

let g:unstack_extractors = unstack#extractors#GetDefaults() + [unstack#extractors#Regex('\v^.* at ([^"]+):([0-9]+)$', '\1', '\2')]

Thanks for reporting; I hope to have this fixed soon by default.