~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to results/plugins/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/command/MIBreakWatch.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*******************************************************************************
2
 
 * Copyright (c) 2000, 2006 QNX Software Systems and others.
3
 
 * All rights reserved. This program and the accompanying materials
4
 
 * are made available under the terms of the Eclipse Public License v1.0
5
 
 * which accompanies this distribution, and is available at
6
 
 * http://www.eclipse.org/legal/epl-v10.html
7
 
 *
8
 
 * Contributors:
9
 
 *     QNX Software Systems - Initial API and implementation
10
 
 *******************************************************************************/
11
 
 
12
 
package org.eclipse.cdt.debug.mi.core.command;
13
 
 
14
 
import org.eclipse.cdt.debug.mi.core.MIException;
15
 
import org.eclipse.cdt.debug.mi.core.output.MIBreakWatchInfo;
16
 
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
17
 
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
18
 
 
19
 
/**
20
 
 * 
21
 
 *    -break-watch [ -a | -r ]
22
 
 *
23
 
 * Create a watchpoint.  With the `-a' option it will create an
24
 
 * "access" watchpoint, i.e. a watchpoint that triggers either on a read
25
 
 * from or on a write to the memory location.  With the `-r' option, the
26
 
 * watchpoint created is a "read" watchpoint, i.e. it will trigger only
27
 
 * when the memory location is accessed for reading.  Without either of
28
 
 * the options, the watchpoint created is a regular watchpoint, i.e. it
29
 
 * will trigger when the memory location is accessed for writing. 
30
 
 * 
31
 
 */
32
 
public class MIBreakWatch extends MICommand
33
 
{
34
 
        public MIBreakWatch (String miVersion, boolean access, boolean read, String expr) {
35
 
                super(miVersion, "-break-watch");//$NON-NLS-1$
36
 
                String[] opts = null;
37
 
                if (access) {
38
 
                        opts = new String[] {"-a"}; //$NON-NLS-1$
39
 
                } else if (read) {
40
 
                        opts = new String[] {"-r"}; //$NON-NLS-1$
41
 
                }
42
 
                if (opts != null) {
43
 
                        setOptions(opts);
44
 
                }                       
45
 
                setParameters(new String[]{expr});
46
 
        }
47
 
 
48
 
        public MIBreakWatchInfo getMIBreakWatchInfo() throws MIException {
49
 
                return (MIBreakWatchInfo)getMIInfo();
50
 
        }
51
 
 
52
 
        public MIInfo getMIInfo() throws MIException {
53
 
                MIInfo info = null;
54
 
                MIOutput out = getMIOutput();
55
 
                if (out != null) {
56
 
                        info = new MIBreakWatchInfo(out);
57
 
                        if (info.isError()) {
58
 
                                throwMIException(info, out);
59
 
                        }
60
 
                }
61
 
                return info;
62
 
        }
63
 
}