mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 23:35:48 +02:00
Always fetch the paths in the .cdtproject.
This commit is contained in:
parent
956250cf95
commit
19cd0ff470
4 changed files with 43 additions and 19 deletions
|
@ -26,27 +26,26 @@ import org.eclipse.core.runtime.PlatformObject;
|
||||||
public abstract class BinaryFile extends PlatformObject implements IBinaryFile {
|
public abstract class BinaryFile extends PlatformObject implements IBinaryFile {
|
||||||
|
|
||||||
protected IPath path;
|
protected IPath path;
|
||||||
protected IPath addr2linePath;
|
protected IToolsProvider toolsProvider;
|
||||||
protected IPath cppfiltPath;
|
|
||||||
|
|
||||||
public BinaryFile(IPath p) {
|
public BinaryFile(IPath p) {
|
||||||
path = p;
|
path = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAddr2LinePath(IPath p) {
|
public void setToolsProvider(IToolsProvider p) {
|
||||||
addr2linePath = p;
|
toolsProvider = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPath getAddr2LinePath() {
|
public IPath getAddr2LinePath() {
|
||||||
return addr2linePath;
|
if (toolsProvider != null)
|
||||||
}
|
return toolsProvider.getAddr2LinePath();
|
||||||
|
return null;
|
||||||
public void setCPPFiltPath(IPath p) {
|
|
||||||
cppfiltPath = p;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IPath getCPPFiltPath() {
|
public IPath getCPPFiltPath() {
|
||||||
return cppfiltPath;
|
if (toolsProvider != null)
|
||||||
|
return toolsProvider.getCPPFiltPath();
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -296,9 +296,11 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
|
||||||
protected Addr2line getAddr2Line() {
|
protected Addr2line getAddr2Line() {
|
||||||
IPath addr2LinePath = getAddr2LinePath();
|
IPath addr2LinePath = getAddr2LinePath();
|
||||||
Addr2line addr2line = null;
|
Addr2line addr2line = null;
|
||||||
try {
|
if (addr2LinePath != null && !addr2LinePath.isEmpty()) {
|
||||||
addr2line = new Addr2line(addr2LinePath.toOSString(), getPath().toOSString());
|
try {
|
||||||
} catch (IOException e1) {
|
addr2line = new Addr2line(addr2LinePath.toOSString(), getPath().toOSString());
|
||||||
|
} catch (IOException e1) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return addr2line;
|
return addr2line;
|
||||||
}
|
}
|
||||||
|
@ -306,9 +308,11 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
|
||||||
protected CPPFilt getCPPFilt() {
|
protected CPPFilt getCPPFilt() {
|
||||||
IPath cppFiltPath = getCPPFiltPath();
|
IPath cppFiltPath = getCPPFiltPath();
|
||||||
CPPFilt cppfilt = null;
|
CPPFilt cppfilt = null;
|
||||||
try {
|
if (cppFiltPath != null && ! cppFiltPath.isEmpty()) {
|
||||||
cppfilt = new CPPFilt(cppFiltPath.toOSString());
|
try {
|
||||||
} catch (IOException e2) {
|
cppfilt = new CPPFilt(cppFiltPath.toOSString());
|
||||||
|
} catch (IOException e2) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return cppfilt;
|
return cppfilt;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public class GNUElfParser extends ElfParser implements IBinaryParser {
|
public class GNUElfParser extends ElfParser implements IBinaryParser, IToolsProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.core.model.IBinaryParser#getBinary(IPath)
|
* @see org.eclipse.cdt.core.model.IBinaryParser#getBinary(IPath)
|
||||||
|
@ -27,8 +27,7 @@ public class GNUElfParser extends ElfParser implements IBinaryParser {
|
||||||
public IBinaryFile getBinary(IPath path) throws IOException {
|
public IBinaryFile getBinary(IPath path) throws IOException {
|
||||||
IBinaryFile binary = super.getBinary(path);
|
IBinaryFile binary = super.getBinary(path);
|
||||||
if (binary instanceof BinaryFile) {
|
if (binary instanceof BinaryFile) {
|
||||||
((BinaryFile)binary).setAddr2LinePath(getAddr2LinePath());
|
((BinaryFile)binary).setToolsProvider(this);
|
||||||
((BinaryFile)binary).setCPPFiltPath(getCPPFiltPath());
|
|
||||||
}
|
}
|
||||||
return binary;
|
return binary;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2002,2003 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.utils.elf.parser;
|
||||||
|
|
||||||
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public interface IToolsProvider {
|
||||||
|
|
||||||
|
IPath getAddr2LinePath();
|
||||||
|
|
||||||
|
IPath getCPPFiltPath();
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue