You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/06/02 19:05:37 UTC
[34/50] [abbrv] git commit: [flex-falcon] [refs/heads/develop] -
re-apply 04b4d267dcfb428d0900b49101623dc5aae2afdd from Flex SDK
re-apply 04b4d267dcfb428d0900b49101623dc5aae2afdd from Flex SDK
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/beb60a1b
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/beb60a1b
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/beb60a1b
Branch: refs/heads/develop
Commit: beb60a1b012c522abe94b0c312a19ac90201ef3a
Parents: 604f092
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jun 1 10:43:05 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jun 1 10:43:05 2015 -0700
----------------------------------------------------------------------
.../src/flex/tools/debugger/cli/DebugCLI.java | 48 ++++++++++++++------
1 file changed, 34 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/beb60a1b/debugger/src/flex/tools/debugger/cli/DebugCLI.java
----------------------------------------------------------------------
diff --git a/debugger/src/flex/tools/debugger/cli/DebugCLI.java b/debugger/src/flex/tools/debugger/cli/DebugCLI.java
index 796f32f..efb1187 100644
--- a/debugger/src/flex/tools/debugger/cli/DebugCLI.java
+++ b/debugger/src/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;
@@ -3721,22 +3722,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;
- }
+ Location findAndEnableBreak(final SwfInfo swf, final SourceFile file, final int line) throws NotConnectedException, InProgressException {
+ if (swf == null) {
+ return breakEnableRequest(file.getId(), line, m_activeIsolate);
+ }
- Location l = (fileId > -1) ? breakEnableRequest(fileId, line, swf.getIsolateId()) : null;
- return l;
- }
+ for (final SourceFile similarFile : getSimilarSourceFilesInSwf(swf, file)) {
+ final Location location = breakEnableRequest(similarFile.getId(), line, swf.getIsolateId());
+ 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)
*/