473,386 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can I attach an External Debug Window to My Running Executable?

Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for
a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the
problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to
receive trace information for display in a window, or is there a third-party
tool?

TIA

Charles
Nov 20 '05 #1
6 1888
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp

Ken
----------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl...
Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for
a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the
problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to
receive trace information for display in a window, or is there a third-party
tool?

TIA

Charles

Nov 20 '05 #2
Hi Ken

Thanks for the link. I just came across this actually, but the downside is
that it would seem that I have to have the development environment installed
on the client machine. Is that correct?

I am really looking for something quite simple. If I have Trace statements
in my code then the output goes to the Output window in the VS debugger. I
would like to receive those messages in an external program - perhaps one
that I have to write. Do you know if it can be done?

Charles
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uL**************@tk2msftngp13.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp
Ken
----------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl...
Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to receive trace information for display in a window, or is there a third-party tool?

TIA

Charles

Nov 20 '05 #3
Hi,

Maybe this will help.
http://www.codeguru.com/vb/gen/vb_sy...cle.php/c7525/

http://msdn.microsoft.com/msdnmag/is...g/default.aspx

Ken
-------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:Ol**************@TK2MSFTNGP09.phx.gbl...
Hi Ken

Thanks for the link. I just came across this actually, but the downside is
that it would seem that I have to have the development environment installed
on the client machine. Is that correct?

I am really looking for something quite simple. If I have Trace statements
in my code then the output goes to the Output window in the VS debugger. I
would like to receive those messages in an external program - perhaps one
that I have to write. Do you know if it can be done?

Charles
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uL**************@tk2msftngp13.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp
Ken
----------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl...
Suppose my application is running on a client machine, and they report an
intermittent problem. It only occurs after the program has been running for a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a
third-party program), load it onto the client machine - without stopping the problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens
in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application to receive trace information for display in a window, or is there a third-party tool?

TIA

Charles


Nov 20 '05 #4
Hi Ken

The codeguru article looks like just the job. Thanks.

Charles
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:er**************@tk2msftngp13.phx.gbl...
Hi,

Maybe this will help.
http://www.codeguru.com/vb/gen/vb_sy...cle.php/c7525/

http://msdn.microsoft.com/msdnmag/is...g/default.aspx

Ken
-------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:Ol**************@TK2MSFTNGP09.phx.gbl...
Hi Ken

Thanks for the link. I just came across this actually, but the downside is
that it would seem that I have to have the development environment installed on the client machine. Is that correct?

I am really looking for something quite simple. If I have Trace statements
in my code then the output goes to the Output window in the VS debugger. I
would like to receive those messages in an external program - perhaps one
that I have to write. Do you know if it can be done?

Charles
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uL**************@tk2msftngp13.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...ingProgram.asp

Ken
----------------------
"Charles Law" <bl***@nowhere.com> wrote in message
news:u5**************@TK2MSFTNGP10.phx.gbl...
Suppose my application is running on a client machine, and they report an intermittent problem. It only occurs after the program has been running

for
a while, and then occasionally fails to perform correctly.

I would like to be able to come along with a program I have written (or a third-party program), load it onto the client machine - without stopping

the
problem application - and attach to the application to receive trace
information in a window.

I can add any code needed to my application now, so that when this happens in real life I am prepared.

Can this be done?

What code would I need to add to my application to make this possible?

How do I write a small program that can attach to my running application

to
receive trace information for display in a window, or is there a

third-party
tool?

TIA

Charles


Nov 20 '05 #5

The following works with the standart output:

in your app.exe.config file add
<system.diagnostics>
<switches>
<add name="myTraceFlag1" value="0"/>
</switches>
</system.diagnostics>

When the customer have a problem, tell him to change the value, e.g
<add name="myTraceFlag" value="4"/>

value options:
0 none TraceSwitch is disabled.
1 TraceError: Only Errors.
2 TraceWarning: Errors and Warnings.
3 TraceInformation: Errors, Warnings, and Info.
4 TraceVerbose: All kinds of messages are traced.
No filter is applied.

' in your application add the following code:
Dim tl As New TextWriterTraceListener(System.Console.Out)
Trace.Listeners.Add(tl)

' Use Trace.WriteLineIf :
dim ts As New TraceSwitch("myTraceFlag1", "description")
Trace.WriteLineIf(ts.TraceInfo, myStrStatus)
Trace.WriteLineIf(ts.TraceWarning, myStrStatus)
Run your application using stdOutput:
myApp.exe > myWarnings.txt

and you will get your Trace lines in "myWarnings.txt" file

Atara



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #6
Thanks Atara. A neat solution.

Charles
"Atara" <At***@DD.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

The following works with the standart output:

in your app.exe.config file add
<system.diagnostics>
<switches>
<add name="myTraceFlag1" value="0"/>
</switches>
</system.diagnostics>

When the customer have a problem, tell him to change the value, e.g
<add name="myTraceFlag" value="4"/>

value options:
0 none TraceSwitch is disabled.
1 TraceError: Only Errors.
2 TraceWarning: Errors and Warnings.
3 TraceInformation: Errors, Warnings, and Info.
4 TraceVerbose: All kinds of messages are traced.
No filter is applied.

' in your application add the following code:
Dim tl As New TextWriterTraceListener(System.Console.Out)
Trace.Listeners.Add(tl)

' Use Trace.WriteLineIf :
dim ts As New TraceSwitch("myTraceFlag1", "description")
Trace.WriteLineIf(ts.TraceInfo, myStrStatus)
Trace.WriteLineIf(ts.TraceWarning, myStrStatus)
Run your application using stdOutput:
myApp.exe > myWarnings.txt

and you will get your Trace lines in "myWarnings.txt" file

Atara



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: AKA COOPERMAN | last post by:
As C# express only creates RELEASE builds, how do I get my Debug.WriteLine statements to work ?
3
by: Sebastien Tardif | last post by:
After I open a workspace I have access to all C++ files of the workspace. I can put breakpoints. Everything look great... So I go attach to my process and Visual C++ go close my workspace! I...
9
by: Jon Davis | last post by:
I am working with an application that is compiled as a COM EXE (written in Delphi 7). I don't know if it's the nature of COM EXE or if it's implemented in the COM EXE, but when I create a new...
1
by: Martin Simard | last post by:
Hi all, In VS 2003, when I attach to a remote process for debugging, I can see the list of modules loaded by the process before attaching to it. This list is not there anymore in VS 2005....
6
by: Scubadude | last post by:
Hi, I'm new to perl and have run into some roadblocks while trying to run tutorials. I have installed Apache v2.2.3 I have installed ActivePerl v6.6.1.638 I have installed php v5.2.0 I am...
5
by: Kees de Winter | last post by:
Is it possible to attach the VS2005 debugger to an already running, and published website? If I choose "Attach to process" from the menu and then select the right process, set breakpoints, run the...
7
by: 2b|!2b==? | last post by:
I am attempting to manually load debug symbols for a module. I am doing it by carrying out the ff steps: i). Select the call stack window ii). right click and select 'Load Symbols' from...
4
by: Brad Pears | last post by:
I have a vb.net 2005 project and have made a lot of modifications to it. The project runs fine in debug mode. Now I want to implement it and first I am running the executable on my machine to make...
6
by: GaryDean | last post by:
I see some references on debugging by attaching to a process. There are MSDN articles that show how to attach to a process for debugging. However, I can find no info on how exactly to get the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.