Is Visual Studio 2013 C / C ++ a debugger, let you call a function and print the result

I am debugging some Windows Socket code and want to get the current WSAGetLastError () value from the Visual Studio 2013 debugger.

For example, I have a code:

fprintf(log, "WSAErrno = %d\n", WSAGetLastError());

and after this line I want to see the value (the log file is not reset, so I can not look there).

When I try to use Visual Studio 2013 (by typing this into the "Immediate Window"), I get

WSAGetLastError()
identifier "WSAGetLastError" is undefined

I know that I can change the code to

int wsaErrno = WSAGetLastError();
fprintf(log, "WSAErrno = %d\n", wsaErrno);

this is what I did as a job, but in some cases it is not recommended to change the code, recompile and reproduce the error.

+4
source share
1 answer

Autos, .

, ( , ) EAX. EAX Visual Studio, EAX "". ( C-, , .)

. , ( ). WSAGetLastError, , , . . , fprintf, EAX Watch, . ( .)

" " - $err,hr, ( ) GetLastError ( ) . pseudovariables.

+4

Source: https://habr.com/ru/post/1537107/


All Articles