1 /*******************************************************************************
2 * Copyright (c) 2011, 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Francois Chouinard - Initial API and implementation
11 * Patrick Tasse - Updated for TMF 2.0
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.internal
.gdbtrace
.core
.event
;
16 import org
.eclipse
.jdt
.annotation
.NonNull
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEventField
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.event
.TmfEventField
;
21 * GDB Trace implementation of TmfEventField
22 * @author Francois Chouinard
24 public class GdbTraceEventContent
extends TmfEventField
{
26 /** Trace Frame field name */
27 public static final @NonNull String TRACE_FRAME
= "Trace Frame"; //$NON-NLS-1$
28 /** Tracepoint field name */
29 public static final @NonNull String TRACEPOINT
= "Tracepoint"; //$NON-NLS-1$
32 private int fTracepointNumber
= 0;
34 private int fFrameNumber
= 0;
36 // ------------------------------------------------------------------------
38 // ------------------------------------------------------------------------
42 * @param content the raw content
43 * @param tracepointNumber the tracepoint number
44 * @param frameNumber the frame number
46 public GdbTraceEventContent(String content
, int tracepointNumber
, int frameNumber
) {
47 // TmfEvent parent, Object content
48 super(ITmfEventField
.ROOT_FIELD_ID
,
49 content
.replaceAll("\r?\n", " | "), //$NON-NLS-1$ //$NON-NLS-2$
50 new ITmfEventField
[] {
51 new TmfEventField(TRACE_FRAME
, frameNumber
, null),
52 new TmfEventField(TRACEPOINT
, tracepointNumber
, null)
55 fTracepointNumber
= tracepointNumber
;
56 fFrameNumber
= frameNumber
;
60 * @param other the original event content
62 public GdbTraceEventContent(GdbTraceEventContent other
) {
66 // ------------------------------------------------------------------------
68 // ------------------------------------------------------------------------
71 * @return the tracepointNumber
73 public int getTracepointNumber() {
74 return fTracepointNumber
;
78 * @return the frameNumber
80 public int getFrameNumber() {
84 // ------------------------------------------------------------------------
86 // ------------------------------------------------------------------------
89 public String
toString() {
90 return getValue().toString();