473,396 Members | 1,838 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,396 software developers and data experts.

How to tel if IDE debugger is atatched.

Hi,

Im still trying to sort out whats cuasing the difference when the debugger
is attatched...

Ive finsihed re writting a lot of the code and although its a heck of a
lot faster it still gives the same visual diferences,
at least now it finishes a run in just second or two as oposed to nearly a
minute.

How can you tell if the debugger is atatched when you run it from the visual
C# express ?
ie either f5 or ctrl-f5, ive entered a command line parameter
"debuger_atatched" but this
is used both for f5 and ctrlf5 is used, the only way I can make it know the
diference is to
run it from outside the IDE with no parameters.

Is there any other way ?

im thinking of dumping everything when the debuger is atatched and doing a
compare when it isnt
or visa versa...

thanks

Colin =^.^=
Jan 4 '08 #1
7 1393
On Fri, 04 Jan 2008 11:18:34 -0800, colin <co*********@ntworld.NOSPAM.com>
wrote:
[...]
How can you tell if the debugger is atatched when you run it from the
visual C# express ?
The debugger is always attached when you run it from the IDE.

Could you explain what you're trying to do more clearly? Is there
something about the Debugger.IsAttached property that doesn't fulfill the
need?
im thinking of dumping everything when the debuger is atatched and doing
a
compare when it isnt or visa versa...
Why not just dump all the data you want to compare all the time (in a
special debugging build, of course). Then run once with the debugger,
save the data, run again without the debugger, save the data, then compare
the two collections of saved data.

Why is knowing whether the debugger is attached or not important?

Pete
Jan 4 '08 #2
Peter Duniho <Np*********@nnowslpianmk.comwrote:
[...]
How can you tell if the debugger is atatched when you run it from the
visual C# express ?

The debugger is always attached when you run it from the IDE.
No, that's not true. If you use Ctrl+F5 instead of F5 (Start without
Debugging instead of Start Debugging), the program runs without the
debugger being attached. You can't break into it, stop it or anything
like that - it's a completely separate process.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Jan 4 '08 #3
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Fri, 04 Jan 2008 11:18:34 -0800, colin <co*********@ntworld.NOSPAM.com>
wrote:
>[...]
How can you tell if the debugger is atatched when you run it from the
visual C# express ?

The debugger is always attached when you run it from the IDE.

Could you explain what you're trying to do more clearly? Is there
something about the Debugger.IsAttached property that doesn't fulfill the
need?
ah thats does it, duno why i didnt think to look for something like that :)
>
>im thinking of dumping everything when the debuger is atatched and doing
a
compare when it isnt or visa versa...

Why not just dump all the data you want to compare all the time (in a
special debugging build, of course). Then run once with the debugger,
save the data, run again without the debugger, save the data, then compare
the two collections of saved data.

Why is knowing whether the debugger is attached or not important?
to at least save it in different files for a start,
then hopefully compare it in the program,
so I can see where its not doing exactly the same thing ...
can I re atatch the debugger ?

Colin =^.^=
Jan 4 '08 #4
On Fri, 04 Jan 2008 12:47:14 -0800, Jon Skeet [C# MVP] <sk***@pobox.com>
wrote:
>The debugger is always attached when you run it from the IDE.

No, that's not true. If you use Ctrl+F5 instead of F5 (Start without
Debugging instead of Start Debugging), the program runs without the
debugger being attached. You can't break into it, stop it or anything
like that - it's a completely separate process.
Ah. Duh. Completely forgot about that (never use it myself :) ).

Thanks,
Pete
Jan 4 '08 #5
On Fri, 04 Jan 2008 13:27:17 -0800, colin <co*********@ntworld.NOSPAM.com>
wrote:
[...]
>Why is knowing whether the debugger is attached or not important?

to at least save it in different files for a start,
then hopefully compare it in the program,
so I can see where its not doing exactly the same thing ...
I would personally not worry about checking for the debugger being
attached, and just save the files twice, renaming the first one before I
run the program again to generate the second one. Since the code is
diagnostic-only, why complicate things by introducing a new dependency?

Of course, it would be important to write the data out as text. But if
you do that, it should be very easy to do a direct comparison (I'd
probably use Windiff, which comes with Visual Studio, as it will detect
and display all of the differences for you in an easy-to-use UI).
can I re atatch the debugger ?
You should be able to attach to the process from within VS, yes...and as
far as I know, the Debugger.IsAttached property will update to reflect the
current state.

But you'll find out soon enough if that's not true, assuming you do go
ahead and include debugger-attached-specific code. :)

Pete
Jan 4 '08 #6
Check the property: System.Diagnostics.Debugger.IsAttached.

