Not all breakpoints being hit?

So it seems I'm able to break on certain parts of my code but not others. For example, I set three breakpoints at lines 388, 393 and 404:

 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
29
30
31
32
33
34
388   if (KeyPressed(keyboard->ActionRight))
         {
             QueueAnimation($(player->animQueue), player->animData, "right-cross", PlayBackStatus::IMMEDIATE);
         };

393   player->currentAnim = UpdateAnimationState($(player->animQueue), deltaT);
         defer { CleanUpAnimation($(player->currentAnim)); };

         ApplyAnimationToSkeleton($(player->skel), player->currentAnim);

         UpdateSkeletonBoneWorldPositions($(player->skel), player->world.translation);
         UpdateSkeletonBoneWorldPositions($(enemy->skel), enemy->world.translation);

         UpdateCollisionBoxWorldPos_BasedOnCenterPoint($(player->hurtBox), player->world.translation);
         UpdateCollisionBoxWorldPos_BasedOnCenterPoint($(enemy->hurtBox), enemy->world.translation);

404   if(StringCmp(player->currentAnim.name, "right-cross"))
         {
             UpdateHitBoxStatus($(player->hitBox), player->currentAnim.currentTime);
             UpdateHitBoxStatus($(enemy->hitBox), enemy->currentAnim.currentTime);

             if(player->hitBox.isActive)
             {
                 player->hitBox.worldPos = {0.0f, 0.0f};
                 player->hitBox.worldPosOffset = {0.2f, 1.0f};
                 player->hitBox.size = {0.4f, 0.4f};

                 UpdateCollisionBoxWorldPos_BasedOnCenterPoint($(player->hitBox), player->world.translation);
                 b collisionOccurred = CheckForFighterCollisions_AxisAligned(player->hitBox, enemy->hurtBox);

                 if(collisionOccurred)
                     BGZ_CONSOLE("ahhahha");
             }
         }


breakpoints 388 and 393 seem to work fine but breakpoint 404 does not work. This also occurs at other points in my code.

I'm running the current remedy version (0.2.8.9)
I'm building with msvc 2017
Here is my current msvc bat file:

 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
29
30
31
32
33
34
35
36
37
38
39
40
@echo off

misc\ctime -begin timings_file_for_this_build.ctm

if not defined DevEnvDir ( call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" )

w: REM since above call to vcvars seems to change directories we need to chang back to this project dir

REM %~dp0 represents the full directory path to your batch file 
set cwd=%~dp0\

set PreProcessorSwitches=-DDEVELOPMENT_BUILD=1 -DGLEW_STATIC=1

REM Debug/Development build                                     
set CommonCompilerFlags=-Gm- -MP -Z7 -nologo -Oi -Od -WX -W3 -GR -EHa- -arch:AVX -std:c++17 -wd4505 -wd4101 -wd4530 -w14700 
set CommonLinkerFlags=-subsystem:windows -machine:x64 -incremental:no -nologo -opt:ref -debug -ignore:4099

set GameIncludePaths=-I %cwd%"third_party/boagz/include" -I %cwd%"third_party/boagz/src" -I %cwd%"third_party/stb/include"
set GameLibraryPaths=

set PlatformIncludePaths=-I %cwd%"third_party/boagz/include" -I %cwd%"third_party/boagz/src" -I %cwd%"third_party/glew-2.1.0/include" -I %cwd%"third_party/stb/include"
set PlatformLibraryPaths=-LIBPATH:%cwd%"third_party/glew-2.1.0/lib/win64-release"
set PlatformImportLibraries="user32.lib" "OpenGL32.lib" "gdi32.lib" "xinput.lib" "Winmm.lib"
set PlatformStaticLibraries="glew32s.lib"

IF NOT EXIST build mkdir build
pushd build

REM Clear out pdb files so build directory doesn't get too huge and build app DLL
del *.pdb > NUL 2> NUL
cl /c ..\source\gamecode.cpp %CommonCompilerFlags% %GameIncludePaths% %PreProcessorSwitches%
link gamecode.obj -dll -PDB:gamecode_%random%.pdb -export:GameUpdate %CommonLinkerFlags% 

REM Build exe
cl /c ..\source\win64_shadowgods.cpp %CommonCompilerFlags% %PlatformIncludePaths% %PreProcessorSwitches% 
link win64_shadowgods.obj -OUT:win64_shadowgods.exe %CommonLinkerFlags% %PlatformLibraryPaths% %PlatformImportLibraries% %PlatformStaticLibraries%

popd

misc\ctime -end timings_file_for_this_build.ctm

Edited by Jason on Reason: Initial post
If I may, I would like to ask a few additional questions to help me narrow it down. How is "defer" defined? What is the $() syntax about and how does it work? If possible, can you send me the PDB for the DLL (or wherever that particular code is at) along with the offending function name to the protonmail address? Should be able to track it down pretty quick from there.

Thanks much.

--
George
I'm not going to help but I also would like to know what the $( ) syntax is ?
Oh ya, forgot I had those in there. So my defer is currently defined like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
template <typename F>
struct Defer {
    Defer( F f ) : f( f ) {}
    ~Defer( ) { f( ); }
    F f;
};

template <typename F>
Defer<F> makeDefer( F f ) {
    return Defer<F>( f );
};

#define __defer( line ) defer_ ## line
#define _defer( line ) __defer( line )

struct defer_dummy { };
template<typename F>
Defer<F> operator+( defer_dummy, F&& f )
{
    return makeDefer<F>( std::forward<F>( f ) );
}

#define defer auto _defer( __LINE__ ) = defer_dummy( ) + [ & ]( )


(Think I got this implementation from a post here but can't remember) and the $() syntax is sort of a compiler enforced out param. Just a way for me to explicitly recognize out parameters at the call site. All this is is a #define to std::move:

1
#define $(var) std::move(var)


I know this isn't how std::move is traditionally suppose to be used but been doing it for a couple months now and haven't run into much issue. And no problem x13pixels, I'll email you that stuff shortly
@x13pixels Okay so tested it again today and now the breakpoints for the dll seem to be working fine but I can't get any to work for my exe. I've closed and reopened the app a couple times and get the same issue. I checked the modules pane and it shows that the exe symbols were loaded. I'll keep trying to see if I find any patterns but in the meantime I'll send you my exe pdb file as well as my exe source file. Right now no matter what breakpoint I set in my exe's game loop none of the breakpoints are being hit.

Edited by Jason on
For the record, we tracked this down to a problem in the handling of a lambda in the middle of WinMain. RemedyBG makes some assumptions in the symbol / line number handling that are incorrect in this case.

--
George
I also am having similar issues with certain parts of the codebase in my project.

I'm noticing that some of the breakpoints are ignored and even if I remove the lambda from the body of the function, Remedybg still ignores almost all of the breakpoints inside of the function.

I doubt the screenshots would be of much help, but in case they would be this is happening at the start of the function body before I've declared any lambdas or anything https://imgur.com/a/TawHIQp

Please let me know if there's more information I could provide that would be helpful.

Thanks for making remedybg!
REDLINE,

Any chance you could send me the offending PDB file that you are having trouble with? I'll be happy to take a look.