3.7 Using an integrated debugger: Running and breakpoints

주홍영·2022년 3월 11일
0

Learncpp.com

목록 보기
44/199

https://www.learncpp.com/cpp-tutorial/using-an-integrated-debugger-running-and-breakpoints/

이번 섹션에서는 디버거의 또 하나 중요한 기능인 running과 breakpoint에 대해서 살펴본다

Run to cursor

This Run to cursor command executes the program until execution reaches the statement selected by your cursor
다음 커서까지 실행한다
code나 statement에 커서로 설정한 곳까지 실행된다는 말

For Visual Studio users

원하는 라인에 cursor 찍어놓고 ctrl + F10
혹은 우클릭에서 Run to cursor 선택

Continue

The continue debug command simply continues running the program as per normal, either until the program terminates, or until something triggers control to return back to you again (such as a breakpoint, which we’ll cover later in this lesson).
continue는 말그대로 프로그램 디버거가 멈출때까지 실행한다는 것이다
예를들어 break point가 없다면 끝날때까지 실행되고 있다면 break point까지다
그리고 다시 F5를 누르면 다음 break point 혹은 마지막까지

For Visual Studio users

단축키는 F5
혹은 Debug menu > Continue

Start

Start는 디버깅을 시작한다는 것을 의미한다
단축키는 continue와 같다

For Visual Studio users

단축키는 F5
혹은 Debug menu > Start Debugging

Breakpoint

A breakpoint is a special marker that tells the debugger to stop execution of the program at the breakpoint when running in debug mode.
말 그대로 breakpoint이다
이 continue혹은 start를 하면 이 마커가 있는 라인 전까지 실행이된다

For Visual Studio users

단축키 F9를 눌러 생성하거나 지울 수 있따
혹은 Debug menu > Toggle Breakpoint
마우스로 클릭을 통해 마커를 만들고 지울 수 있다

Set next statement

거의 쓰이지 않는다
정해진 statement로 이동하는데
지정한 커서로 이동하며 그 사이에 지나온 statement를 실행하지 않는 기능이다
jumping으로도 불린다

For Visual Studio users

단축키는 커서 위치시키고 ctrl + shift + F10
혹은 마우스 우클릭으로 Set next statement 선택

profile
청룡동거주민

0개의 댓글