현재 다음 코드 부분을 디버깅하는 데 어려움을 겪고 있습니다. 내가C++ VS 디버거 전환 동작?
[(BR)]를 다음 중단 점
입니다 창 (10)에 VS2015 커뮤니티 버전을 사용하고있어 내 코드 (몸매는 여전 하구나) 버전입니다. 기본적으로 모든 gameObjects에서 모든 포인트 (X & Y 좌표)를 추출하는 루프를 중첩했습니다.
두 개의 중단 점을 설정할 수 있습니다.
디버그 버튼을 눌렀을 때 첫 번째 중단 점 (성공)에서 멈 춥니 다. 중요한 로컬 변수 counterVertices는 0입니다. 잘 됐네.
그런 다음 계속 누르십시오. 똑같은 BREAKPOINT 세 번으로갑니다.
그런 다음 두 번째 중단 점을 얻습니다. counterVertices는 0을 표시합니다. 왜? 나는 완전히이로 잃었어요
int counterVertices = 0;
int counterIndices = 0;
int beginningOfPolygon = 0;
//GetData
for (auto& it : this->gameObjects) { //Iterate over all gameObjects
beginningOfPolygon = counterIndices;
for (int i = 0; i < it->getOutline().getNumber(); i++) { //Iterate over all points of the gameObject
[(BR)]this->vertices[counterVertices] = it->getRenderPoint(i).x;
counterVertices++;
this->vertices[counterVertices] = it->getRenderPoint(i).y;
counterVertices++;
[(BR)]if (this->vertices[counterVertices-2] == this->vertices[counterVertices-1] && this->vertices[counterVertices-1] == 0.0f) {
cout << "A point on 0/0." << endl;
}
this->vertices[counterVertices] = 0.0f;
counterVertices++;
//Add Line to draw
this->indices[counterIndices * 2] = counterIndices;
this->indices[(counterIndices * 2) + 1] = counterIndices + 1;
counterIndices++;
}
this->indices[(counterIndices * 2) - 1] = beginningOfPolygon;
}
내가 처음에 해결하고 싶었다 아니라 내 원래의 문제에 내려고 노력에 붙어있어도 문제가되지 않습니다. 시간
PS에 이미
감사합니다 : 나는 모든 일의 스크린 샷이 프로세스는 다시 작성할 수 있습니다. 내가 청소하고 다시 솔루션을 다시 시작하고 다시 플립 할 수 있습니다. 디버깅 동작은 변경되지 않습니다.
PPS : 프로그램은 counterVertices가 올바르게 증가하지만 디버거 정보와 반대되는 방식으로 작동합니다.
계속 하시겠습니까? 계속 하시겠습니까? 계속 하시겠습니까? 내 첫 번째 생각은 try/catch에서 잡히지 않는 예외 (예 : 유효하지 않은 인덱스)가 루프에서 실행을 끌어 당기는 것입니다. 아니면 David Bradley가 방금 제안한 것. – Dronz
은 실행 파일과 동기화 된 소스입니까? –
한 걸음 앞으로 이동하면 정상적인 단계 앞으로 이동합니다. 다시 앞으로 나아가면서 "뒤로 뛰어 오르는"결과가 발생합니까? 첫 번째 중단 점이있는 행으로 이동합니다. 예외 처리 및 멀티 스레딩이 없습니다. try/catch도 없습니다. – celphy