Hi!

I'm trying to implement transparent method interception without
breaking the debugger.

The scenario is this.

I dynamically load an assembly from disc in a secondary application
domain, modify the assembly and return an byte array to the main
application domain.

The modified assembly then gets loaded into the main application
domain using
Assembly  assembly = Assembly.Load(byteArray);

No problem so far.

The problem comes when trying to debug the methods that has been
modified.
The debugger completely ignores all breakpoints and as I have
understood this has something to do with the pdb not being in sync
with the assembly anymore.

Now, I have tried to use the LoadSymbols and SaveSymbols methods, but
that did not get me very far for two reasons.

1. The SaveSymbols seems to update the pdb on disc while I want
"updated" debug information that can be loaded into the main appdomain
using the
public static Assembly Load(byte[] rawAssembly,byte[] rawSymbolStore)
overload.


2. Even when trying to modify the pdb (using SaveSymbols()) on disc it
seems to fail and somehow mess up the debug info even if I did not
make any changes to the assembly in the first place.

As I understand it I need to update the sequence points if I make any
changes to the IL.

So to sum it all up, I am looking for a way to modify a assembly in
memory (secondary app domain) and the load the modified assembly along
with the "correct" debug information into the main app domain.

This is all going into a change tracking mechanism for our domain
objects, but I can't really say goodbye to debugging either :)


Any help would be greatly appreciated


Regards

Bernhard Richter
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---

Reply via email to