BP_LOCATION

Spécifie le type de structure utilisé pour décrire l’emplacement du point d’arrêt.

Syntaxe

public struct BP_LOCATION {
    public uint   bpLocationType;
    public IntPtr unionmember1;
    public IntPtr unionmember2;
    public IntPtr unionmember3;
    public IntPtr unionmember4;
};

Membres

bpLocationType
Valeur de l’énumération BP_LOCATION_TYPE utilisée pour interpréter l’union bpLocation ou les unionmemberX membres.

bpLocation.bplocCodeFileLine
[C++ uniquement] Contient la structure BP_LOCATION_CODE_FILE_LINE si bpLocationType = BPLT_CODE_FILE_LINE.

bpLocation.bplocCodeFuncOffset
[C++ uniquement] Contient la structure BP_LOCATION_CODE_FUNC_OFFSET si bpLocationType = BPLT_CODE_FUNC_OFFSET.

bpLocation.bplocCodeContext
[C++ uniquement] Contient la structure BP_LOCATION_CODE_CONTEXT si bpLocationType = BPLT_CODE_CONTEXT.

bpLocation.bplocCodeString
[C++ uniquement] Contient la structure BP_LOCATION_CODE_STRING si bpLocationType = BPLT_CODE_STRING.

bpLocation.bplocCodeAddress
[C++ uniquement] Contient la structure BP_LOCATION_CODE_ADDRESS si bpLocationType = BPLT_CODE_ADDRESS.

bpLocation.bplocDataString
[C++ uniquement] Contient la structure BP_LOCATION_DATA_STRING si bpLocationType = BPLT_DATA_STRING.

bpLocation.bplocResolution
[C++ uniquement] Contient la structure BP_LOCATION_RESOLUTION si bpLocationType = BPLT_RESOLUTION.

unionmember1
[C# uniquement] Consultez les remarques sur la façon d’interpréter.

unionmember2
[C# uniquement] Consultez les remarques sur la façon d’interpréter.

unionmember3
[C# uniquement] Consultez les remarques sur la façon d’interpréter.

unionmember4
[C# uniquement] Consultez les remarques sur la façon d’interpréter.

Notes

Cette structure est membre des structures BP_REQUEST_INFO et BP_REQUEST_INFO2 .

[C# uniquement] Les unionmemberX membres sont interprétés selon le tableau suivant. Examinez la colonne de gauche pour obtenir la bpLocationType valeur, puis examinez les autres colonnes pour déterminer ce que chaque unionmemberX membre représente et marshale en unionmemberX conséquence. Consultez l’exemple pour obtenir un moyen d’interpréter une partie de cette structure en C#.

bpLocationType unionmember1 unionmember2 unionmember3 unionmember4
BPLT_CODE_FILE_LINE string (un contexte) IDebugDocumentPosition2 - -
BPLT_CODE_FUNC_OFFSET string (un contexte) IDebugFunctionPosition2 - -
BPLT_CODE_CONTEXT IDebugCodeContext2 - - -
BPLT_CODE_STRING string (un contexte) string (expression conditionnelle) - -
BPLT_CODE_ADDRESS string (un contexte) string (URL du module) string (nom de la fonction) string (adresse)
BPLT_DATA_STRING IDebugThread2 string (un contexte) string (expression de données) uint (nombre d’éléments)
BPLT_RESOLUTION IDebugBreakpointResolution2 - - -

Exemple

Cet exemple montre comment interpréter la BP_LOCATION structure en C# pour le BPLT_DATA_STRING type. Ce type particulier montre comment interpréter les quatre unionmemberX membres dans tous les formats possibles (objet, chaîne et nombre).

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);
            }
        }
    }
}

Spécifications

En-tête : msdbg.h

Espace de noms : Microsoft.VisualStudio.Debugger.Interop

Assembly : Microsoft.VisualStudio.Debugger.Interop.dll

Voir aussi