As noted earlier, a good set of unit tests will help weed out places in the code where proper parameter validation is lacking.
I believe there is a way to get the parameter values (VS.NET does it), but I think it involves using the debugging and/or profiling APIs and may required unmanaged code. More trouble than its worth. --- Patrick Steele Microsoft .NET MVP http://weblogs.asp.net/psteele/ > -----Original Message----- > From: Unmoderated discussion of advanced .NET topics. > [mailto:[EMAIL PROTECTED] On Behalf Of > Franklin Gray > Sent: Thursday, August 25, 2005 12:21 PM > To: [email protected] > Subject: Re: [ADVANCED-DOTNET] Writing code for Debugging > > > No, we don't have parameter validation code....we have no > code. We are in > the architecture phase (ok...I have some utilities written > but that's it). > As for writing the app to do the parameter validation...that > is something > I hope ALL the developers do, but it's very hard to enforce. > I can and > will do code reviews but I'm sure I will miss stuff. So, I'm > taking the > approach that the app will NOT be PERFECTLY writen and the > more I can plan > for that, the better the app will be. > > Thanks for the bad news about "there is nothing" :) I could > have sworn > there was something but it's been a long time ago. I'll > continue to look > and if I find something I'll let you know. > > THANKS ALL. > > > > > Message from Patrick Steele <[EMAIL PROTECTED]>@DISCUSS.DEVELOP.COM > received on 08/25/2005 11:09 AM > > 08/25/2005 11:09 AM > > > > Patrick Steele <[EMAIL PROTECTED]>@DISCUSS.DEVELOP.COM > > Please respond to "Unmoderated discussion of advanced .NET topics." > <[email protected]> > Sent by "Unmoderated discussion of advanced .NET topics." > <[email protected]> > > > > To: [email protected] > cc: > Subject: Re: [ADVANCED-DOTNET] Writing code > for Debugging > > IIRC, there is nothing to access parameter *values*. You can > get the names through reflection, but not the values. If you > want to dump those out you'll need to write code for that. > > Hopefully, you've already got parameter validation code that > does the initial testing of the parameters to make sure > they're within the bounds of your design. That should help > clear up a lot of the "garbage in, garbage out" errors. > > --- > Patrick Steele > Microsoft .NET MVP > http://weblogs.asp.net/psteele/ > > > > > -----Original Message----- > > From: Unmoderated discussion of advanced .NET topics. > > [mailto:[EMAIL PROTECTED] On Behalf Of Franklin > > Gray > > Sent: Thursday, August 25, 2005 11:45 AM > > To: [email protected] > > Subject: Re: [ADVANCED-DOTNET] Writing code for Debugging > > > > > > Ok....now...how about the part to write. It's been a lot > time but I > > vaguely remember coming across something that could access > parameters > > of a function. If I could build a function to call at the > beginning > > of each function and it would check to see if the trace was > turned on > > and if so it would loop through all the parameters of the calling > > function (the one I want to log the parameter values) then > that would > > save a lot of typing and centralize the process. Anybody > > know of such a thing? It's been so long I don't even > > remember what to search for. > > > > The reason I want to log parameters is because though my years of > > work, I've found that to find a bug, the parameters to a > function is > > the second best piece of information, first being the line of the > > error and the error description which of course is easy to retrieve. > > > > =================================== > > This list is hosted by DevelopMentorR http://www.develop.com > > > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentorR http://www.develop.com > > View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorR http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
