Partilhar via


BP_LOCATION

Especifica o tipo de estrutura usada para descrever o local do ponto de interrupção.

typedef struct _BP_LOCATION {
   BP_LOCATION_TYPE bpLocationType;
   union {
      BP_LOCATION_CODE_FILE_LINE   bplocCodeFileLine;
      BP_LOCATION_CODE_FUNC_OFFSET bplocCodeFuncOffset;
      BP_LOCATION_CODE_CONTEXT     bplocCodeContext;
      BP_LOCATION_CODE_STRING      bplocCodeString;
      BP_LOCATION_CODE_ADDRESS     bplocCodeAddress;
      BP_LOCATION_DATA_STRING      bplocDataString;
      BP_LOCATION_RESOLUTION       bplocResolution;
      DWORD                        unused;
   } bpLocation;
} BP_LOCATION;
public struct BP_LOCATION {
   public uint   bpLocationType;
   public IntPtr unionmember1;
   public IntPtr unionmember2;
   public IntPtr unionmember3;
   public IntPtr unionmember4;
};

Membros

  • bpLocationType
    Um valor a partir do BP_LOCATION_TYPE enumeração usada para interpretar a bpLocation união ou o unionmemberX membros.

  • bpLocation.bplocCodeFileLine
    [Apenas C++] Contains the BP_LOCATION_CODE_FILE_LINE structure if bpLocationType = BPLT_CODE_FILE_LINE.

  • bpLocation.bplocCodeFuncOffset
    [Apenas C++] Contains the BP_LOCATION_CODE_FUNC_OFFSET structure if bpLocationType = BPLT_CODE_FUNC_OFFSET.

  • bpLocation.bplocCodeContext
    [Apenas C++] Contains the BP_LOCATION_CODE_CONTEXT structure if bpLocationType = BPLT_CODE_CONTEXT.

  • bpLocation.bplocCodeString
    [Apenas C++] Contains the BP_LOCATION_CODE_STRING structure if bpLocationType = BPLT_CODE_STRING.

  • bpLocation.bplocCodeAddress
    [Apenas C++] Contains the BP_LOCATION_CODE_ADDRESS structure if bpLocationType = BPLT_CODE_ADDRESS.

  • bpLocation.bplocDataString
    [Apenas C++] Contains the BP_LOCATION_DATA_STRING structure if bpLocationType = BPLT_DATA_STRING.

  • bpLocation.bplocResolution
    [Apenas C++] Contains the BP_LOCATION_RESOLUTION structure if bpLocationType = BPLT_RESOLUTION.

  • unionmember1
    [C# somente] Consulte os comentários sobre como interpretar.

  • unionmember2
    [C# somente] Consulte os comentários sobre como interpretar.

  • unionmember3
    [C# somente] Consulte os comentários sobre como interpretar.

  • unionmember4
    [C# somente] Consulte os comentários sobre como interpretar.

Comentários

Essa estrutura é um membro da BP_REQUEST_INFO e BP_REQUEST_INFO2 estruturas.

[C# somente] O unionmemberX os membros são interpretados de acordo com a tabela a seguir. Examine a coluna da esquerda para a bpLocationType valor, em seguida, procure pelas colunas para determinar o que cada unionmemberX membro representa e marshal a unionmemberX adequadamente. Consulte o exemplo de uma maneira de interpretar uma parte dessa estrutura no C#.

bpLocationType

unionmember1

unionmember2

unionmember3

unionmember4

BPLT_CODE_FILE_LINE

string(um contexto)

IDebugDocumentPosition2

-

-

BPLT_CODE_FUNC_OFFSET

string(um contexto)

IDebugFunctionPosition2

-

-

BPLT_CODE_CONTEXT

IDebugCodeContext2

-

-

-

BPLT_CODE_STRING

string(um contexto)

string(expressão condicional)

-

-

BPLT_CODE_ADDRESS

string(um contexto)

string(módulo URL)

string(nome de função)

string(endereço)

BPLT_DATA_STRING

IDebugThread2

string(um contexto)

string(expressão de dados)

uint(número de elementos)

BPLT_RESOLUTION

IDebugBreakpointResolution2

-

-

-

Exemplo

Este exemplo mostra como interpretar a BP_LOCATION estrutura no C# para o BPLT_DATA_STRING tipo. Esse tipo específico mostra como interpretar os quatro unionmemberX membros em todos os formatos possíveis (objeto, string e número).

using System;
using System.Runtime.Interop.Services;
using Microsoft.VisualStudio.Debugger.Interop;

namespace MyPackage
{
    public class MyClass
    {
        public void Interpret(BP_LOCATION bp)
        {
            if (bp.bpLocationType == (uint)enum_BP_LOCATION_TYPE.BPLT_DATA_STRING)
            {
                 IDebugThread2 pThread = (IDebugThread2)Marshal.GetObjectForIUnknown(bp.unionmember1);
                 string context = Marshal.PtrToStringBSTR(bp.unionmember2);
                 string dataExpression = Marshal.PtrToStringBSTR(bp.unionmember3);
                 uint numElements = (uint)Marshal.ReadInt32(bp.unionmember4);
            }
        }
    }
}

Requisitos

Cabeçalho: msdbg.h

Namespace: Microsoft.VisualStudio.Debugger.Interop

Assembly: Microsoft.VisualStudio.Debugger.Interop.dll

Consulte também

Referência

Estruturas e uniões

BP_REQUEST_INFO

BP_LOCATION_CODE_FILE_LINE

BP_LOCATION_CODE_FUNC_OFFSET

BP_LOCATION_CODE_CONTEXT

BP_LOCATION_CODE_STRING

BP_LOCATION_CODE_ADDRESS

BP_LOCATION_DATA_STRING

BP_LOCATION_RESOLUTION