microsoft / ConcordExtensibilitySamples

Visual Studio Debug Engine Extensibility Samples
Other
122 stars 50 forks source link

Information on conditional breakpoints is missing #18

Closed carlokok closed 8 years ago

carlokok commented 8 years ago

the concord sample is quite complete and works well, but lacks information on conditional breakpoints. In our language trying to set a conditional breakpoint shows: "Elements does not support conditional breakpoints"

in the breakpoint dialog; there doesn't seem to be a callback before this happens.

plnelson commented 8 years ago

I could not find the partial string "does not support conditional breakpoints" in the Visual Studio source code. Which debug engine are you using? The Iris sample only applies to managed (CLR) debugging. Conditional breakpoints work correctly in the sample.

carlokok commented 8 years ago

My apologies, wrote it down wrong, it's "Elements does not support breakpoint conditions." (Elements being my language)

image

plnelson commented 8 years ago

If you are getting that error, you aren't using Concord as the debug engine. That message comes up when the registration for the debug engine in AD7Metrics does not have a key ConditionalBP with value.

Presumably the debug engine is "Elements" and it doesn't support conditional breakpoints.

carlokok commented 8 years ago

Hrmm that is very interesting. I am using the concord "managed debugger" as specified, and yes I can confirm Iris works too, but my own language doesn't. Registration is as simple as:

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0_Config\AD7Metrics\ExpressionEvaluator\{E100B502-A17C-4DBA-A13E-A819F009689B}]

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0_Config\AD7Metrics\ExpressionEvaluator\{E100B502-A17C-4DBA-A13E-A819F009689B}\{5133A728-E83E-4C0D-BCB9-AB02B9C172C0}]
"Name"="RemObjects Silver"
"Language"="Elements"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\AD7Metrics\ExpressionEvaluator\{E100B502-A17C-4DBA-A13E-A819F009689B}]

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\AD7Metrics\ExpressionEvaluator\{E100B502-A17C-4DBA-A13E-A819F009689B}\{5133A728-E83E-4C0D-BCB9-AB02B9C172C0}]
"Name"="RemObjects Silver"
"Language"="Elements"

for

.language '{E100B502-A17C-4DBA-A13E-A819F009689B}', '{5133A728-E83E-4C0D-BCB9-AB02B9C172C0}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}'

And I do get the calls in all ExpressionCompiler, Formatter, FrameDecoder (all working fine). How does that dialog decide if it's concord or not?

plnelson commented 8 years ago

Is there some way I can get the project so I can see what's going on? Alternatively, is it possible to create a minimal project that causes the issue?

carlokok commented 8 years ago

It's a beta of a closed source compiler (RemObjects Elements) http://www.elementscompiler.com/elements/default.aspx

Signed beta installed here *

File/New/RemObjects Elements/Oxygene/.NET/Console app set bp/conditional as usual (input doesn't matter, it fails before it ever gets to the other side)

If the setup isn't an option, I can try to extract just the Concord project + deps, but would then prefer to send that privately given they're not obfuscated.

plnelson commented 8 years ago

This is problem is due to missing registration. Turns out that the debugger UI checks all engines mapped to the language to decide if you can set a conditional breakpoint. Iris doesn't run into this problem because the debugger UI assumes the language is "unknown" because it doesn't have a language service

If you add this to your pkgdef file, it will fix the issue:

[$RootKey$\AD7Metrics\ExpressionEvaluator\{3A176F54-4595-432A-93BB-341BFBD6859C}\{5133A728-E83E-4C0D-BCB9-AB02B9C172C0}\Engine]
"0"="{449EC4CC-30D2-4032-9256-EE18EB41B62B}"
"1"="{92EF0900-2251-11D2-B72E-0000F87572EF}"

This maps the "Elements" language to the Managed Only and Mixed Mode engines - you can add more engines if you need to.

I created a pull request to add the corresponding registration to the Iris sample as well: https://github.com/Microsoft/ConcordExtensibilitySamples/pull/19

carlokok commented 8 years ago

thank you! that fixed it