简体   繁体   English

在Delphi(RAD Studio)中进行调试-在监视列表中查看类属性

[英]Debugging in Delphi (RAD Studio) - viewing class properties in Watch List

When I set breakpoint in code and I want to check properties of some class in RAD Studio 2009 (Delphi project) I cannot see them in Watch List or in Local Variables list. 当我在代码中设置断点并且想要检查RAD Studio 2009(Delphi项目)中某个类的属性时,在监视列表或“局部变量”列表中看不到它们。

All I see is Pointer (Address) as TSomeClass . 我所看到的只是Pointer(Address)作为TSomeClass

在RAD Studio中进行调试

Why I see this? 为什么我看到这个? I use also Visual Studio where it is amazing - I can see Properties and all members of some class. 我还使用Visual Studio,这真是太神奇了-我可以看到Properties和某个类的所有成员。

I am sure the same worked in some older versions of Delphi too (There was small [+] which could be expanded to see class properties). 我确信在某些较旧的Delphi版本中也可以使用(有小[+],可以扩展以查看类属性)。

Visual Studio调试

Is there some settings for this (I have turned off optimizations, turned on Debug...) 是否有一些设置(我已关闭优化,已打开调试...)

Maybe this is a trivial question but I am not able to continue with my project as this is really uncomfortable for me. 也许这是一个琐碎的问题,但是我无法继续我的项目,因为这对我来说真的很不舒服。

You are not comparing like with like. 您不是在以喜欢的方式进行比较。 The variable in the Delphi screenshot is an interface. Delphi屏幕截图中的变量是一个接口。 It has no data members, only methods. 它没有数据成员,只有方法。 The debugger won't call methods to display tooltips, etc. since methods can have side-effects. 调试器不会调用方法来显示工具提示等,因为方法可能会产生副作用。 You don't want your tooltips changing the meaning of the program. 您不希望您的工具提示更改程序的含义。

On the other hand, your VS example is a class with data members. 另一方面,您的VS示例是带有数据成员的类。 These are displayed in the debugger nicely in VS, and in Delphi for that matter. 这些可以很好地在VS和Delphi中显示在调试器中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Visual Studio IDE 中查看与类关联的控件列表 - Viewing a list of Controls associated with a class in Visual Studio IDE Visual Studio监视窗口:将整数作为一系列标志查看 - Visual Studio Watch Window: viewing an integer as a series of flags 查看类在Visual Studio中实现的接口 - Viewing what interfaces a class implements in Visual Studio Visual Studio调试:为什么变量显示在“本地”中而不显示在“监视”中? - Visual Studio Debugging: Why does a variable show up in “Locals” but not “Watch”? 在Visual Studio中进行内核调试:观察窗口数组的长度 - Kernel debugging in visual studio: Watch window array length Visual Studio调试“快速监视”工具和lambda表达式 - Visual Studio debugging “quick watch” tool and lambda expressions 是否可以在Visual Studio监视窗口中显示基类属性,而又不将其隐藏在子菜单下? - Can I show base class properties in the Visual Studio watch window without them being hidden away under a submenu? 在Visual Studio上的内存地址处观察一个类对象 - watch a class object at memory address on Visual Studio System.Collections.Generic.List <T> 快速调试中的调试 - System.Collections.Generic.List<T> debugging in quick watch 将类属性公开给Visual Studio属性窗口 - Expose Class properties to Visual Studio Properties window
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM