FLEX-34043: Impossible to set breakpoint in MXML files that contains item renderer. FLEX-34044: Breakpoints in ActionScript files do not work when debugging app using ANE
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/04b4d267 Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/04b4d267 Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/04b4d267 Branch: refs/heads/develop Commit: 04b4d267dcfb428d0900b49101623dc5aae2afdd Parents: 06aa01a Author: Frédéric Thomas <[email protected]> Authored: Thu Jan 16 12:40:59 2014 +0000 Committer: Frédéric Thomas <[email protected]> Committed: Thu Jan 16 12:40:59 2014 +0000 ---------------------------------------------------------------------- .../java/flex/tools/debugger/cli/DebugCLI.java | 49 ++++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/04b4d267/modules/debugger/src/java/flex/tools/debugger/cli/DebugCLI.java ---------------------------------------------------------------------- diff --git a/modules/debugger/src/java/flex/tools/debugger/cli/DebugCLI.java b/modules/debugger/src/java/flex/tools/debugger/cli/DebugCLI.java index 26fff97..f2a751d 100644 --- a/modules/debugger/src/java/flex/tools/debugger/cli/DebugCLI.java +++ b/modules/debugger/src/java/flex/tools/debugger/cli/DebugCLI.java @@ -76,6 +76,7 @@ import flash.tools.debugger.VersionException; import flash.tools.debugger.Watch; import flash.tools.debugger.WatchKind; import flash.tools.debugger.concrete.DProtocol; +import flash.tools.debugger.concrete.DSwfInfo; import flash.tools.debugger.events.BreakEvent; import flash.tools.debugger.events.ConsoleErrorFault; import flash.tools.debugger.events.DebugEvent; @@ -3375,21 +3376,41 @@ public class DebugCLI implements Runnable, SourceLocator * otherwise try to locate a matching source file in given swf. * @return null if the swf does not contain this source file */ - Location findAndEnableBreak(SwfInfo swf, SourceFile f, int line) throws NotConnectedException, InProgressException - { - int fileId = f.getId(); - if (swf != null) - { - SourceFile sameFile = m_fileInfo.similarFileInSwf(swf, f); - if (sameFile != null) - fileId = sameFile.getId(); - else - fileId = -1; - } + private Location findAndEnableBreak(final SwfInfo swf, final SourceFile file, final int line) throws NotConnectedException, + InProgressException { + if (swf == null) { + return breakEnableRequest(file.getId(), line); + } - Location l = (fileId > -1) ? breakEnableRequest(fileId, line) : null; - return l; - } + for (final SourceFile similarFile : getSimilarSourceFilesInSwf(swf, file)) { + final Location location = breakEnableRequest(similarFile.getId(), line); + if (location != null) { + return location; + } + } + + return null; + } + + private List<SourceFile> getSimilarSourceFilesInSwf(final SwfInfo info, final SourceFile file) throws InProgressException { + if (!info.isProcessingComplete()) { + // IDEA-94128. For unknown reason m_fileInfo.getSwfs() may contain "unknown" swf which is marked as not fully loaded, + // but in fact containing full list of correct sources. At the same time correct swf doesn't contain sources. + if (!(info instanceof DSwfInfo) || !((DSwfInfo) info).hasAllSource()) { + throw new InProgressException(); + } + } + + final List<SourceFile> result = new LinkedList<SourceFile>(); + + for (final SourceFile each : info.getSourceList(m_session)) { + if (m_fileInfo.filesMatch(file, each)) { + result.add(each); + } + } + + return result; + } /** * Received when a breakpoint has been removed (or disabled)
