Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] [DSF] LaunchUtils.getGDBPath

Hi,
looking at LaunchUtils.getGDBPath, I see this:

    public static IPath getGDBPath(ILaunchConfiguration configuration) {
        IPath retVal = new Path(IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT);
        try {
            retVal = new Path(configuration.getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, 
            		                                     IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_NAME_DEFAULT));
        } catch (CoreException e) {
        }
        return retVal;
    }

So, if an exception is thrown, this code returns default value, without any reporting to
the log -- which seems like a pretty questionable behaviour. I'd much rather get a big
error box then have wrong debugger used.

Alternatively, if it is considered that CoreException can only be thrown here if all
of Eclipse is burning in flames already, should a helper function 'getAttributeUnchecked'
be added that would call 'getAttribute' method, catch CoreException and rethrow an
unchecked exception in tha case?

Thanks,

-- 
Vladimir Prus
CodeSourcery
vladimir@xxxxxxxxxxxxxxxx
(650) 331-3385 x722


Back to the top