1 /*******************************************************************************
2 * Copyright (c) 2011, 2013 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
.linuxtools
.internal
.gdbtrace
.core
.event
;
16 import org
.eclipse
.linuxtools
.tmf
.core
.event
.ITmfEventField
;
17 import org
.eclipse
.linuxtools
.tmf
.core
.event
.TmfEventField
;
20 * GDB Trace implementation of TmfEventField
21 * @author Francois Chouinard
23 public class GdbTraceEventContent
extends TmfEventField
{
25 /** Trace Frame field name */
26 public static final String TRACE_FRAME
= "Trace Frame"; //$NON-NLS-1$
27 /** Tracepoint field name */
28 public static final String TRACEPOINT
= "Tracepoint"; //$NON-NLS-1$
31 private int fTracepointNumber
= 0;
33 private int fFrameNumber
= 0;
35 // ------------------------------------------------------------------------
37 // ------------------------------------------------------------------------
41 * @param content the raw content
42 * @param tracepointNumber the tracepoint number
43 * @param frameNumber the frame number
45 public GdbTraceEventContent(String content
, int tracepointNumber
, int frameNumber
) {
46 // TmfEvent parent, Object content
47 super(ITmfEventField
.ROOT_FIELD_ID
,
48 content
.replaceAll("\r?\n", " | "), //$NON-NLS-1$ //$NON-NLS-2$
49 new ITmfEventField
[] {
50 new TmfEventField(TRACE_FRAME
, frameNumber
, null),
51 new TmfEventField(TRACEPOINT
, tracepointNumber
, null)
54 fTracepointNumber
= tracepointNumber
;
55 fFrameNumber
= frameNumber
;
59 * @param other the original event content
61 public GdbTraceEventContent(GdbTraceEventContent other
) {
65 // ------------------------------------------------------------------------
67 // ------------------------------------------------------------------------
70 * @return the tracepointNumber
72 public int getTracepointNumber() {
73 return fTracepointNumber
;
77 * @return the frameNumber
79 public int getFrameNumber() {
83 // ------------------------------------------------------------------------
85 // ------------------------------------------------------------------------
88 public String
toString() {
89 return getValue().toString();