Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:25:18+00:00 2026-06-18T06:25:18+00:00

When creating a tracepoint in Visual Studio (right-click the breakpoint and choose When Hit…),

  • 0

When creating a tracepoint in Visual Studio (right-click the breakpoint and choose “When Hit…”), the dialog has this text, emphasis mine:

You can include the value of a variable or other expression in the message by placing it in curly braces…

What expressions are allowed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:25:19+00:00Added an answer on June 18, 2026 at 6:25 am

    Microsoft’s documentation is rather sparse on the exact details of what is and is not allowed. Most of the below was found by trial and error in the Immediate window. Note that this list is for C++, as that’s what I code in. I believe in C#, some of the prohibited items below are actually allowed.

    Most basic expressions can be evaluated, including casting, setting variables, and calling functions.

    General Restrictions

    • Only C-style casts supported; no static_cast, dynamic_cast, reinterpret_cast, const_cast
    • Can’t declare new variables or create objects
    • Can’t use overloaded operators
    • Ternary operator doesn’t work
    • Can’t use the comma operator because Visual Studio uses it to format the result of the expression; use multiple sets of braces for multiple expressions

    Function Calls

    • Prohibited calls:
      • Lambdas (can’t define or call them)
      • Functions in an anonymous namespace
      • Functions that take objects by value (because you can’t create objects)
    • Permitted calls:
      • Member functions, both regular and virtual
      • Functions taking references or pointers, to either fundamental or class types
      • Passing in-scope variables
      • Using “&” to pass pointers to in-scope variables
      • Passing the literals “true”, “false”, numbers
      • Passing string literals, as long you don’t run afoul of the “can’t create objects” rule
      • Calling multiple functions with one tracepoint by using multiple sets of braces

    Variable Assignment

    • Prohibited:
      • Objects
      • String literals
    • Permitted:
      • Variables with fundamental types, value either from literals or other variables
      • Memory addresses, after casting: { *(bool*)(0x1234) = true }
      • Registers: { @eip = 0x1234 }

    Use Cases

    Calling functions from tracepoints can be quite powerful. You can get around most of the restrictions listed above with a carefully set up function and the right call. Here are some more specific ideas.

    Force an if

    Pretty straightforward: set up a tracepoint to set a variable and force an if-condition to true or false, depending on what you need to test. All without adding code or leaving the debug session.

    Breakpoint “toggling”

    I’ve seen the question a few times, “I need to break in a spot that gets hit a lot. I’d like to simply enable that breakpoint from another breakpoint, so the one I care about only gets breaks from a certain code path. How can I do that?” With our knowledge above, it’s easy, although you do need a helper variable.

    1. Create a global boolean, set to false.
    2. Create a breakpoint at your final destination, with a condition to break only when the global flag is true.
    3. Set tracepoints in the critical spots that assign the global flag to true.

    The nice thing is that you can move the tracepoints around without leaving the debugging session. Use the Immediate window or the Watch window to reset your global flag, if you need to make another run at it. When you’re done, all you need to clean up is that global boolean. No other code to remove.

    Automatically skip code

    The EIP register (at least on x86) is the instruction pointer. If you assign to it, you can change your program flow.

    1. Find the address of the line you want to skip to by breaking on it once and looking at the value of EIP, either in the Registers window or the Watch window with “@eip,x”. (Note that the value in the Registers window is hex, but without the leading “0x”.)
    2. Add a tracepoint on the line you want to skip from, with an expression like {@eip = address}, using the address from step 1.
    3. EIP assignment will happen before anything on the line is executed.

    Although this can be handy, be careful because skipping code like this can cause weird behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Creating a patch is very easy in SubVersion, With Tortoise, you right-click and select
Creating a link in PHP: echo <a href=\$currentFile?rowID=$row['id']\>click here</a>; This throws an error: Parse
Creating a WCF Service Library in Visual Studio 2008 on Vista x64 is troublesome
Creating a default ASP.NET MVC project in Visual Studio sets up a basic project
(creating a separate question after comments on this: Javascript redeclared global variable overrides old
Creating a JApplet I have 2 Text Fields, a button and a Text Area.
Creating an object with two properties address and distance . Pushing this object into
Creating header guards for my h/hpp files has always been standard practice for me,
Creating a mini-database with access, i came across this problem: For the background, i
Creating a couple forms and I have styled the text inputs and textareas the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.