Share via


Breakpoints.Add 메서드

새 중단점을 만들고 활성화합니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
Function Add ( _
    Function As String, _
    File As String, _
    Line As Integer, _
    Column As Integer, _
    Condition As String, _
    ConditionType As dbgBreakpointConditionType, _
    Language As String, _
    Data As String, _
    DataCount As Integer, _
    Address As String, _
    HitCount As Integer, _
    HitCountType As dbgHitCountType _
) As Breakpoints
Breakpoints Add(
    string Function,
    string File,
    int Line,
    int Column,
    string Condition,
    dbgBreakpointConditionType ConditionType,
    string Language,
    string Data,
    int DataCount,
    string Address,
    int HitCount,
    dbgHitCountType HitCountType
)
Breakpoints^ Add(
    [InAttribute] String^ Function, 
    [InAttribute] String^ File, 
    [InAttribute] int Line, 
    [InAttribute] int Column, 
    [InAttribute] String^ Condition, 
    [InAttribute] dbgBreakpointConditionType ConditionType, 
    [InAttribute] String^ Language, 
    [InAttribute] String^ Data, 
    [InAttribute] int DataCount, 
    [InAttribute] String^ Address, 
    [InAttribute] int HitCount, 
    [InAttribute] dbgHitCountType HitCountType
)
abstract Add : 
        Function:string * 
        File:string * 
        Line:int * 
        Column:int * 
        Condition:string * 
        ConditionType:dbgBreakpointConditionType * 
        Language:string * 
        Data:string * 
        DataCount:int * 
        Address:string * 
        HitCount:int * 
        HitCountType:dbgHitCountType -> Breakpoints
function Add(
    Function : String, 
    File : String, 
    Line : int, 
    Column : int, 
    Condition : String, 
    ConditionType : dbgBreakpointConditionType, 
    Language : String, 
    Data : String, 
    DataCount : int, 
    Address : String, 
    HitCount : int, 
    HitCountType : dbgHitCountType
) : Breakpoints

매개 변수

  • Function
    형식: String

    선택 사항 함수 중단점입니다. 중단점이 설정되어 있는 함수의 이름입니다.

  • File
    형식: String

    선택 사항 파일 중단점입니다. 중단점이 설정되어 있는 파일의 이름과 선택적 경로입니다.

  • Line
    형식: Int32

    선택 사항 파일 중단점입니다. 중단점이 설정되어 있는 소스 코드 줄 번호이며 함수의 시작 부분을 기준으로 합니다. 이 값이 1이면 함수의 시작 부분에 중단점이 설정됩니다.

  • Column
    형식: Int32

    선택 사항 파일 중단점입니다. 중단점이 설정되어 있는 문자입니다. 대부분의 경우 이 값을 1로 설정하여 줄의 시작 부분에 중단점을 설정합니다.

  • Condition
    형식: String

    선택 사항 중단점 Condition입니다. ConditionType과 함께 사용합니다.

  • Language
    형식: String

    선택 사항 함수를 작성하는 데 사용되는 프로그래밍 언어입니다.

  • Data
    형식: String

    선택 사항 데이터 중단점입니다. 변수에 데이터 중단점이 설정되면 변수의 이름을 지정할 수 있습니다. 컨텍스트 연산자를 사용하여 현재 범위 밖의 변수를 지정할 수 있습니다.

  • DataCount
    형식: Int32

    선택 사항 데이터 중단점입니다. 변수에 데이터 중단점이 설정된 경우 변수가 배열 또는 역참조된 포인터이면 이 값은 조사할 요소의 수를 지정합니다.

  • Address
    형식: String

    선택 사항 주소 중단점입니다. 중단점이 설정되어 있는 메모리 주소(10진수 또는 16진수 형식)입니다.

  • HitCount
    형식: Int32

    선택 사항 중단점의 Hit Count 속성입니다. 적중 횟수를 지정하지 않으면 중단점이 적중될 때마다 프로그램 실행이 중단되고 적중 횟수를 지정하면 지정된 적중 횟수에 해당하는 경우에만 프로그램 실행이 중단됩니다.

반환 값

형식: EnvDTE.Breakpoints
Breakpoints 컬렉션입니다.

설명

새 중단점을 만들고 활성화한 다음 Breakpoints 컬렉션을 반환합니다.

이 메서드의 모든 매개 변수는 선택적이지만 아래 설명된 네 가지 위치 형식 중 하나만 지정할 수 있습니다.

중단점을 설정할 위치 형식

사용 매개 변수

함수 내부

Function

파일 내부. 파일 내부에 줄 및 열 위치를 지정할 수 있습니다(옵션).

File, Line 및 Column

데이터 내부. 변수 및 조사할 변수의 수에 대해 설정할 수 있습니다(옵션).

Data 및 DataCount

특정 주소

Address

이러한 위치 형식에 대해 선택적으로 Condition과 ConditionType을 설정하여 지정된 조건이 참일 때만 중단되도록 할 수 있습니다. 지정된 적중 횟수에 해당할 경우 중단되도록 선택적으로 HitCount와 HitCountType을 설정할 수도 있습니다.

예제

다음 예제에서는 Add 메서드를 사용하는 방법을 보여 줍니다.

이 메서드를 테스트하려면

  1. 대상 프로젝트를 열고 추가 기능을 실행합니다.
public static void Add(DTE dte)
{
    // Setup debug Output window.
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("Add Method Test: ");
    owp.Activate();

    // dte is a reference to the DTE object passed to you by the
    // OnConnection method that you implement when you create an add-in.
    EnvDTE.Debugger debugger = (EnvDTE.Debugger)dte.Debugger;
    debugger.Breakpoints.Add("","Target001.cs", 13, 1, "", 
                             EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, 
                             "C#","", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone);
    debugger.Breakpoints.Add("","Target001.cs", 15, 1, "", 
                             EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, 
                             "C#","", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone);

    owp.OutputString("\nNumber of Breakpoints: " + debugger.Breakpoints.Count);
    owp.OutputString("\nEdition of the environment: " + 
                     debugger.Breakpoints.DTE.Edition);
    owp.OutputString("\nParent's Current Mode: " + 
                     debugger.Breakpoints.Parent.CurrentMode);
    owp.OutputString("\nFirst breakpoint is on line " + 
                     debugger.Breakpoints.Item(1).FileLine + ".");
    owp.OutputString("\nSecond breakpoint is on line " + 
                     debugger.Breakpoints.Item(2).FileLine + ".");
}
Shared Sub AddBreakpoint(ByRef dte As EnvDTE.DTE)
    dte.Debugger.StepInto(True)
    dte.Debugger.Breakpoints.Add("", "Target001.cs", 13, 1, "", _
                                 EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, _
                                 "C#", "", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone)
    dte.Debugger.Breakpoints.Add("", "Target001.cs", 15, 1, "", _
                                 EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, _
                                 "C#", "", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone)
End Sub

.NET Framework 보안

참고 항목

참조

Breakpoints 인터페이스

EnvDTE 네임스페이스