debug versions of libEG.so and libGLESv2.so

21 views
Skip to first unread message

rink...@gmail.com

unread,
Nov 30, 2020, 4:23:48 AM11/30/20
to swiftshader
I need help in getting the debug build for libGLESv2.so and libEGL.so in swiftshader. 
Currently I'm unable to put break points in swiftshader code (PixelProgram.cpp) while executing gles-unittests with gdb .(testcase runs but the break point is pending ) 

(gdb) info sharedlibrary                                                                      
From                To                  Syms Read   Shared Object Library
0x00007ffff7dd7ac0  0x00007ffff7df5790  Yes         /lib64/ld-linux-x86-64.so.2
0x00007ffff7bcad70  0x00007ffff7bd1158  Yes (*)     /hdd2/swiftshader/build/libEGL.so
0x00007ffff6821aa0  0x00007ffff72b758f  Yes (*)     /hdd2/swiftshader/build/libGLESv2.so
(*): Shared library is missing debugging information.
I have enabled REACTOR_EMIT_DEBUG_INFO in CMakeLists.txt and triggered a
build but hit this error while compiling

/home/intel/Shalini/swiftshader/src/Reactor/LLVMReactorDebugInfo.cpp: In constructor ‘rr::DebugInfo::DebugInfo(llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>*, llvm::LLVMContext*, llvm::Module*, llvm::Function*)’:
/home/intel/Shalini/swiftshader/src/Reactor/LLVMReactorDebugInfo.cpp:111:2: error: no matching function for call to ‘llvm::DIBuilder::createFunction(llvm::DIFile*&, const char [16], const char [16], llvm::DIFile*&, unsigned int&, llvm::DISubroutineType*&, bool, bool, unsigned int&, llvm::DINode::DIFlags, bool)’
  );
  ^
In file included from /home/intel/Shalini/swiftshader/src/Reactor/LLVMReactorDebugInfo.cpp:33:0:
/home/intel/Shalini/swiftshader/third_party/llvm-10.0/llvm/include/llvm/IR/DIBuilder.h:664:5: note: candidate: llvm::DISubprogram* llvm::DIBuilder::createFunction(llvm::DIScope*, llvm::StringRef, llvm::StringRef, llvm::DIFile*, unsigned int, llvm::DISubroutineType*, unsigned int, llvm::DINode::DIFlags, llvm::DISubprogram::DISPFlags, llvm::DITemplateParameterArray, llvm::DISubprogram*, llvm::DITypeArray)
     createFunction(DIScope *Scope, StringRef Name, StringRef LinkageName,
     ^~~~~~~~~~~~~~
/home/intel/Shalini/swiftshader/third_party/llvm-10.0/llvm/include/llvm/IR/DIBuilder.h:664:5: note:   no known conversion for argument 8 from ‘bool’ to ‘llvm::DINode::DIFlags’
/home/intel/Shalini/swiftshader/src/Reactor/LLVMReactorDebugInfo.cpp: In member function ‘void rr::DebugInfo::syncScope(const Backtrace&)’:
/home/intel/Shalini/swiftshader/src/Reactor/LLVMReactorDebugInfo.cpp:221:3: error: no matching function for call to ‘llvm::DIBuilder::createFunction(llvm::DIFile*&, std::__cxx11::basic_string<char>&, const char [1], llvm::DIFile*&, unsigned int&, llvm::DISubroutineType*&, bool, bool, unsigned int&, llvm::DINode::DIFlags, bool)’
   );
   ^
