On Fri, 24 May 2024, Jeremy Drake wrote:

> Windbg reports that ldh.exe is already being debugged.  I was able to do a
> "non-invasive" attach to ldh.exe in windbg, but it doesn't seem to be able
> to deal with the split debug symbols (gnulink?).  I don't know if gdb can
> do a non-invasive attach like that (or open a minidump assuming one could
> be made from a non-invasize attach in windbg).

Seems it can, and at least lldb can load a minidump (unfortunately it's
not showing source file/line info like gdb does):
(lldb) bt
* thread #1, stop reason = Exception 0x80000007 encountered at address
0x000000
  * frame #0: 0x0000000180178837 msys-2.0.dll`cygheap_init()
    frame #1: 0x0000000180178b89 msys-2.0.dll`setup_cygheap()
    frame #2: 0x00000001800488bd msys-2.0.dll`dll_crt0_0()
    frame #3: 0x000000018007197c msys-2.0.dll`dll_entry(h=0x0000000180040000, 
reason=<unavailable>, static_load=<unavailable>)
    frame #4: 0x00007ffece99869f 
ntdll.dll`RtlActivateActivationContextUnsafeFast + 303
    frame #5: 0x00007ffece9dd03d ntdll.dll`RtlEnumerateEntryHashTable + 957
    frame #6: 0x00007ffece9dcdee ntdll.dll`RtlEnumerateEntryHashTable + 366
    frame #7: 0x00007ffece9dce60 ntdll.dll`RtlEnumerateEntryHashTable + 480
    frame #8: 0x00007ffece9dce60 ntdll.dll`RtlEnumerateEntryHashTable + 480
    frame #9: 0x00007ffece9dce60 ntdll.dll`RtlEnumerateEntryHashTable + 480
    frame #10: 0x00007ffece9dce60 ntdll.dll`RtlEnumerateEntryHashTable + 480
    frame #11: 0x00007ffece99d62d ntdll.dll`RtlCopyUnicodeString + 1293
    frame #12: 0x00007ffece998940 ntdll.dll`RtlImageRvaToSection + 592
    frame #13: 0x00007ffece988cac ntdll.dll`RtlUnicodeToCustomCPN + 1020
    frame #14: 0x00007ffece99a25a ntdll.dll`LdrLoadDll + 250
    frame #15: 0x00007ffecbe961e2 KERNELBASE.dll`LoadLibraryExW + 370
    frame #16: 0x00007ff6df3414ba ldh.exe
    frame #17: 0x00007ff6df3412ee ldh.exe
    frame #18: 0x00007ff6df341406 ldh.exe
    frame #19: 0x00007ffecdc6257d kernel32.dll`BaseThreadInitThunk + 29
    frame #20: 0x00007ffece9caa48 ntdll.dll`RtlUserThreadStart + 40
msys-2.0.dll`cygheap_init:
    0x180178750 <+0>:   pushq  %rbx
    0x180178751 <+1>:   subq   $0x20, %rsp
    0x180178755 <+5>:   leaq   0x102de4(%rip), %rcx ; _sys_nerr + 148864
    0x18017875c <+12>:  leaq   0x153b2f(%rip), %rdx ; __infinity + 5074
    0x180178763 <+19>:  callq  0x1800cce50    ; muto::init at 32:1
    0x180178768 <+24>:  movq   0x102e01(%rip), %rcx ; _sys_nerr + 148912
    0x18017876f <+31>:  leaq   0x102e02(%rip), %rax ; _sys_nerr + 148920
    0x180178776 <+38>:  cmpq   %rax, %rcx
    0x180178779 <+41>:  je     0x1801787d0    ; <+128> at 294:47
    0x18017877b <+43>:  cmpq   $0x0, 0x4870(%rcx)
    0x180178783 <+51>:  je     0x1801787a0    ; <+80> at 311:3
    0x180178785 <+53>:  cmpq   $0x0, 0x48a0(%rcx)
    0x18017878d <+61>:  je     0x1801787b5    ; <+101> at 312:14
    0x18017878f <+63>:  addq   $0x20, %rsp
    0x180178793 <+67>:  popq   %rbx
    0x180178794 <+68>:  jmp    0x180178680    ; init_cygheap::init_tls_list at 
638:1
    0x180178799 <+73>:  nopl   (%rax)
    0x1801787a0 <+80>:  cmpq   $0x0, 0x48a0(%rcx)
    0x1801787a8 <+88>:  movq   $0x3, 0x4888(%rcx)
    0x1801787b3 <+99>:  jne    0x18017878f    ; <+63> at 314:1
    0x1801787b5 <+101>: callq  0x1800c0c10    ; sigalloc at 125:1
    0x1801787ba <+106>: movq   0x102daf(%rip), %rcx ; _sys_nerr + 148912
    0x1801787c1 <+113>: addq   $0x20, %rsp
    0x1801787c5 <+117>: popq   %rbx
    0x1801787c6 <+118>: jmp    0x180178680    ; init_cygheap::init_tls_list at 
638:1
    0x1801787cb <+123>: nopl   (%rax,%rax)
    0x1801787d0 <+128>: movabsq $0x800000000, %rbx ; imm = 0x800000000
    0x1801787da <+138>: movl   $0x1, %r9d
    0x1801787e0 <+144>: movl   $0x2000, %r8d ; imm = 0x2000
    0x1801787e6 <+150>: movabsq $0x200000000, %rdx ; imm = 0x200000000
    0x1801787f0 <+160>: movq   %rbx, %rcx
    0x1801787f3 <+163>: callq  0x180217090    ; _alloca + 4336
    0x1801787f8 <+168>: movq   %rbx, %rcx
    0x1801787fb <+171>: movl   $0x4, %r9d
    0x180178801 <+177>: movl   $0x1000, %r8d ; imm = 0x1000
    0x180178807 <+183>: movl   $0x300000, %edx ; imm = 0x300000
    0x18017880c <+188>: movq   %rax, 0x102d5d(%rip) ; _sys_nerr + 148912
    0x180178813 <+195>: callq  0x180217090    ; _alloca + 4336
    0x180178818 <+200>: movq   %rax, %rcx
    0x18017881b <+203>: movq   %rax, 0x102d4e(%rip) ; _sys_nerr + 148912
    0x180178822 <+210>: leaq   0x48e0(%rax), %rax
    0x180178829 <+217>: movq   %rax, 0x102d38(%rip) ; _sys_nerr + 148904
    0x180178830 <+224>: leaq   0x3d319(%rip), %rax ; __utf8_mbtowc at 534:1
->  0x180178837 <+231>: movq   %rax, (%rcx)
    0x18017883a <+234>: movl   $0x12, 0x4828(%rcx)
    0x180178844 <+244>: movq   $0x0, 0x4830(%rcx)
    0x18017884f <+255>: jmp    0x18017877b    ; <+43> at 309:3
-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to