Bug 284397 - Plugin.isDebugging does not deliver true after Plugin.setDebugging has been called.
Summary: Plugin.isDebugging does not deliver true after Plugin.setDebugging has been c...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.6 M4   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 284348
  Show dependency tree
 
Reported: 2009-07-23 07:43 EDT by Boris Gruschko CLA
Modified: 2009-12-04 14:32 EST (History)
2 users (show)

See Also:


Attachments
Project containing a test case (2.94 KB, application/zip)
2009-07-23 07:43 EDT, Boris Gruschko CLA
no flags Details
patch (1.53 KB, patch)
2009-07-23 11:09 EDT, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Gruschko CLA 2009-07-23 07:43:35 EDT
Created attachment 142369 [details]
Project containing a test case

I try to set a plug-in into debug mode. However, after calling Plugin.setDebugging(true) the Plugin.isDebugging() method delivers false.

I guess this has something to do with the implementation of setOption(String,String) in org.eclipse.osgi.framework.debug.FrameworkDebugOptions.

_test.SetDebuggingTest in the attached project illustrates the problematic behaviour.
Comment 1 Thomas Watson CLA 2009-07-23 11:09:36 EDT
Created attachment 142404 [details]
patch

There are two bugs here I think:

1) The Plugin.setDebugging method ultimately needs to call DebugOptions.setDebugEnabled(true)

I would have thought this could be worked around by simply using the -debug option with no options file.  This enables the DebugOptions service but it still does not allow options to be set.  These leads to the second bug in FrameworkDebugOptions

2) FrameworkDebugOptions should allow options to be set if the -debug option is used even if there is no options file to read at initialization.  In this case the current code will null out the "options" field which prevents any options from being set.
Comment 2 Thomas Watson CLA 2009-07-23 11:12:26 EDT
A workaround is to use the -debug option to launch and point it to a file that contains least one property.  This property can just be junk:

workaroundBug284397=true
Comment 3 Boris Gruschko CLA 2009-07-23 11:15:47 EDT
your patch works for me. Thanks.
Comment 4 Thomas Watson CLA 2009-12-04 11:45:15 EST
Sorry, this bug has been sitting here so long with an unreleased patch.  I released the patch for 3.6 M4.  John, do you think we should consider this bug for 3.5.2?
Comment 5 John Arthorne CLA 2009-12-04 14:32:14 EST
(In reply to comment #4)
> Sorry, this bug has been sitting here so long with an unreleased patch.  I
> released the patch for 3.6 M4.  John, do you think we should consider this bug
> for 3.5.2?

I don't think so - it is not a critical bug or regression for an end user.