In file included from /home/intel/Shalini/swiftshader/src/Reactor/LLVMReactorDebugInfo.cpp:33:0:
/home/intel/Shalini/swiftshader/third_party/llvm-10.0/llvm/include/llvm/IR/DIBuilder.h:664:5: note: candidate: llvm::DISubprogram* llvm::DIBuilder::createFunction(llvm::DIScope*, llvm::StringRef, llvm::StringRef, llvm::DIFile*, unsigned int, llvm::DISubroutineType*, unsigned int, llvm::DINode::DIFlags, llvm::DISubprogram::DISPFlags, llvm::DITemplateParameterArray, llvm::DISubprogram*, llvm::DITypeArray)
     createFunction(DIScope *Scope, StringRef Name, StringRef LinkageName,
     ^~~~~~~~~~~~~~
/home/intel/Shalini/swiftshader/third_party/llvm-10.0/llvm/include/llvm/IR/DIBuilder.h:664:5: note:   no known conversion for argument 8 from ‘bool’ to ‘llvm::DINode::DIFlags’
/home/intel/Shalini/swiftshader/src/Reactor/LLVMReactorDebugInfo.cpp:222:39: error: no matching function for call to ‘std::vector<rr::DebugInfo::Scope>::push_back(<brace-enclosed initializer list>)’
   diScope.push_back({ location, func });
                                       ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /home/intel/Shalini/swiftshader/src/Reactor/Nucleus.hpp:25,
                 from /home/intel/Shalini/swiftshader/src/Reactor/Reactor.hpp:18,
                 from /home/intel/Shalini/swiftshader/src/Reactor/LLVMReactorDebugInfo.hpp:18,
                 from /home/intel/Shalini/swiftshader/src/Reactor/LLVMReactorDebugInfo.cpp:15:
/usr/include/c++/7/bits/stl_vector.h:939:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = rr::DebugInfo::Scope; _Alloc = std::allocator<rr::DebugInfo::Scope>; std::vector<_Tp, _Alloc>::value_type = rr::DebugInfo::Scope]
       push_back(const value_type& __x)
       ^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:939:7: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const value_type& {aka const rr::DebugInfo::Scope&}’

Can anyone please help me get the debug builds for the .so files so that I can put breakpoint with gdb ? 

Alexis Hétu

unread,
Nov 30, 2020, 8:39:32 AM11/30/20
to rink...@gmail.com, swiftshader
Hi,

  Enabling REACTOR_EMIT_DEBUG_INFO allows code generated functions (in this case, shaders) to generate debug info. This is supported by SwiftShader's Vulkan library.
  You don't require this for debugging regular code, you only need to build a debug version (cmake -DCMAKE_BUILD_TYPE=Debug ..).

Thanks

--
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/06482d1f-519f-45cc-be0a-b7b0f8a11fa1n%40googlegroups.com.

rink...@gmail.com

unread,
Dec 1, 2020, 6:50:59 AM12/1/20
to swiftshader
Hi Alexis, 
Thanks for the quick reply.
I built the debug version with -DCMAKE_BUILD_TYPE=Debug   and executed the gles-unittests. Landed in the below error. 
My Config is as follows  
-DCMAKE_BUILD_TYPE=Debug  
-DREACTOR_DEFAULT_OPT_LEVEL = Aggresive,  
-DSWIFTSHADER_LLVM_VERSION = 10.0 , 
-DSWIFTSHADER_BUILD_VULKAN, 
-DSWIFTSHADER_BUILD_TESTS, 
-DSWIFTSHADER_BUILD_GLESv2
-DSWIFTSHADER_BUILD_EGL
Can you please help ?
swiftshader/src/OpenGL/libEGL/Config.cpp:237: bool egl::CompareConfig::operator()(const egl::Config&, const egl::Config&) const: Assertion `memcmp(&x, &y, sizeof(Config)) == 0' failed.
Aborted (core dumped)


Alexis Hétu

unread,
Dec 1, 2020, 10:13:23 AM12/1/20
to rink...@gmail.com, swiftshader
Hi,

  Since this list of options is constant, I have no idea how you can hit this assert. The best thing to do would be to attach a debugger to figure out why this produces various incompatible configs for you.

rink...@gmail.com

unread,
Dec 2, 2020, 3:19:09 AM12/2/20
to swiftshader
Thanks Alexis. I had set mNativeVisualID = 0x23 in src/OpenGL/libEGL/Config. cpp . That caused the CompareConfig failure.  
I'm now able to get the debug build. Thank you for the support

Reply all
Reply to author
Forward
0 new messages