Finding References to Ojbect IDs created with "Make Object ID"


once object id assigned, there straight forward way of locating all active references?

for example, label object object id while in debugger and continue. later, i hit a different breakpoint instance of unrelated object. there a way while @ later breakpoint find occurrences of object labeled earlier?

i'm trying hunt down an objectdisposedexception in code didn't write , such feature useful. conceptually, information needed can provided garbage collector; return list of objects reference labeled object , ide allow inspect them interactively. implemented or more complicated that?



thanks!

object ids debugger thing.  gc doesn't know it.  object ids added allow track objects in debugger.  in native code use address since .net objects don't have fixed addresses isn't possible.  hence need object ids.  therefore there no way identify references particular object instance afaik.  trying find references memory address @ runtime. 

as tracking down problem in tough situation.  if getting above exception have .net equivalent of null reference.  unfortunately there no easy way debug this.  won't notification when gc decides object free.  have no control on when gc runs there isn't place put breakpoint.  if have access control source (or if derives framework object implements idisposable) set breakpoint there.  lets know when object freed.  doesn't know when references object released.  need know when object thought being referenced no longer is.  gc doesn't calculation until runs.

i recommend start code getting ode.  code should know object should around no longer is.  there can find references object , verify instance being kept around somewhere.  if helps unmanaged code common place ode occurs because unmanaged code doesn't count reference object.

michael taylor - 7/29/08
http://p3net.mvps.org


Archived Forums V  >  Visual C# IDE



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'