Re: private fields of component show up in debugger

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Hairlip,

I think Pete's explanation is reasonable. For the accessor of class(such as
private, protected, public), they will restrict the accessibility of class
members in program(from other classes in same assembly or from other
assemblies). However, debugger is not restricted by these accessors. The
debugging tools will directly inspect the runtime program's memory to get
the execution data structure and contents of the application being debuged.
And as long as the program (being debuged) provide the necessary metadata
and symbols, the debugging tools can inspect into each data
member/variables in the program. Here when you debugging the console
application(and also the referenced class library assembly), the VS IDE can
get the symbols, so all the variables is available in debugger.

here are some information about symbols and debugging:

http://www.microsoft.com/whdc/devtools/debugging/debugstart.mspx

http://www.codeproject.com/useritems/symbols.asp

Anyway, if what you worry about is only the debugger, you can think it
completely different from the container application since whether container
application can see the referenced class library assembly's internal data
or not is determined at compile/build time(according to the member accessor
).

If you still have any question on this, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: System.ValueType
    ... I was debugging a project that I developed, ... > noticed in the locals window that one of the members in my structure is ... No. ValueType is the base type for all structures, and in the debugger, ... base types are shown like members. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Debuging by value
    ... You are correct, sort of. ... am using a class and property accessor that is very frequently used. ... which is the real power of debugging by value (another ... >> Jason, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How does GDB object inspection work?
    ... I'm trying to write an application that takes a structure defined in a header file and is capable, given a pointer to such a structure instance, to print the structure instance information in the same way GDB does. ... Compilers have options to generate debugging info, ... Another way, just for the struct/class members, is to get ...
    (comp.unix.programmer)
  • Re: What is this?
    ... of its members.) ... This is a FAQ. ... Mark McIntyre ... "Debugging is twice as hard as writing the code in the first place. ...
    (comp.lang.c)
  • Re: CLOS Question - Making an object a constant
    ... With further debugging, I was able to resolve the problem. ... function and I had forgotten that it destructively modifies the list. ... :accessor to a:reader didn't help. ...
    (comp.lang.lisp)