Debug std::string and CEFString in Application

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Debug std::string and CEFString in Application

Postby gabyx » Sat Jan 13, 2018 9:13 am

I have some troubles getting
lldb to show me a correct string output in a CefSchemeHandlerFactory
https://github.com/gabyx/ExecutionGraph ... ry.cpp#L31

When I debug this application built with
clang-5.0.1 (llvm install with brew)
with the debugger lldb:

Code: Select all
[ 96%] Building CXX object gui/executionGraphGui/CMakeFiles/ExecutionGraphGUI.dir/cefapp/FileSchemeHandlerFactory.cpp.o
/usr/local/opt/llvm/bin/clang++   -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/include -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/build/include -I/usr/local/include/eigen3 -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/build/src/meta/include -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/build/external/args-src -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/build/external/cefbinaries-src -I/Users/gabrielnuetzi/Desktop/ExecutionGraph/build/external/cefbinaries-src/include  -g -arch x86_64 -mmacosx-version-min=10.9   -std=c++14 -lc++experimental -ferror-limit=50 -Werror=return-type -g -g3 -fno-omit-frame-pointer -Weverything -Wpedantic -Wno-deprecated-register -Wno-documentation -Wno-old-style-cast -Wno-comment -Wno-float-equal -Wno-deprecated -Wno-c++98-compat-pedantic -Wno-undef -Wno-unused-macros -fsanitize=leak -fsanitize=address -o CMakeFiles/ExecutionGraphGUI.dir/cefapp/FileSchemeHandlerFactory.cpp.o -c /Users/gabrielnuetzi/Desktop/ExecutionGraph/gui/executionGraphGui/cefapp/FileSchemeHandlerFactory.cpp


I only see really weird output, such as:

Code: Select all
Process 3741 stopped
* thread #22, name = 'Chrome_IOThread', stop reason = breakpoint 1.1
    frame #0: 0x000000010011eb09 ExecutionGraphGUI`FileSchemeHandlerFactory::Create(this=0x00006060000dc340, scheme_name=0x0000700007ac9c18, request=(ptr_ = 0x0000700007ac9c10)) at FileSchemeHandlerFactory.cpp:37
   34           {
   35               ++itC;
   36           }
-> 37           std::path url(itC, temp.end());
   38           // e.g. url : "host/folderA/folderB/file.ext""
   39
   40           // Split urlPrefix from front (e.g "host/folderA")

Process 3741 launched: '/Users/gabrielnuetzi/Desktop/ExecutionGraph/build/gui/executionGraphGui/Debug/ExecutionGraphGUI.app/Contents/MacOS/ExecutionGraphGUI' (x86_64)
(lldb) fr v temp
(std::__1::string) temp = "\x85\xac\a\0p\0\0\x10\x85\xac\a\0p\0\0�\a\0p\0\0\xa0\x83\xac\a\0p\0\0`\x83\xac\a\0p\0\0@"


Why is this, or where could the problem be? I have a really hard time to figure out how I cannot successfully debug theses strings in my application.
The above example has been done by launching lldb from the terminal. In a normal main.cpp Application like the one here:
https://github.com/gabyx/ExecutionGraph ... r/build.sh
everything works and the strings are formatted normally.

Any help really welcome!

BR
gabyx
Newbie
 
Posts: 7
Joined: Sat Jan 13, 2018 9:06 am

Re: Debug std::string and CEFString in Application

Postby gabyx » Sun Jan 14, 2018 9:50 am

I found the error: It is supposed to be related to using address sanitizer and leak sanitizer when compiling.
without leak/address sanitizer everything works fine!
Wierd
gabyx
Newbie
 
Posts: 7
Joined: Sat Jan 13, 2018 9:06 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 38 guests