winedbg breakpoint on recv

Questions about Wine on Linux
Locked
anon54672345
Newbie
Newbie
Posts: 2
Joined: Fri May 16, 2014 10:05 am

winedbg breakpoint on recv

Post by anon54672345 »

Hello everyone,

I am trying to set a breakpoint on the recv function using winedbg, however it seems that it sets the breakpoint in the wrong library.

When I run the command in winedbg:

Code: Select all

Wine-dbg>break recv
Breakpoint 1 at 0x... recv in libc.so.6
it sets a breakpoint on the recv function in libc, but on windows the recv function is in the ws2_32 library http://msdn.microsoft.com/en-us/library ... 85%29.aspx . The breakpoint that is set in libc's recv also never actually breaks, although I know that the program uses the send and recv functions to communicate with a server.

Setting breakpoints on WSARecv and WSARecvFrom properly set the breakpoints in the ws2_32 library:

Code: Select all

Wine-dbg>break WSARecv
Breakpoint 2 at 0x... WSARecv in ws2_32

Code: Select all

break WSARecvFrom
Breakpoint 3 at 0x... WSARecvFrom in ws2_32
How can I set a breakpoint on the recv function in the ws2_32 library?

Thanks in advance!
anon54672345
Newbie
Newbie
Posts: 2
Joined: Fri May 16, 2014 10:05 am

Re: winedbg breakpoint on recv

Post by anon54672345 »

Found the solution!

Using the nm command with grep I was able to find out that the recv function is called WS_recv.

Code: Select all

$ nm -D /usr/lib/wine/ws2_32.dll.so | grep recv
0001fc56 T WS_recv
0001fcdb T WS_recvfrom
         U recvmsg
and setting the breakpoint:

Code: Select all

Wine-dbg>break WS_recv
Breakpoint 1 at 0x... WS_recv in ws2_32
worked as it should.
Locked