How to debug C++

This is the beginning of the method I’m debugging. As an example, the execution pointer never even goes to the if (!RPOwner) line (presumably because the compiler can determine at compile time that it is not possible for the cast to fail, though to be honest I’m not 100% sure how it can be certain of that). It also skips past remainingTime -= timeTick, but jumps back to it later. Same with the initialization of the const local variables.

It seems like the editor is still compiling it as a development version. Is there something else I need to do besides set the configuration to “Debug Game Editor” in VS?

void URPCharacterMovementComponent::PhysSwinging(float deltaTime, int32 Iterations)
{
	//REMOVE: for debug purposes
	//deltaTime *= 0.3f;

	ARobotPlatformerCharacter* RPOwner = Cast<ARobotPlatformerCharacter>(CharacterOwner);
	if (!RPOwner)
	{
		UE_LOG(LogRobotPlatformer, Error, TEXT("Trying to use PhysSwinging with a non-RobotPlatformerCharacter!"));
		return;
	}

	if (deltaTime < MIN_TICK_TIME)
	{
		return;
	}

	float remainingTime = deltaTime;
	while ((remainingTime >= MIN_TICK_TIME) && (Iterations < MaxSimulationIterations))
	{
		Iterations++;
		const float timeTick = GetSimulationTimeStep(remainingTime, Iterations);
		remainingTime -= timeTick;

		const FVector OldLocation = UpdatedComponent->GetComponentLocation();
		const FQuat PawnRotation = UpdatedComponent->GetComponentQuat();
		const FVector OldVelocity = Velocity;
		//UE_LOG(LogRobotPlatformer, Warning, TEXT("Starting\tLocation: %s Velocity: %s"), *OldLocation.ToString(), *OldVelocity.ToString());