I found two links showing how debugging with gdb under bazel should work (link 1, link 2).
Both links state that launching a debug session works when invoking the following command:
bazel run --compilation_mode=dbg --run_under=gdb //my:target
When I run the command, gdb starts just fine, loading the symbols and everything, but then immediately quits. The output is the same as shown in here (from link 2).
The first link also mentions the --direct_run
-argument, but this argument does not work either. gdb instantly quits and the following message, which is appended after the output of gdb (from the previous link), is shown:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US.ISO-8859-1",
LC_ALL = "en_US.ISO-8859-1",
LC_MEASUREMENT = "de_DE.UTF-8",
LC_PAPER = "de_DE.UTF-8",
LC_MONETARY = "de_DE.UTF-8",
LC_NAME = "de_DE.UTF-8",
LC_CTYPE = "en_US.ISO-8859-1",
LC_ADDRESS = "de_DE.UTF-8",
LC_NUMERIC = "de_DE.UTF-8",
LC_TELEPHONE = "de_DE.UTF-8",
LC_IDENTIFICATION = "de_DE.UTF-8",
LC_TIME = "de_DE.UTF-8",
LANG = "en_US.ISO-8859-1"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
What am I doing wrong? How can I interact with gdb?
Thanks in advance.
./bazel-run.sh --compilation_mode=dbg --run_under=gdb //my:target
– Mike van Dyke