如何在 VC6 监视窗口中获取变量的完整字符串值?
我想要在 VC6 监视窗口中获取 char[] 变量的完整值,但它只显示截断的版本。 我可以从调试内存窗口复制该值,但其中包含十六进制和字符串值的混合行。 当然有更好的方法吗?
I'm wanting to get the full value of a char[] variable in the VC6 watch window, but it only shows a truncated version. I can copy the value from a debug memory window, but that contains mixed lines of hex and string values. Surely there is a better way??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
对于大字符串,您几乎会被内存窗口困住 - 工具提示最终会被截断。
幸运的是,内存窗口很容易从中获取数据 - 我倾向于以 8 字节块的形式显示它,因此很容易管理,找到您的字符串数据并将其剪切并粘贴到空白窗口中,然后使用 alt+drag 来选择列并删除十六进制值。 然后从字符串的底部开始,不断向上翻页/删除(换行符)以构建字符串(我对此位使用宏)。
我认为一旦你得到长字符串就没有更好的方法了。
For large strings, you're pretty much stuck with the memory window - the tooltip would truncate eventually.
Fortunately, the memory window is easy to get data from - I tend to show it in 8-byte chunks so its easy to manage, find your string data and cut&paste the lot into a blank window, then use alt+drag to select columns and delete the hex values. Then start at the bottom of the string and continually page up/delete (the newline) to build your string (I use a macro for that bit).
I don't think there's any better way once you get long strings.
到了紧要关头,你可以把
给定的
手表放入手表中:
或者更改你想要查看的字符串中位置的索引......
它很笨重,但它过去对我有用。
Push come to shove you can put in the watch
given
watch:
or change the index for where in the string you want to look...
Its clunky, but its worked for me in the past.
我已经没有VC6了,所以无法尝试。 我不知道它是否有效,但也许你可以
在手表窗口中输入。
也许是更好的解决方案:VS2008自动按照您想要的方式显示文本。 而且VS2008还有一个免费的Express Edition,据我所知可以用来开发商业应用程序。 您甚至可以尝试继续使用VC6进行开发,而仅使用VS2008进行调试。 有了 VS2003,这是可能的。 大约 5 年前,我不得不维护一个用 VC6 开发的应用程序。 我一直使用VC6进行开发,但调试时我使用VS2003。
I do not have VC6 any more, so I cannot try it. I do not know if it works, but maybe you can enter
in the watch window.
The bettter solution maybe: VS2008 automatically displays the text the way you want. And there is a Express Edition for VS2008 free of change, which can, as far as I know, be used to develop commerecial applications. You can even try to continue developing with VC6, and use VS2008 for debugging only. With VS2003 it was possible. About 5 year ago I had to maintain an app which was developed with VC6. I kept using VC6 for developing, but for debugging I used VS2003.
我见过的唯一技术就是观察字符串
然后是字符串 + 50、+ 100 等。
Eugene Ivakhiv 写了一个 addin for msvc 6,可让您在编辑框中显示完整字符串。
The only technique i have seen is to watch the string
then the string + 50, + 100 etc.
Eugene Ivakhiv wrote an addin for msvc 6 that lets you display the full string in an edit box.
有一个可爱的 VC6 插件,名为 XDebug。 它添加了一个用于查看不同类型字符串的对话框。 这对我来说非常有效。
There's a cute plugin for VC6 called XDebug. It adds a dialog for viewing different types of strings. It worked great for me.
也许,习惯创建日志文件,并将输出直接写入文件,然后在您最喜欢的文本编辑器中调出。
Perhaps, get used to creating logfiles, and write output into the file directly, then bring up in your favorite text editor.