Jump to content
Sign in to follow this  
Paul Kallenberg

Find Declaration and Add Watch

Recommended Posts

I am using Delphi 10.4 and C++ Builder 10.4 Update 2, with TwineCompile and Modern C++ Compiler. I have 2 questions.

1. When rightclicking on a variable or method and then choosing Find Declaration I expect to go to the declaration. However, I don't see any response. What do I have to do to make this work, or is this a bug?

2. When running my application I set a breakpoint at a certain line of code. When this line is hit, I try to read the content of a variable in that line via Run -> Add Watch. Too often this gives me only 4 question marks instead of the content asked for. Again, what do I have to do to make this work, or is this a bug?

Share this post

Link to post

1/ This function doesn't work when executing the code only in 'dev' mode. Sometimes it doesn't work if the source code is not founded.

2/ Not very clear : any picture of your problem ?

Share this post

Link to post

1. I'm not sure if the code is executed in 'dev' mode. How can I check?


2. Here is a picture. The code is stopped at breakpoint at line 149. On 148, it says int r = 6. On the left I watch r. I expect to see a Value of 6. However, it shows 4 question marks.



Share this post

Link to post

I think this is because the compiler has optimised the variable away (in effect it has replaced your code with Grid->Row = 6;). So the debugger can't find the variable r because it doesn't exist.

The usual settings for compiling under "debug" settings is for optimisations to be turned off. But you can change all these under the project | options.

First thing to check is under Project | Options | C++ Compiler | Optimizations | disable all optimizations -> make sure this is set to "true"


Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this