diff options
author | Andrew Ferrazzutti | 2014-03-05 18:35:40 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2014-04-05 05:57:44 +0000 |
commit | 95fe2d52b52a516ec7bf422cba92a2ab5bc03df8 (patch) | |
tree | eeda5dcc2f2eec68a7fdd61b2076d051f99ff28f /systemtap/org.eclipse.linuxtools.systemtap.structures | |
parent | d42f1aa8fc3ef77ee436f65da8b38c1023f234ac (diff) | |
download | org.eclipse.linuxtools-95fe2d52b52a516ec7bf422cba92a2ab5bc03df8.tar.gz org.eclipse.linuxtools-95fe2d52b52a516ec7bf422cba92a2ab5bc03df8.tar.xz org.eclipse.linuxtools-95fe2d52b52a516ec7bf422cba92a2ab5bc03df8.zip |
Systemtap: Make some fixes to Probe & Function views.
-The icons next to Function view entries now correctly
represent the return type of functions and the variable
type of their parameters.
-Fix a bug that prevented some tapset functions, as well
as probe aliases, from being available in their appropriate
views (EBZ #429800).
-Remove an error from the stap-calling command in TapsetParser
that caused a crash when booting Eclipse with imported tapsets
(EBZ #429597). Also allow the parser to capture a script's error
output, in case the output of a verbose run is ever needed.
-Modify OpenFileAction to allow the Probe & Function views
to open a file without user interaction, and without forcing
the file's editor to use a PathEditorInput (which may open a
duplicate editor).
Change-Id: I0820534a2bc6c1d79ed75570d29d4992b05d920d
Signed-off-by: Andrew Ferrazzutti <aferrazz@redhat.com>
Reviewed-on: https://git.eclipse.org/r/23075
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
IP-Clean: Alexander Kurtakov <akurtako@redhat.com>
Tested-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.structures')
3 files changed, 67 insertions, 2 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.structures/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.structures/META-INF/MANIFEST.MF index f23108fc79..e0ef9bfd34 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.structures/META-INF/MANIFEST.MF +++ b/systemtap/org.eclipse.linuxtools.systemtap.structures/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %bundleName Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.structures;singleton:=true -Bundle-Version: 2.2.0.qualifier +Bundle-Version: 3.0.0.qualifier Bundle-Vendor: %bundleProvider Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.linuxtools.systemtap.structures, diff --git a/systemtap/org.eclipse.linuxtools.systemtap.structures/pom.xml b/systemtap/org.eclipse.linuxtools.systemtap.structures/pom.xml index 6e0a0445e2..bb36da7d1e 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.structures/pom.xml +++ b/systemtap/org.eclipse.linuxtools.systemtap.structures/pom.xml @@ -18,7 +18,7 @@ </parent> <artifactId>org.eclipse.linuxtools.systemtap.structures</artifactId> - <version>2.2.0-SNAPSHOT</version> + <version>3.0.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> <name>Linux Tools Structures Plug-in</name> diff --git a/systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/FunctionNodeData.java b/systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/FunctionNodeData.java new file mode 100644 index 0000000000..bbcac77a5e --- /dev/null +++ b/systemtap/org.eclipse.linuxtools.systemtap.structures/src/org/eclipse/linuxtools/systemtap/structures/FunctionNodeData.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * Copyright (c) 2014 Red Hat. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Red Hat - Andrew Ferrazzutti + *******************************************************************************/ +package org.eclipse.linuxtools.systemtap.structures; + + +/** + * A structure for containing extra information of SystemTap functions (and their parameters). + * @since 3.0 + */ +public class FunctionNodeData { + /** + * The descriptor used for unresolvable types. + */ + public static final String UNKNOWN_TYPE = "unknown"; //$NON-NLS-1$ + + private String line; + private String type; + + /** + * @return <code>true</code> if this node is a parameter, + * or <code>false</code> if it is a function. + */ + public boolean isParam() { + return line == null; + } + + /** + * Get the original script text that defines a function. + * @return The entire text contents of the original function definition, + * if this node is a function; <code>null</code> otherwise. + */ + @Override + public String toString() { + return line; + } + + /** + * @return The <code>String</code> representation of the return type of the + * node's function (<code>null</code> for void functions), or the type of its parameter. + */ + public String getType() { + return type; + } + + /** + * Create a new instance of function node information. (Note that the name of a function + * or parameter is stored in a {@link TreeNode}, not here.) + * @param line For a function, set this to the original script text that defines this function. + * For a parameter, set this to <code>null</code>. + * @param type The <code>String</code> representation of the return type of the + * node's function, or the type of its parameter. + */ + public FunctionNodeData(String line, String type) { + this.line = line; + this.type = line == null && type == null ? UNKNOWN_TYPE : type; // Parameters can't be void. + } +} |