Pedro Luna,
Gye, Ecu

"colin" <co*********@ntworld.NOSPAM.comescribió en el mensaje de
noticias:eE*****************@newsfe3-win.ntli.net...
Hi,

Im still trying to sort out whats cuasing the difference when the debugger
is attatched...

Ive finsihed re writting a lot of the code and although its a heck of a
lot faster it still gives the same visual diferences,
at least now it finishes a run in just second or two as oposed to nearly a
minute.

How can you tell if the debugger is atatched when you run it from the
visual C# express ?
ie either f5 or ctrl-f5, ive entered a command line parameter
"debuger_atatched" but this
is used both for f5 and ctrlf5 is used, the only way I can make it know
the diference is to
run it from outside the IDE with no parameters.

Is there any other way ?

im thinking of dumping everything when the debuger is atatched and doing a
compare when it isnt
or visa versa...

thanks

Colin =^.^=
Jan 5 '08 #7
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
On Fri, 04 Jan 2008 13:27:17 -0800, colin <co*********@ntworld.NOSPAM.com>
wrote:
>[...]
>>Why is knowing whether the debugger is attached or not important?

to at least save it in different files for a start,
then hopefully compare it in the program,
so I can see where its not doing exactly the same thing ...

I would personally not worry about checking for the debugger being
attached, and just save the files twice, renaming the first one before I
run the program again to generate the second one. Since the code is
diagnostic-only, why complicate things by introducing a new dependency?
I didnt think of that but having the name indicate wether its attached is
reassuring.
Of course, it would be important to write the data out as text. But if
you do that, it should be very easy to do a direct comparison (I'd
probably use Windiff, which comes with Visual Studio, as it will detect
and display all of the differences for you in an easy-to-use UI).
I added more and more data to the dump,
only finding a few diferences in floats of +/- 1 to 3 in the last of 7
digits,
but then noticed Xna.Framework.Ray.IntersectPlane was returning null in one
but not the other,
wich affected wether it thought surfaces were hidden or not wich explains
the visual differences.

it does a ray trace from a point wich is intended to be inside the model to
the point of interest
then checks that ray against every surface to determine if its behind that
surface or not.
there didnt seem to be a pattern so I dumped every call to it.

so I now have 2 x 45mb of data to compare,
Windiff has been churning cpu time for the last 1/2 hour trying to expand
the comparisons
lol... although the windiff I have came with Visual studio v6
I also have WinMerge but that spends ages at 100% cpu too
>can I re atatch the debugger ?

You should be able to attach to the process from within VS, yes...and as
far as I know, the Debugger.IsAttached property will update to reflect the
current state.

But you'll find out soon enough if that's not true, assuming you do go
ahead and include debugger-attached-specific code. :)
bah i have the express version seems its not available ...
no wonder I cldnt find it.

Colin =^.^=
Jan 5 '08 #8

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

Similar topics

6
by: jonathan | last post by:
everyone, I'd like to be able to debug php scripts on the command line, going through the browser. In other words, set up the debugger to listen and then type in a url and have the code stop...
11
by: Ziaran _ | last post by:
I have written a new debugger. I think people will find it useful. Where can I post it for people to download? Thanks, Nir _________________________________________________________________...
4
by: Chuck Ritzke | last post by:
Hi, I've been using VS for a number of projects and the debugger has worked as advertised until now. I have a desktop solution with three projects, two of which are class modules. For some...
25
by: Jeff | last post by:
Use the MS Script Editor included free with MS Office 2002 and above, for debugging Internet Explorer (IE). This subject is of great interest to many JS developers, as there is no obvious, low...
1
by: Rhino | last post by:
Is there any way to install the IBM Distributed Debugger V9.2 on Windows XP without first uninstalling DB2? I installed the IBM Distributed Debugger V9.2 on my Windows XP box in the hopes of...
18
by: R. Bernstein | last post by:
Okay, a bit of an exaggeration. Recently, I've been using Python more seriously, and in using the debugger I think one of the first things I noticed was that there is no "restart" ("R" in...
3
by: Doug | last post by:
I'm having problems w/ the VS2005 debugger with C#. It blows past any breakpoints in even the simplest "Hello World" console application. I can't do any step-by-step debugging. I've provided the...
3
by: colin | last post by:
Hi, Ive finally found what the difference is, it seems a difference of the least significant bit is enough to cuase a problem with part of my code, wich determins if one point is inside a 3d...
7
by: colin | last post by:
Hi, Ive written a 3dmodel editor, and it works fairly well it harldy uses any cpu exept when its loading a texture from bitmap in the debugger, at all other times it hardly uses any cpu but from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.