Its not just that compiling in release mode severs the link to the pdb
but there is the possibility that there are serious changes to the dll's
IL when changing between debug and release modes.
When you compile in release mode these links to the pdb file are severed
and the clr is allowed to optimise the code, so the internal design of
what you have created will no longer remain the same, because you are no
longer dealing with the same dll the pdb file is irrelevant/incompatible
(May be able to force a link, don't know).
I remember a very simple example of how the clr does this:
public int MultiplyByTwo(int num)
{
return(num*2);
}
public void aMethod()
{
int num
int twiceNum
num = 2;
twiceNum = MultiplyByTwo(num);
}
in debug mode the stack the will allocate all these items and this can
be checked using Ildasm.
in release mode the clr will optimise the method MultiplyByTwo and it
will have the following effect on the [IL] source
public void aMethod()
{
int num
int twiceNum
num = 2;
twiceNum = num*2;
}
So if you were using a pdb file to debug a release mode dll you would
not be able to step through the MultiplyByTwo method as it is no longer
present..
HTH
Alan
-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Monsur Hossain
Sent: 23 March 2003 02:27
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Associating Debugged Source with Original
So by that logic, can I build something in Release
mode, include the pdb file in the bin directory, and
get line numbers for exceptions? Or does compiling in
debug mode somehow link the dll to the pdb?
Just curious,
monsur
--- Alan Flaherty <[EMAIL PROTECTED]> wrote:
> Im not sure how its done in other languages but in
> the dot net framework
> uses symbol files (the .pbd things in the bin with
> dll's) when the
> application is running every item in the stack is
> referenced to an entry
> in the pbd file, the pbd file contains the textual
> descriptions of each
> class method etc.. when an error is thrown it uses
> the pbd file to
> locate the line number and calling methods.
>
> Try making a deeply rooted error in a page(just
> create a number of
> methods [method1 to methodn] and make each method
> call the next then
> cause an error, or just throw one, in the last
> method), compile it and
> put it on a webserver(with the pdb). Go to the error
> page and you'll see
> the detailed description of where the error occurred
> and what line
> number.
>
> Now delete the .pbd file from the application bin.
> Go back to the page
> with the error and the error source will now only
> contain the stack
> trace, no line number information etc.
>
> When you are debugging, the ide uses the same
> technique to relate the
> names and details of every item in the stack with
> the items in the
> source code. The debugger just attaches itself to
> the clr processes
> themselves to be able to look into what's being
> executed
>
> Hth
>
> Alan
>
>
> -----Original Message-----
> From: Moderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] On
> Behalf Of John Puopolo
> Sent: 20 March 2003 21:26
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] Associating Debugged
> Source with Original
>
> All,
>
> As a follow-up to my last post, I have another
> debugger-related
> question.
> How do debuggers in .NET (or any debugger) associate
> original source
> code
> with executable code being debugged?
>
> Thank you,
> John
>
> ===================================
> This list is hosted by DevelopMentorR
> http://www.develop.com
> You may be interested in Guerrilla .NET, 24 March
> 2003, in London and
> Boston
> http://www.develop.com/courses/gdotnet
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentorR
> http://www.develop.com
> You may be interested in Guerrilla .NET, 24 March
> 2003, in London and Boston
> http://www.develop.com/courses/gdotnet
>
> View archives and manage your subscription(s) at
http://discuss.develop.com
__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
===================================
This list is hosted by DevelopMentorR http://www.develop.com
You may be interested in Guerrilla .NET, 24 March 2003, in London and
Boston
http://www.develop.com/courses/gdotnet
View archives and manage your subscription(s) at
http://discuss.develop.com
===================================
This list is hosted by DevelopMentor� http://www.develop.com
You may be interested in Guerrilla .NET, 24 March 2003, in London and Boston
http://www.develop.com/courses/gdotnet
View archives and manage your subscription(s) at http://discuss.develop.com