Package: Tracepoint

Tracepoint

nameinstructionbranchcomplexitylinemethod
Tracepoint(ILexLocation, int, String)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
check(ILexLocation, Context)
M: 70 C: 0
0%
M: 6 C: 0
0%
M: 4 C: 0
0%
M: 14 C: 0
0%
M: 1 C: 0
0%
toString()
M: 32 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: *
3: *        Copyright (C) 2008 Fujitsu Services Ltd.
4: *
5: *        Author: Nick Battle
6: *
7: *        This file is part of VDMJ.
8: *
9: *        VDMJ is free software: you can redistribute it and/or modify
10: *        it under the terms of the GNU General Public License as published by
11: *        the Free Software Foundation, either version 3 of the License, or
12: *        (at your option) any later version.
13: *
14: *        VDMJ is distributed in the hope that it will be useful,
15: *        but WITHOUT ANY WARRANTY; without even the implied warranty of
16: *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17: *        GNU General Public License for more details.
18: *
19: *        You should have received a copy of the GNU General Public License
20: *        along with VDMJ. If not, see <http://www.gnu.org/licenses/>.
21: *
22: ******************************************************************************/
23:
24: package org.overture.interpreter.runtime;
25:
26: import org.overture.ast.intf.lex.ILexLocation;
27: import org.overture.config.Settings;
28: import org.overture.interpreter.debug.BreakpointManager;
29: import org.overture.parser.lex.LexException;
30: import org.overture.parser.syntax.ParserException;
31:
32: /**
33: * A breakpoint where something is displayed.
34: */
35:
36: public class Tracepoint extends Breakpoint
37: {
38:         private static final long serialVersionUID = 1L;
39:
40:         public Tracepoint(ILexLocation location, int number, String trace)
41:                         throws ParserException, LexException
42:         {
43:                 super(location, number, trace);
44:         }
45:
46:         @Override
47:         public void check(ILexLocation execl, Context ctxt)
48:         {
49:                 location.hit();
50:                 hits++;
51:
52:•                if (parsed == null)
53:                 {
54:                         String s = "Reached [" + number + "]";
55:
56:•                        if (Settings.usingDBGP)
57:                         {
58:                                 ctxt.threadState.dbgp.tracing(s);
59:                         } else
60:                         {
61:                                 println(s);
62:                         }
63:                 } else
64:                 {
65:                         String s = trace + " = "
66:                                         + BreakpointManager.evalBreakpointCondition(parsed, ctxt)
67:                                         + " at [" + number + "]";// FIXME: use visitor here
68:
69:•                        if (Settings.usingDBGP)
70:                         {
71:                                 ctxt.threadState.dbgp.tracing(s);
72:                         } else
73:                         {
74:                                 println(s);
75:                         }
76:                 }
77:         }
78:
79:         @Override
80:         public String toString()
81:         {
82:•                return "trace [" + number + "] "
83:                                 + (trace == null ? "" : "show \"" + trace + "\" ")
84:                                 + super.toString();
85:         }
86: }