I want to debug a c++ code using the generated executable with bazel, but for some reason, the bazel don't build the code on x64 architecture or the executable does not work on debug mode.
My files are
main.cpp
#include <iostream>
int main()
{
int a = 3;
int b = 5;
int c = a + b;
/* code */
std::cout << "Hello world" << std::endl;
return 0;
}
I use this command to build my app
bazel build //src/app:main --strip=never --compilation_mode=dbg
but when I try to debug the app after I set breakpoints I get this error in the console
for example, if I run
gdb main.exe
then
(gdb) break main
I get
No symbol table is loaded.
Question how to load the symbols inside the main.exe when I build the code using the bazel build command??