Book a Demo

Author Topic: Debug EA addin from EA  (Read 4479 times)

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Debug EA addin from EA
« on: February 17, 2014, 09:07:37 pm »
Hello!

I have developed an EA add-in, its planning was modeled into EA.
When I finish the development I synchronized the model with the code, but, of course, sequence diagrams are not reverse engineered.

That's why I would like to debug the code from within EA, using the recorder option to generate a sequence diagram.

Is there a way to debug an addin from within EA? how?
Thanks in advance!

Ian Mitchell

  • EA User
  • **
  • Posts: 507
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
Re: Debug EA addin from EA
« Reply #1 on: February 17, 2014, 09:16:26 pm »
Have a look at ExploringEA.com - I think Adrian has figured a way to do this...
Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Debug EA addin from EA
« Reply #2 on: February 17, 2014, 10:11:02 pm »
Thanks-  great blog!
He there explains to attach another process- which is also a EA window to test the add-in.

Well, when I attach the another process, EA automatically starts to debug it. This fact disables me to record the code- in order to get the sequence diagrams generated. The Record & Analyze window remains empty.  :(

Any ideas?
Thanks.

EXploringEA

  • EA User
  • **
  • Posts: 172
  • Karma: +8/-0
    • View Profile
Re: Debug EA addin from EA
« Reply #3 on: February 18, 2014, 08:33:47 pm »
Hi,

Before my response to your question I must admit I'm not sure I fully understand how EA does this debugging / recording stuff.  It all works fine with their examples but there isn't sufficient documentation for me to be fully confident - hence my experiments!!

I had a quick look at what I wrote on my blog and I probably need to add some stuff.

Before adding some notes and potential confusion here are some terms I'll use below:

EA1 - this is the instance of EA hat contains the AddIn source code and debug script - as per my blog.

EA2 - is the other instance of EA from which you want to capture information.

So with NO instances of EA running you start EA1.

As you will need to set the process ID for attaching to EA2 you should find the Process ID of this instance  (EA1) - you can do this by starting the debug script and then looking for the sole instance of EA - this my will be EA1, so take a note of the ID and CANCEL.

Then start another instance of EA - this will be EA2 with a test model, whatever you need for you addin to run.

With both instances of EA running - EA1 and EA2 time to:
* attached to EA1 in debug mode to EA2
* test the debug works OK
* record some sequences

So start the debug script in EA1 - when the attached dialog is presented look for the second instance of EA (i.e. the one that doesn't have the ID you noted for EA1) and select - OK.

EA1 should now be attached to EA2 with the debugger.

So to check that they really are connected and the debugger is working insert a break point - I usually do this in Menu Click.

Go to EA2 and from your addin menu select an addin menu option - does it hit the breakpoint?  if not there is something wrong.  All too often when testing I've had to restart - and this is where some more information is needed!!!

Assuming that works then you can carry on and prepare for the recording - using the recorder.  As a simple test you can do the recording manually - set  breakpoints where you want recording to start and stop, then initiate the action from the AddIn in EA2.  

When you hit the start breakpoint go to the recorder window and start manual record.  Continue and when you hit the stop breakpoint stop the recording.  

If all works you should now have the relevant history which can then be used to create diagrams or saved.

It's worth going through the EA examples supplied to check out all the options.

One day I hope I fully understand what's under the hood and can provide a foolproof description of how EA does this stuff - but in the meantime I hope this helps.

BTW:  This processing can take a long time, by which I mean hours rather than minutes!!,  so suggest experiment with small segments of your code.
EXploringEA - information, utilities and addins