1 /*******************************************************************************
2 * Copyright (c) 2016 Movidius Inc. and others
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
9 *******************************************************************************/
11 package org
.eclipse
.tracecompass
.tmf
.ui
.symbols
;
13 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
14 import org
.eclipse
.jdt
.annotation
.NonNull
;
15 import org
.eclipse
.jdt
.annotation
.NonNullByDefault
;
16 import org
.eclipse
.jdt
.annotation
.Nullable
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.event
.lookup
.ITmfCallsite
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfTrace
;
21 * A default implementation of the {@link ISymbolProvider} which return a hex
22 * format representation of the symbol address
29 public class DefaultSymbolProvider
implements ISymbolProvider
{
31 private final ITmfTrace fTrace
;
34 * Create a new provider for the given trace
39 public DefaultSymbolProvider(ITmfTrace trace
) {
44 public void loadConfiguration(@Nullable IProgressMonitor monitor
) {
45 // no configuration here
49 public ITmfTrace
getTrace() {
54 * Return a hex formated representation of the given address
58 * @return the hex representation of the given address
61 public @NonNull String
getSymbolText(long address
) {
62 if ((address
& (0xFFFFFFFF << 32)) == 0) {
63 return String
.format("%08x", address
); //$NON-NLS-1$
65 return String
.format("%016x", address
); //$NON-NLS-1$
69 * The default symbol provider will return null for this method
77 public @Nullable ITmfCallsite
getSymbolInfo(long address
) {
82 * @return null because the default symbol provider doesn't support
86 public @Nullable ISymbolProviderPreferencePage
createPreferencePage() {