c++ - Convert (manually) from uint32_t to 4 chars -
i have program special typedef, used in many place assign unique code components in software.
typedef uint32_t fourcharcode;   at point, have function use such code job. need debug in function
extern "c" ___dllexport void a_function(fourcharcode in_type) {     fourcharcode x = 'kjfg';     fourcharcode y = 'tdkf';     fourcharcode z = '5vpo';      switch (in_type) {         case x:             //             break;         case y:             //             break;         case z:             //             break;         default: break;     }     return xx::noerror; }   obviously, when put breakpoint see value of in_type, obtain unsigned int ('1918980169').
my question:
is there way, in msvc 2013 debugger, display uint32_t value readable?
or
what manually (using calculator, python script or else useful) retrieve 4 chars hidden behind uint (i not against using paper , pen, don't see how can computation)?
if want convert values manually, displaying value in hexadecimal easier decimal. '5vpo' 896954447 in decimal, if right-click in watch window, can choose hexadecimal display , shows 0x3576704f. 0x35 '5', 0x76 'v', 0x70 'p', , 0x4f 'o'. or display hexadecimal on per-variable basis, append ,h variable name in watch window, in z,h.
alternatively, can cast variable char* , display array of length 4. if add (char*)&z,4 watch window, displays "opv5". reverse of string declared on x86 pcs, because little-endian, easy enough read.
as muertoexcobito already mentioned, can natvis create custom view of type.
Comments
Post a Comment