質問

Is it possible to see the list of watches with the realtime value when I am not at a breakpoint?

  • I have defined an integer Mycounter in the public section of a TDatamodule.
  • I add it to the Watch list.
  • I can see its value being updated in the watch list only as I am debugging line by line or I am at a rbeakpoint.

Is there a way to keep seeing its value in the watch list even when the control goes back to the VCL thread (=when I press F9)?

役に立ちましたか?

解決 2

There is no way to do this from the IDE. Watch evaluation requires all the threads in the process to be suspended so that the debugger can read the memory and perform the evaluation.

If you want to see values being refreshed without the debugger breaking, you would most likely have to add code to your application to instrument the values of interest. For example, add code to your application output debug messages (e.g. OutputDebugString(), CodeSite etc.) whenever the value changed. You would of course need to view the information in a separate viewer.

他のヒント

As David said, a watch is not possible but you could get close by adding a data breakpoint to your variable and have it dump it's value to the Event Log each time it changes.

Steps

  • Get the address of the variable you like to track.
  • Add a databreakpoint
  • Open the Event Log debugging window

Get the address of a variable

  • I have used the variable I in my example. As per your example, this should be @Mycounter

Get the address

Adding the Data Breakpoint

  • Use the address of the variable
  • Uncheck the Break checkbox
  • Evaluate the expression PInteger($45622C)^
  • Log the result

Setting the databreakpoint

Viewing the results

enter image description here

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top