Commit | Line | Data |
---|---|---|
d90ae2a5 RK |
1 | /******************************************************************************* |
2 | * Copyright (c) 2016 Movidius Inc. and others | |
3 | * | |
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 | |
8 | * | |
9 | *******************************************************************************/ | |
10 | ||
11 | package org.eclipse.tracecompass.tmf.ui.symbols; | |
12 | ||
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; | |
d90ae2a5 RK |
17 | import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; |
18 | ||
19 | /** | |
20 | * A default implementation of the {@link ISymbolProvider} which return a hex | |
21 | * format representation of the symbol address | |
22 | * | |
23 | * @author Robert Kiss | |
24 | * @since 2.0 | |
37c87032 | 25 | * @deprecated use {@link org.eclipse.tracecompass.tmf.core.symbols.DefaultSymbolProvider} |
d90ae2a5 | 26 | */ |
37c87032 | 27 | @Deprecated |
d90ae2a5 RK |
28 | @NonNullByDefault |
29 | public class DefaultSymbolProvider implements ISymbolProvider { | |
30 | ||
31 | private final ITmfTrace fTrace; | |
32 | ||
33 | /** | |
34 | * Create a new provider for the given trace | |
35 | * | |
36 | * @param trace | |
37 | * the trace | |
38 | */ | |
39 | public DefaultSymbolProvider(ITmfTrace trace) { | |
40 | fTrace = trace; | |
41 | } | |
42 | ||
43 | @Override | |
44 | public void loadConfiguration(@Nullable IProgressMonitor monitor) { | |
45 | // no configuration here | |
46 | } | |
47 | ||
48 | @Override | |
49 | public ITmfTrace getTrace() { | |
50 | return fTrace; | |
51 | } | |
52 | ||
53 | /** | |
54 | * Return a hex formated representation of the given address | |
55 | * | |
56 | * @param address | |
57 | * the symbol address | |
58 | * @return the hex representation of the given address | |
59 | */ | |
60 | @Override | |
61 | public @NonNull String getSymbolText(long address) { | |
62 | if ((address & (0xFFFFFFFF << 32)) == 0) { | |
63 | return String.format("%08x", address); //$NON-NLS-1$ | |
64 | } | |
65 | return String.format("%016x", address); //$NON-NLS-1$ | |
66 | } | |
67 | ||
d90ae2a5 RK |
68 | /** |
69 | * @return null because the default symbol provider doesn't support | |
70 | * configuration | |
71 | */ | |
72 | @Override | |
73 | public @Nullable ISymbolProviderPreferencePage createPreferencePage() { | |
74 | return null; | |
75 | } | |
76 | } |