473,386 Members | 1,745 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.

Compile time trace info

Is there a way to get information like line number, function name, etc.
at compile time?

Something like:

MessageBox.Show( "Executed at" + __LINE__ + " in " + __FUNCTION__ );

The suggestions I've seen in this regard deal with doing this at
runtime which will only work if the code is not obfuscated, not
optimized, and includes debug information. I would prefer to insert
this information at compile time instead.

Aug 16 '06 #1
1 1478
As far as I know there is no way to do this at least not with C#. That was
possible in C++, but I don't know if they still support it in .NET versions
of the compiler.
--
Stoitcho Goutsev (100)

<sh******@cs.fsu.eduwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Is there a way to get information like line number, function name, etc.
at compile time?

Something like:

MessageBox.Show( "Executed at" + __LINE__ + " in " + __FUNCTION__ );

The suggestions I've seen in this regard deal with doing this at
runtime which will only work if the code is not obfuscated, not
optimized, and includes debug information. I would prefer to insert
this information at compile time instead.

Aug 16 '06 #2

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

Similar topics

2
by: Ken | last post by:
I would like to start using EventLogTraceListener, and am running into a couple of significant limitations: 1) I have found that there is no way to write EventLog entries with different...
8
by: Davy | last post by:
Hi all, I use VC and gcc/gdb to compile and debug C/C++ files. But I found some of the debug version of the compiled files are too large to be run in a small RAM. Can I compile C/C++ Debug...
5
by: Brice Prunier | last post by:
Here under 4 schemas i'm working with ( it may be long: sorry...) The context is the following : Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous schema: no TargetNamespace )...
10
by: Bart Goeman | last post by:
Hi, I have a question about how to put redundant information in data structures, initialized at compile time. This is often necessary for performance reasons and can't be done at run time (data...
6
by: Baskar RajaSekharan | last post by:
In C-sharp, I wnat to know whether the Component is compiled in Debug Mode or Run Mode through Code. How is it possible? Is there any way to Access the Config file and check? Please let me know...
5
by: martin | last post by:
Hi, The trace class seems to me to be very usefull however there are a few features of it that have to confused. I am using visual studio 2003. the IDE will not let me write ...
5
by: TPS | last post by:
When I set trace enable to true in my web.config file, the debug info does not display at the "bottom" of the page, it displays "under" all of my buttons, labels, grids etc. This behavior...
6
by: Terry Olsen | last post by:
I would like to put program info in my applications' about screen such as compile date & time, lines of code, etc. Is there a way to do this automatically when I compile?
1
by: electrixnow | last post by:
Help!, I need to compile this code with static libs so it run on another XP machine that does'nt have MS Studio installed. When I compile now I get an ERROR: 1>------ Rebuild All started:...
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: 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: 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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
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...

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.