如何在VC6监视窗口中获取变量的完整字符串值?

时间:2021-06-26 23:10:51

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??

我想在VC6监视窗口中获取char []变量的完整值,但它只显示截断的版本。我可以从调试内存窗口复制该值,但它包含十六进制和字符串值的混合行。当然有更好的方法??

6 个解决方案

#1


3  

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).

幸运的是,内存窗口很容易从中获取数据 - 我倾向于以8字节块显示它,因此易于管理,查找字符串数据并将批次剪切并粘贴到空白窗口中,然后使用alt + drag选择列和删除十六进制值。然后从字符串的底部开始,不断向上/删除(换行)以构建字符串(我使用该位的宏)。

I don't think there's any better way once you get long strings.

一旦你获得长串,我认为没有更好的方法。

#2


1  

Push come to shove you can put in the watch

推动你可以放入手表

given

char bigArray[1000];

watch:

&bigArray[0]
&bigArray[100]
&bigArray[200]
...

or change the index for where in the string you want to look...

或者更改要查找的字符串中的位置的索引...

Its clunky, but its worked for me in the past.

它笨重,但它在过去对我有用。

#3


1  

I do not have VC6 any more, so I cannot try it. I do not know if it works, but maybe you can enter

我没有VC6了,所以我不能尝试。我不知道它是否有效,但也许你可以进入

(char*)textArray;

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.

更好的解决方案可能是:VS2008会自动以您想要的方式显示文本。 VS2008的Express版本没有任何变化,据我所知,可以用它来开发纪念应用程序。您甚至可以尝试继续使用VC6进行开发,并仅使用VS2008进行调试。使用VS2003它是可能的。大约5年前,我不得不维护一个用VC6开发的应用程序。我一直使用VC6进行开发,但是为了调试,我使用了VS2003。

#4


1  

The only technique i have seen is to watch the string then the string + 50, + 100 etc.

我见过的唯一技术是看字符串然后字符串+ 50,+ 100等。

Eugene Ivakhiv wrote an addin for msvc 6 that lets you display the full string in an edit box.

Eugene Ivakhiv为msvc 6编写了一个插件,可以让你在编辑框中显示完整的字符串。

#5


1  

There's a cute plugin for VC6 called XDebug. It adds a dialog for viewing different types of strings. It worked great for me.

有一个可爱的VC6插件叫XDebug。它添加了一个用于查看不同类型字符串的对话框。它对我很有用。

#6


0  

Perhaps, get used to creating logfiles, and write output into the file directly, then bring up in your favorite text editor.

也许,习惯于创建日志文件,并直接将输出写入文件,然后在您喜欢的文本编辑器中显示。

#1


3  

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).

幸运的是,内存窗口很容易从中获取数据 - 我倾向于以8字节块显示它,因此易于管理,查找字符串数据并将批次剪切并粘贴到空白窗口中,然后使用alt + drag选择列和删除十六进制值。然后从字符串的底部开始,不断向上/删除(换行)以构建字符串(我使用该位的宏)。

I don't think there's any better way once you get long strings.

一旦你获得长串,我认为没有更好的方法。

#2


1  

Push come to shove you can put in the watch

推动你可以放入手表

given

char bigArray[1000];

watch:

&bigArray[0]
&bigArray[100]
&bigArray[200]
...

or change the index for where in the string you want to look...

或者更改要查找的字符串中的位置的索引...

Its clunky, but its worked for me in the past.

它笨重,但它在过去对我有用。

#3


1  

I do not have VC6 any more, so I cannot try it. I do not know if it works, but maybe you can enter

我没有VC6了,所以我不能尝试。我不知道它是否有效,但也许你可以进入

(char*)textArray;

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.

更好的解决方案可能是:VS2008会自动以您想要的方式显示文本。 VS2008的Express版本没有任何变化,据我所知,可以用它来开发纪念应用程序。您甚至可以尝试继续使用VC6进行开发,并仅使用VS2008进行调试。使用VS2003它是可能的。大约5年前,我不得不维护一个用VC6开发的应用程序。我一直使用VC6进行开发,但是为了调试,我使用了VS2003。

#4


1  

The only technique i have seen is to watch the string then the string + 50, + 100 etc.

我见过的唯一技术是看字符串然后字符串+ 50,+ 100等。

Eugene Ivakhiv wrote an addin for msvc 6 that lets you display the full string in an edit box.

Eugene Ivakhiv为msvc 6编写了一个插件,可以让你在编辑框中显示完整的字符串。

#5


1  

There's a cute plugin for VC6 called XDebug. It adds a dialog for viewing different types of strings. It worked great for me.

有一个可爱的VC6插件叫XDebug。它添加了一个用于查看不同类型字符串的对话框。它对我很有用。

#6


0  

Perhaps, get used to creating logfiles, and write output into the file directly, then bring up in your favorite text editor.

也许,习惯于创建日志文件,并直接将输出写入文件,然后在您喜欢的文本编辑器中显示。