#include <stdio.h>
int main()
{
puts("Hello, world!");
}
Compile it with clang-cl like this: clang-cl hello.c /Zi /Od /Fe:hello.exe
...or with clang like this: clang hello.c -g -O0 -o hello.exe
Run LLDB: lldb hello.exe
Put a breakpoint in main: b main
Step using n until you reach the puts call. At that point the error will occur:
Process 19192 stopped
* thread #1, stop reason = step over failed (Could not create return address breakpoint.)
frame #0: 0x00007ff6ba3121f3 hello.exe
-> 0x7ff6ba3121f3: jmp 0x7ff6ba32eb64 ; puts at puts.cpp:42
0x7ff6ba3121f8: jmp 0x7ff6ba3271b8 ; public: class DName & __cdecl DName::setPtrRef(void) at undname.inl:573
0x7ff6ba3121fd: jmp 0x7ff6ba386d78 ; __dcrt_terminate_console_output at initcon.cpp:47
0x7ff6ba312202: jmp 0x7ff6ba335af0 ; protected: bool __cdecl __crt_stdio_output::standard_base<wchar_t,class __crt_stdio_output::string_output_adapter<wchar_t> >::extract_argument_from_va_list<wchar_t,wchar_t>(wchar_t &) at corecrt_internal_stdio_output.h:1033
error: hello.exe :: Class '__crt_cached_ptd_host::cached<int>::guard' has a member '_copy' of type '__crt_cached_ptd_host::cached<int>' which does not have a complete definition.
Steps to reproduce:
Create a file
hello.c
with these contents:Compile it with
clang-cl
like this:clang-cl hello.c /Zi /Od /Fe:hello.exe
...or withclang
like this:clang hello.c -g -O0 -o hello.exe
Run LLDB:
lldb hello.exe
Put a breakpoint in main:b main
Step usingn
until you reach theputs
call. At that point the error will occur: