Lldb reading Valgrind vgcore files

I have a fairly longstanding issue with Valgrind on FreeBSD generating core files (I haven’t tried on Linux).

Some more details here

A vgcore file is generated by Valgrind when the guest application would have generated a core file (and sometimes due to bugs/limitations in Valgrind), but it is generated by Valgrind rather than the OS.

Can anyone suggest any other tools or lldb options that might help me diagnose the problem?

As I understand from (LLDB core dump support improvements | Moritz Systems) the NT_PRSTATUS note contains the thread ID and general purpose registers. So I’m surprised that GDB is able to backtrace.

So perhaps it is there but in some position or format that lldb does not expect. Meaning gdb handles that and can get registers.

As you found ProcessElfCore::parseFreeBSDNotes is where the processing gets done. If you don’t mind rebuilding lldb you could log from there (or debug it whatever you prefer).

I do see this:

  for (const auto &note : notes) {
    if (note.info.n_name != "FreeBSD")
      continue;

Certainly a good candidate for what might be going on.

I was aware of the Moritz work, but I don’t remember reading that blog. It looks useful.

I should be able to build lldb (though building on FreeBSD does seem to break quite often). I’ll have a go this weekend and update here.