Hi misc@,
The default "c++" compiler shipped with OpenBSD doesn't support "C++11",
so I use "clang++" to build program which use Standard C++ Thread
Library:
# cat hello.cpp
#include <thread>
#include <iostream>
void hello()
{
std::cout << "Hello World!\n";
}
int main(void)
{
std::thread t(hello);
t.join();
return 0;
}
# clang++ -g -pthread -std=c++11 hello.cpp
It seems OpenBSD doesn't support lldb, so I need to use gdb to debug
program:
# gdb -q a.out
(gdb) start
Die: DW_TAG_<unknown> (abbrev = 91, offset = 10917)
has children: FALSE
attributes:
DW_AT_type (DW_FORM_ref4) constant ref: 155 (adjusted)
Dwarf Error: Cannot find type of die [in module /root/Project/a.out]
Hello World!
Program exited normally.
Current language: auto; currently c
(gdb)
It seems gdb doesn't support well in debugging program compiled with
clang++. So is there any method or debugger used for debuggin programs
built with clang++?
Thanks very much in advance!
Best Regards
Nan Xiao