NO

Author Topic: Source level debugger not working?  (Read 2715 times)

Freddy

  • Guest
Source level debugger not working?
« on: August 20, 2007, 06:50:03 AM »
Hi! I run the debugger and it shows the disassembly of my code, but no source level debugging.
What's wrong?

thanks

JohnF

  • Guest
Re: Source level debugger not working?
« Reply #1 on: August 21, 2007, 03:46:49 PM »
Hi! I run the debugger and it shows the disassembly of my code, but no source level debugging.
What's wrong?

thanks

What have you set in "Project Options" on the compiler and linker tabs?

John

Freddy

  • Guest
Re: Source level debugger not working?
« Reply #2 on: August 21, 2007, 06:04:39 PM »
I create a simple console app.
Then I go to project options, and add to debug information  "full" under compiler and codeview & COFF format under linker on debug information.
I click OK, the rebuild all files, and try to debug.
It opens the disassembly, instead of steping throught source.

Freddy

  • Guest
Re: Source level debugger not working?
« Reply #3 on: August 21, 2007, 06:21:25 PM »
Solved.
I didn't know I had to check "break always" on the breakpoints tab.
Now works!

Anyway, I'll use this thread to ask something else.
While I'm debugging this code:
Code: [Select]
SOCKET sock, msock;
WSADATA wsa;
struct sockaddr_in saddr;
char buf[4096];
int len;

WSAStartup(MAKEWORD(1,1),&wsa);

sock = socket(AF_INET,SOCK_STREAM,0);
           memset(&saddr,'\0',sizeof(struct sockaddr_in));
saddr.sin_family=AF_INET;
saddr.sin_port=htons(80);
saddr.sin_addr.s_addr=inet_addr("66.94.233.46");
msock=connect(sock, (struct sockaddr *)&saddr,sizeof(struct sockaddr));
if(msock==0)
return -1;
msock is always 0, and so I can't use it. Why?
I'm trying to create a simple client, using winsock.

Thanks!
« Last Edit: August 21, 2007, 06:24:23 PM by Freddy »

JohnF

  • Guest
Re: Source level debugger not working?
« Reply #4 on: August 21, 2007, 07:21:13 PM »
msock=connect(sock, (struct sockaddr *)&saddr,sizeof(struct sockaddr));

According to MSDN returning 0 is correct for no error.

=============
Return Values
If no error occurs, connect returns zero. Otherwise, it returns SOCKET_ERROR, and a specific error code can be retrieved by calling WSAGetLastError.
=============

John