Skip to content

Commit

Permalink
chore: include debug symbols when doing debug builds
Browse files Browse the repository at this point in the history
So I can see backtraces on Arch:

    yay -S gdb

Core dump files get written to `/var/lib/systemd/coredump/`, owned as
root, and zstd-compressed, so to read them, you have to do something
like:

    # unzstd /var/lib/systemd/coredump/core.nvim.1000.008a013d9f0d4e769d9dbcfdd9d9584a.13538.1656944479000000.std
    # chmod 666 /var/lib/systemd/coredump/core.nvim.1000.008a013d9f0d4e769d9dbcfdd9d9584a.13538.1656944479000000
    $ gdb nvim /var/lib/systemd/coredump/core.nvim.1000.008a013d9f0d4e769d9dbcfdd9d9584a.13538.1656944479000000
    (gdb) bt

Which shows (excerpted):

    Core was generated by `nvim'.
    Program terminated with signal SIGSEGV, Segmentation fault.

    warning: Section `.reg-xstate/13538' in core file too small.
    #0  match_thread (thread_args=0x55d4e0213230) at matcher.c:393
    393             haystack_t *match = args->corpus->haystacks[i];
    [Current thread is 1 (Thread 0x7fcda9b93740 (LWP 13538))]
    (gdb) bt
    #0  match_thread (thread_args=0x55d4e0213230) at matcher.c:393
    #1  0x00007fcda9e0f5ff in commandt_matcher_run (matcher=0x55d4e07eb9e0, needle=0x7fcda9e110f7 "stuff")
        at matcher.c:211
    #2  0x00007fcda9e0fb28 in commandt_temporary_demo_function () at matcher.c:312
    #3  0x00007fcda9bce309 in lj_vm_ffi_call () at buildvm_x86.dasc:2701
    #4  0x00007fcda9bf3b5e in lj_ccall_func (L=<optimized out>, cd=<optimized out>)
        at /build/luajit/src/luajit-2.0-4c2441c/src/lj_ccall.c:1167
    ...
  • Loading branch information
wincent committed Jul 4, 2022
1 parent 0b5d3eb commit 813c5b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/wincent/commandt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CC = gcc
CCFLAGS += -Wall -Wextra -Wno-unused-parameter

ifdef DEBUG
CCFLAGS += -DDEBUG
CCFLAGS += -DDEBUG -g
endif

DLLEXT := so
Expand Down

0 comments on commit 813c5b4

Please sign in to comment.