Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TISTUD-7521:iOS debugger connection refused with SDKs 3.5.0 and 3.5.1 #328

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,7 @@ public ISourceMapResult getOriginalMappedLocation(URI generatedLocation, int sou
}
try
{
IResource resource = getWorkspaceRoot()
.findMember(Path.fromOSString(generatedLocation.getPath()));
IResource resource = getWorkspaceRoot().findMember(Path.fromOSString(generatedLocation.getPath()));
return sourceMap.getOriginalMapping(resource, sourceLine);
}
catch (Exception e)
Expand Down Expand Up @@ -1250,8 +1249,7 @@ public void detailFormattersChanged()
private void handleDetailFormattersChange() throws DebugException
{
StringBuffer sb = new StringBuffer(DETAIL_FORMATTERS);
for (DetailFormatter detailFormatter : getDebugOptionsManager()
.getDetailFormatters())
for (DetailFormatter detailFormatter : getDebugOptionsManager().getDetailFormatters())
{
if (!detailFormatter.isEnabled())
{
Expand Down Expand Up @@ -1325,8 +1323,7 @@ private void init(boolean debugMode) throws CoreException
if (ILaunchManager.DEBUG_MODE.equals(mode))
{
/* restore breakpoints */
for (IBreakpoint breakpoint : getBreakpointManager()
.getBreakpoints(getModelIdentifier()))
for (IBreakpoint breakpoint : getBreakpointManager().getBreakpoints(getModelIdentifier()))
{
breakpointAdded(breakpoint);
}
Expand Down Expand Up @@ -1547,8 +1544,7 @@ private void shutdown() throws DebugException
*/
public void breakpointManagerEnablementChanged(boolean enabled)
{
for (IBreakpoint breakpoint : getBreakpointManager()
.getBreakpoints(getModelIdentifier()))
for (IBreakpoint breakpoint : getBreakpointManager().getBreakpoints(getModelIdentifier()))
{
if (enabled)
{
Expand Down Expand Up @@ -1867,8 +1863,8 @@ private void handleLineBreakpoint(IJSLineBreakpoint breakpoint, String operation
"Generated mapping while adding breakpoint for {0}:{1} is {2}:{3}", resource,
lineNumber, generatedMapping.getFile(), generatedMapping.getLineNumber()),
com.aptana.debug.core.IDebugScopes.DEBUG);
IResource mappedResource = getWorkspaceRoot()
.findMember(resource.getProject().getFullPath().append(generatedMapping.getFile()));
IResource mappedResource = getWorkspaceRoot().findMember(
resource.getProject().getFullPath().append(generatedMapping.getFile()));
if (mappedResource != null)
{
resource = mappedResource;
Expand Down Expand Up @@ -2089,8 +2085,7 @@ private void handleWatchpoint(IJSWatchpoint watchpoint, String operation)
*/
protected IBreakpoint findBreakpointAt(URI fileName, int lineNumber)
{
IBreakpoint[] breakpoints = getBreakpointManager()
.getBreakpoints(getModelIdentifier());
IBreakpoint[] breakpoints = getBreakpointManager().getBreakpoints(getModelIdentifier());
IBreakpoint breakpoint = findBreakpointIn(fileName, lineNumber, breakpoints);
if (breakpoint != null)
{
Expand Down Expand Up @@ -2180,39 +2175,42 @@ protected URI resolveSourceFile(String sourceFile)
try
{
URI uri = new URI(sourceFile);
String scheme = uri.getScheme();
if (FILE.equals(scheme))
if (!uri.isOpaque())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you go!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a guard might help to avoid NPE, however, they would still won't be able to debug the app. The underlying issue seems to be with getting the invalid path from the SDK debugger.

I realized that we log the debug protocol communication at <workspace>/.metadata/.plugins/com.appcelerator.titanium.ios.core/logs/iosdebugger.log and asked the customer for these logs.

{
File osFile = new File(uri.getSchemeSpecificPart());
resolved = EFSUtils.getLocalFileStore(osFile).toURI();
}
else if (HTTP.equals(scheme) && uriMapper != null)
{
IFileStore fileStore = uriMapper.resolve(uri);
if (fileStore != null)
String scheme = uri.getScheme();
if (FILE.equals(scheme))
{
resolved = fileStore.toURI();
File osFile = new File(uri.getSchemeSpecificPart());
resolved = EFSUtils.getLocalFileStore(osFile).toURI();
}
}
else if (APP.equals(scheme) && uriMapper != null)
{
IFileStore fileStore = uriMapper.resolve(uri);
if (fileStore != null)
else if (HTTP.equals(scheme) && uriMapper != null)
{
resolved = fileStore.toURI();
IFileStore fileStore = uriMapper.resolve(uri);
if (fileStore != null)
{
resolved = fileStore.toURI();
}
}
}
else if (JAVASCRIPT.equals(scheme))
{
if (mainFile != null)
else if (APP.equals(scheme) && uriMapper != null)
{
return mainFile;
IFileStore fileStore = uriMapper.resolve(uri);
if (fileStore != null)
{
resolved = fileStore.toURI();
}
}
else if (JAVASCRIPT.equals(scheme))
{
if (mainFile != null)
{
return mainFile;
}
}
if (resolved != null)
{
sourceResolveCache.put(sourceFile, resolved);
return resolved;
}
}
if (resolved != null)
{
sourceResolveCache.put(sourceFile, resolved);
return resolved;
}
}
catch (URISyntaxException e)
Expand Down