RemedyBG»Forums
3 posts
Can't hit breakpoint or inspect variables, but can step through the code when manually breaking
Edited by Grouflon on Reason: Initial post
Hello!
I'm trying to switch from visual studio to RemedyBG, and it almost start to look like the dream setup, but I'm encountering a pretty odd behavior with RemeyBG.
Whenever I set a breakpoint in one of the files, It is displayed with a little question mark on the side and never gets hit.
At first I was thinking that my symbols were incorrect or not correctly loaded, but when I manually break, I can normally step through my program which would mean otherwise.
Also, whem I am manually stepping through the program, I can't inspect any variable.

Does anyone has any idea of what could be happening?
Simon Anciaux
1337 posts
Can't hit breakpoint or inspect variables, but can step through the code when manually breaking
If by any chance you use a subst drive, there is sometimes an issues where you can't set breakpoints in the file if you opened it with the "non-subst" path (or something like that).

If you use "ctrl+b" to set a "function" breakpoint, does it work ? If it does you should be able to set breakpoint normally in that file.

What do you mean exactly by "I can't inspect any variable" ? There are no tooltips when you hover a variable at the moment in remedybg, so you need to use watch panel to inspect variables. Is the watch panel not working ?

You need to compile with the -Zi flag (and maybe -link -DEBUG:FULL).

Can you provide a reproduction case ?
3 posts
Can't hit breakpoint or inspect variables, but can step through the code when manually breaking
Thank you for your answer :)
The project is on a regular folder on the only partition of my physical drive so I don't think this is related to the subst issue.

The problem is that I can set breakpoints in my source files, but none of them ever stops the execution. It's like the debugger does not understand how they are related to the current executable.

I tried with a simpler project and it seems that symbols are not even loaded, but the log does not say anything about this so I can't really be sure.
I work on windows, generate my project files with premake5, and then compile the project from an msbuild command line.

Here is my premake file
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
workspace "RDBG_Test"
	configurations { "Debug" }
	platforms { "Win64" }

	language "C++"
	cppdialect "C++14"
	targetdir("./")
	objdir("./obj/")

project "RDBG_Test"
	kind "ConsoleApp"

	optimize "Debug"
	symbols "On"

	files { 
		"./main.cpp",
	}


The code i'm compiling
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>

void printSomething()
{
	printf("Hello World\n");
}

int main(int _argc, char** _argv)
{
	int a = 0;
	const char* str = "Hello World!";

	printSomething();
	printSomething();
	printSomething();
	printSomething();
	printSomething();

	return 0;
}


and the command I use to compile it
1
msbuild RDBG_Test.sln -t:clean -p:Configuration=Debug;Platform=Win64


and here what RemedyBG outputs looks like when I step through the assembly
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
[20/03/2021 19:43:24] Debugging new process...[OK] Process ID: 2668009952
[20/03/2021 19:43:25] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp. File not found.
[20/03/2021 19:43:25] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp. File not found.
[20/03/2021 19:43:25] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl. File not found.
[20/03/2021 19:43:26] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl. File not found.
[20/03/2021 19:43:26] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\gs\gs_support.c. File not found.
[20/03/2021 19:43:27] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\gs\gs_support.c. File not found.
[20/03/2021 19:43:27] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\gs\gs_support.c. File not found.
[20/03/2021 19:43:28] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\gs\gs_support.c. File not found.
[20/03/2021 19:43:28] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\gs\gs_support.c. File not found.
[20/03/2021 19:43:28] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\gs\gs_support.c. File not found.
[20/03/2021 19:43:28] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\gs\gs_support.c. File not found.
[20/03/2021 19:43:29] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\gs\gs_support.c. File not found.
[20/03/2021 19:43:29] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\gs\gs_support.c. File not found.
[20/03/2021 19:43:29] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\gs\gs_support.c. File not found.
[20/03/2021 19:43:29] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl. File not found.
[20/03/2021 19:43:30] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl. File not found.
[20/03/2021 19:43:32] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl. File not found.
[20/03/2021 19:43:33] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl. File not found.
[20/03/2021 19:43:34] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\utility\utility.cpp. File not found.
[20/03/2021 19:43:34] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\utility\utility.cpp. File not found.
[20/03/2021 19:43:35] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\utility\utility.cpp. File not found.
[20/03/2021 19:43:35] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\utility\utility.cpp. File not found.
[20/03/2021 19:43:35] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\utility\utility.cpp. File not found.
[20/03/2021 19:43:37] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\misc\amd64\cpu_disp.c. File not found.
[20/03/2021 19:43:48] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\misc\amd64\cpu_disp.c. File not found.
[20/03/2021 19:43:48] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\utility\utility.cpp. File not found.
[20/03/2021 19:43:49] Unable to open D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl. File not found.


There must be something I am missing, but there is no sign of anything going wrong regarding the symbols, and unfortunately RemedyBG does not seem very talkative about that.
Simon Anciaux
1337 posts
Can't hit breakpoint or inspect variables, but can step through the code when manually breaking
I tried to reproduce the issue, but the msbuild command you gave either doesn't build or I don't know where it builds (the output in the console seems to indicate that something was built but I can't find any exe or pdb). I don't know how to use msbuild so I didn't search much.

That said, I opened the sln and vcxproj files in visual studio and the linker flags don't contain /DEBUG:FULL for the "Generate debug info" field. After setting that I was able to use breakpoints in remedybg.

I don't know what is your use case, but if you're only working on a small project, I would suggest to use a simple batch file instead of premake and msbuild.
3 posts
Can't hit breakpoint or inspect variables, but can step through the code when manually breaking
Ho you're right, premake does not send this flag to the linker.
I thought that just having a pdb meant that everything that could be needed was there, I didn't knew that there was several "quality" of debugging symbols, that's interesting! I made a specific rule to pass this flag to the linker on windows and it works, yay !

Thank you very much for your help and advice. I spent some time investigating what was the best way of building my project, and tried several things and a simple batch file was among those things. I found batch capabilities too limiting and was really frustrated by the fact that the syntax is so absurd that each time you want to do something new, you always end up pasting code from stack overflow.
Windows build tools are really a big issue in c++ and it feels like every solution is very bad, each one in its own special way.
I'm not completely satisfied with premake either, but so far this is the less terrible solution that I have found.
I assume that when you go the unity build path, a batch file can become sufficient but I wasn't aware of that technique when I started my project and now I'm kind of sick of spending hours trying to make my code build and want to make some work, so I'll stick with what works for the time being.