简体   繁体   中英

VisualStudio - aliases for very long watch variables

I am trying to debug a tree-like structure, so i have made a watch on each level. The lower i go, the watch variable name is getting ridiculusly long. Is there a way to rename them from:

{,,HTM_Projekt.exe}*(Node*){*}(((*((*(((*((*this).htm)).top)._Myptr)).input)))._Myptr)  

to

Level1Node

without more details on how you have it structured. i would suggest you make a varriable of that type that equals what is in your tree and just put that varriable on watch. it just means you will have a little bit of duplicate data but can see what it is clearly.

maybe it would look something like.

Node* kpLevel1Node = (Node*){*}(((*((*(((*((*this).htm)).top)._Myptr)).input)))._Myptr);

and then you just add kpLevel1Node to watch.

EDIT 1: based off comment.

a pointer is only 4bytes and refrences the same data. but if the extra 4 bytes is not an option for you temporarily while you debug.

then i suggest you use typedef's. to make the long rediculas type into something more readable. and like before without more code showing your implementation an exsact answer is not really possible

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM