ecd: Cannot set breakpoint in decompiled class during debugging

Description

When trying to set a breakpoint in a ECD decompiled class file, the toggle action is ignored without any log or exception.

Repro:

  • Start debugging a project
  • Open a class with decompiler editor
  • Try to set breakpoint
  • Observe there are no logs and the breakpoint is not added either

Cause

I’ve done a little investigation, and it may a regression after #37 . In the DecompileUtil.mapSources method a fallback is applied in case of the “mapSource” method is not found here. This is triggered by NoSuchMethodError, however ReflectionUtil.invokeMethod fails silently here and here, therefore the code can never get to the fallback.

And the already existing sourceRange mapping is removed by this time in DecompileUtil, which later causes org.eclipse.debug to fail to find the source and ignore the add breakpoint toggle.

Another issue (?) seems to be, that the DecompileUtil is called with org.eclipse.jdt.internal.core.SourceMapper instance, not DecompilerSourceMapper which contains switchMapSource when invoked during debugging (class is opened by ctrl+shift+t -> Open Type).

Solution could be to find the correct method using ReflectionUtils.getDeclaredMethod and once the method is found call that (and not rely on the exceptions, or on switchMapSource).

This may also cause #35

If you want I can open a PR with the fix.

Installation info

ECD: 3.1.0 Eclipse: Photon (I20180611-0500) Platform: Windows and Linux

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 25

Most upvoted comments

Most open source projects:

  1. Silence
  2. Works for me
  3. Fix it yourself
  4. (2) so go and (3)

Happy to say 3.1.1 is working. Cheers Bob!

I’m seeing the same problem. I can’t set breakpoints in any class files now. I hope that PR fixes it, and is released soon.

I’ve just published 3.1.1 with this fix and it should already be available for automatic updating.

All of 'em!

How many fucking expletives would you like @robertzenz? 😃

Many thanks for keeping this tool going, it’s been invaluable over the years

Sorry for the late response, I was quite busy/occupied for the most time. This did not go unnoticed (nothing does), and I actually managed to get some spare time to spent on this today or tomorrow. If I have not looked at this by Friday, feel free to remind me of this by using some expletives, I agree that this has been sitting around for far too long.