Search in sources :

Example 1 with DebuggerExceptionHandlingAction

use of com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerExceptionHandlingAction in project binnavi by google.

the class CDebuggerFunctions method mergeExceptionsSettings.

/**
   * Merge the exception settings from the database with the ones received from the debugger.
   *
   * @param target The debug target allowing us to access the per-module storage mechanism.
   * @param exceptions The list of exceptions received from the debugger.
   *
   * @return The collection of exceptions which have to be used during this session.
   *
   * @throws CouldntLoadDataException
   */
public static Collection<DebuggerException> mergeExceptionsSettings(final DebugTargetSettings target, final Collection<DebuggerException> exceptions, final int debuggerId) throws CouldntLoadDataException {
    final Map<Long, DebuggerException> exceptionsMap = getExceptionsMap(exceptions);
    for (final DebuggerException dbgException : exceptions) {
        final String setting = target.readSetting(DebuggerException.getSettingKey(dbgException, debuggerId));
        if (setting != null) {
            final DebuggerExceptionHandlingAction handlingAction = DebuggerExceptionHandlingAction.convertToHandlingAction(Integer.valueOf(setting));
            final DebuggerException newException = new DebuggerException(dbgException.getExceptionName(), dbgException.getExceptionCode(), handlingAction);
            exceptionsMap.put(dbgException.getExceptionCode(), newException);
        }
    }
    return exceptionsMap.values();
}
Also used : DebuggerExceptionHandlingAction(com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerExceptionHandlingAction) DebuggerException(com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerException)

Aggregations

DebuggerException (com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerException)1 DebuggerExceptionHandlingAction (com.google.security.zynamics.binnavi.debug.models.targetinformation.DebuggerExceptionHandlingAction)1