You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using macOS 12 Monterey and g++-11 installed by homebrew with latest VScode and CodeLLDB, the STL output is messy:
And when I use Windows 11 and gcc/gdb with latest C/C++ extension provided by Microsoft, after I add the following configurations at launch.json (which is useless for CodeLLDB in MacOS):
Data structure visualization in LLDB is achieved via data formatters. I don't maintain LLDB's formatters for C++, I just include whatever upstream LLDB provides. As far as I know, LLDB has formatters for both gcc's libstdc++ and clang's libc++, however on macOS it probably assumes that libc++ is used since clang is the native compiler on that OS. Maybe ask on StackOverflow?
And when I use Windows 11 and gcc/gdb [...]
gcc and gdb are parts of the same toolchain, so this combination had better work...
Clang does have better printing when debugging. And the reason why I use gcc instead of clang is that clang inlined more STL functions, which makes debug more difficult. For example: GCC
Clang
It says:
expression failed to parse:
error: Couldn't lookup symbols:
__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6substrEmm
I have tried adding arguments like -O0 but it doesn't help.
Do you know how to prevent STL functions from being inlined when compiling?
For anyone else still looking for a solution, adding -gdwarf-4 as a compilation option as suggested here while compiling works for me on macOS Monterey with gcc++-12 installed via homebrew.
I'm using macOS 12 Monterey and g++-11 installed by homebrew with latest VScode and CodeLLDB, the STL output is messy:
And when I use Windows 11 and gcc/gdb with latest C/C++ extension provided by Microsoft, after I add the following configurations at launch.json (which is useless for CodeLLDB in MacOS):
The STL output is delightful:
Here is my configurations in MacOS:
launch.json
task.json
Is there any way to make CodeLLDB support pretty printing in MacOS?
The text was updated successfully, but these errors were encountered: