Debugging using "Attach to process" failing...

Dear All,

Platform: Windows 2000
Developed on: MS VC++ 6.

I have a client-server application in which client application communicates
with server application via IPC mechanism. Both of the applications are
build in Debug mode. I want to debug the communication b/w them.

For instance, client calls an function “ReadString” which communicates with
the server to get the string. I need to debug this flow.

For this I am debugging the client by attaching the server process (in VC++
UI goto Build->StartDebug->attach to process )

I have placed the debug points at the server application at the point where
the readstring from server gets called. But when i try to do this, it
doesnot debug rather shows assembly code. And then I have to stop debugging.
Whereas ideally it should go to the debug point at server code.

Can somebody tell me the exact procedure to debug the same. Or alternatively
what may be the reason for improper debugging. Please suggest.

Thanks and Regards,
Rohit

> Can somebody tell me the exact procedure to debug the same. Or

alternatively
what may be the reason for improper debugging. Please suggest.

Before doing other Trail&Error method, try inserting hardcoded breakpoints
in code and check wheather u get control or not.

__asm int 3

will work.

Regards,
Satish K.S

Did you try debugging the server process from the task manager?

Task Manager->Process Tab-> Click on “server process”->RMB->debug

HTH,

Kartik

On Fri, 8 Oct 2004 15:27:38 -0700, Rohit Dhamija
wrote:
> Dear All,
>
> Platform: Windows 2000
> Developed on: MS VC++ 6.
>
> I have a client-server application in which client application communicates
> with server application via IPC mechanism. Both of the applications are
> build in Debug mode. I want to debug the communication b/w them.
>
> For instance, client calls an function “ReadString” which communicates with
> the server to get the string. I need to debug this flow.
>
> For this I am debugging the client by attaching the server process (in VC++
> UI goto Build->StartDebug->attach to process )
>
> I have placed the debug points at the server application at the point where
> the readstring from server gets called. But when i try to do this, it
> doesnot debug rather shows assembly code. And then I have to stop debugging.
> Whereas ideally it should go to the debug point at server code.
>
> Can somebody tell me the exact procedure to debug the same. Or alternatively
> what may be the reason for improper debugging. Please suggest.
>
> Thanks and Regards,
> Rohit
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>



============================================================
“A slow sort of country!” said the Queen. “Now, HERE, you see, it
takes all the running YOU can do, to keep in the same place.
If you want to get somewhere else, you must run at least twice as
fast as that.”
-Lewis Carroll

I tried this also, but the error “cannot execute program is displayed”
rohit
“Kartik Jayaraman” wrote in message news:xxxxx@ntdev…
> Did you try debugging the server process from the task manager?
>
> Task Manager->Process Tab-> Click on “server process”->RMB->debug
>
> HTH,
>
> Kartik
>
> On Fri, 8 Oct 2004 15:27:38 -0700, Rohit Dhamija
> wrote:
>> Dear All,
>>
>> Platform: Windows 2000
>> Developed on: MS VC++ 6.
>>
>> I have a client-server application in which client application
>> communicates
>> with server application via IPC mechanism. Both of the applications are
>> build in Debug mode. I want to debug the communication b/w them.
>>
>> For instance, client calls an function “ReadString” which communicates
>> with
>> the server to get the string. I need to debug this flow.
>>
>> For this I am debugging the client by attaching the server process (in
>> VC++
>> UI goto Build->StartDebug->attach to process )
>>
>> I have placed the debug points at the server application at the point
>> where
>> the readstring from server gets called. But when i try to do this, it
>> doesnot debug rather shows assembly code. And then I have to stop
>> debugging.
>> Whereas ideally it should go to the debug point at server code.
>>
>> Can somebody tell me the exact procedure to debug the same. Or
>> alternatively
>> what may be the reason for improper debugging. Please suggest.
>>
>> Thanks and Regards,
>> Rohit
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as: xxxxx@gmail.com
>> To unsubscribe send a blank email to xxxxx@lists.osr.com
>>
>
>
> –
>
>
>
> ============================================================
> “A slow sort of country!” said the Queen. “Now, HERE, you see, it
> takes all the running YOU can do, to keep in the same place.
> If you want to get somewhere else, you must run at least twice as
> fast as that.”
> -Lewis Carroll
>
>

When you attach to the process, do you get a prompt that no symbols are
found or something? If not, then VS is able to load the symbols for your
application. In this case once you attach to the process, you should try to
open your source file and then put a breakpoint in there. Alternatively you
can try using windbg which has much better ways to find out if correct
symbols are loaded or not and other information.

I guess in VC 7 there is a way to tell the debugger to load specific symbols
too but i am not sure if such thing exist for VC 6 or not. You might want to
check out MSDN for details on that.


Pankaj Garg
This posting is provided “AS IS” with no warranties and confers no rights.

“Rohit Dhamija” wrote in message
news:xxxxx@ntdev…
> Dear All,
>
> Platform: Windows 2000
> Developed on: MS VC++ 6.
>
> I have a client-server application in which client application
communicates
> with server application via IPC mechanism. Both of the applications are
> build in Debug mode. I want to debug the communication b/w them.
>
> For instance, client calls an function “ReadString” which communicates
with
> the server to get the string. I need to debug this flow.
>
> For this I am debugging the client by attaching the server process (in
VC++
> UI goto Build->StartDebug->attach to process )
>
> I have placed the debug points at the server application at the point
where
> the readstring from server gets called. But when i try to do this, it
> doesnot debug rather shows assembly code. And then I have to stop
debugging.
> Whereas ideally it should go to the debug point at server code.
>
> Can somebody tell me the exact procedure to debug the same. Or
alternatively
> what may be the reason for improper debugging. Please suggest.
>
> Thanks and Regards,
> Rohit
>
>
>

The process attach feature of the msvc 6.0 debugger is very weak.

Using the -p command line argument works better, sometimes.

Using wingbg or msvc 7 works better yet.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of int3
Sent: Friday, October 08, 2004 6:15 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Debugging using “Attach to process” failing…

Can somebody tell me the exact procedure to debug the same. Or
alternatively what may be the reason for improper debugging. Please
suggest.

Before doing other Trail&Error method, try inserting hardcoded
breakpoints in code and check wheather u get control or not.

__asm int 3

will work.

Regards,
Satish K.S


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@dchbk.us
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi,

I wanted to clarify a single doubt in addition to my query:::
The process that we have to attach should be fully running (i.e Executed
Ctrl+F5) or should be in debug state(i.e F5) ??
Currently i am running the server part and then attaching to my client
application (using Attach to process method)

My main concern behind debugging is to analyse the IPC mechanism going
around in the Client-Server application, so any alternate method to achieve
the same ??

b/w I tried to add -p command but it didn’t served the purpose.

Thanks,
Rohit

“Kartik Jayaraman” wrote in message news:xxxxx@ntdev…
> Did you try debugging the server process from the task manager?
>
> Task Manager->Process Tab-> Click on “server process”->RMB->debug
>
> HTH,
>
> Kartik
>
> On Fri, 8 Oct 2004 15:27:38 -0700, Rohit Dhamija
> wrote:
>> Dear All,
>>
>> Platform: Windows 2000
>> Developed on: MS VC++ 6.
>>
>> I have a client-server application in which client application
>> communicates
>> with server application via IPC mechanism. Both of the applications are
>> build in Debug mode. I want to debug the communication b/w them.
>>
>> For instance, client calls an function “ReadString” which communicates
>> with
>> the server to get the string. I need to debug this flow.
>>
>> For this I am debugging the client by attaching the server process (in
>> VC++
>> UI goto Build->StartDebug->attach to process )
>>
>> I have placed the debug points at the server application at the point
>> where
>> the readstring from server gets called. But when i try to do this, it
>> doesnot debug rather shows assembly code. And then I have to stop
>> debugging.
>> Whereas ideally it should go to the debug point at server code.
>>
>> Can somebody tell me the exact procedure to debug the same. Or
>> alternatively
>> what may be the reason for improper debugging. Please suggest.
>>
>> Thanks and Regards,
>> Rohit
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as: xxxxx@gmail.com
>> To unsubscribe send a blank email to xxxxx@lists.osr.com
>>
>
>
> –
>
>
>
> ============================================================
> “A slow sort of country!” said the Queen. “Now, HERE, you see, it
> takes all the running YOU can do, to keep in the same place.
> If you want to get somewhere else, you must run at least twice as
> fast as that.”
> -Lewis Carroll
>
>