~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to ddd/BreakPoint.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-07-22 03:49:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040722034937-cysl08t1jvba4jrx
Tags: 1:3.3.9-3
USERINFO has been renamed to USERINFO.txt; adjust debian/rules code
to match, to get correct information on the About DDD dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// $Id: BreakPoint.h,v 1.37 2000/01/03 12:12:09 andreas Exp $
 
1
// $Id$
2
2
// Breakpoint handler
3
3
 
4
4
// Copyright (C) 1995 Technische Universitaet Braunschweig, Germany.
29
29
#ifndef _DDD_BreakPoint_h
30
30
#define _DDD_BreakPoint_h
31
31
 
32
 
#ifdef __GNUG__
33
 
#pragma interface
34
 
#endif
35
 
 
36
32
//-----------------------------------------------------------------------------
37
33
// A `BreakPoint' stores information about an existing debugger breakpoint.
38
34
//-----------------------------------------------------------------------------
45
41
#include "GDBAgent.h"
46
42
#include "StringA.h"
47
43
 
48
 
// Breakpoint type
 
44
// Breakpoint type, respectively:
 
45
//  Breakpoint
 
46
//  Watchpoint
 
47
//  Tracepoint (as in GDB)
 
48
//  Actionpoint (`when' in DBX, action in Perl)
 
49
#define BREAKPOINT_TABLE     \
 
50
X(BREAKPOINT,"Breakpoint"),  \
 
51
X(WATCHPOINT,"Watchpoint"),  \
 
52
X(TRACEPOINT,"Tracepoint"),  \
 
53
X(ACTIONPOINT,"Actionpoint")
 
54
 
 
55
#define BREAKPOINT_TABLE_NOC \
 
56
X(BREAKPOINT,"Breakpoint")   \
 
57
X(WATCHPOINT,"Watchpoint")   \
 
58
X(TRACEPOINT,"Tracepoint")   \
 
59
X(ACTIONPOINT,"Actionpoint")
 
60
 
49
61
enum BPType {
50
 
    BREAKPOINT,                 // Breakpoint
51
 
    WATCHPOINT,                 // Watchpoint
52
 
    TRACEPOINT,                 // Tracepoint (as in GDB)
53
 
    ACTIONPOINT                 // Actionpoint (`when' in DBX, action in Perl)
 
62
#define X(a,b) a
 
63
    BREAKPOINT_TABLE
 
64
#undef X
54
65
};
55
66
 
56
67
// What to do when breakpoint is reached
87
98
    Widget  mycode_glyph;       // Associated glyph in code
88
99
 
89
100
private:
90
 
    BreakPoint(const BreakPoint& b)
91
 
        : mynumber(b.mynumber),
92
 
          mytype(b.mytype),
93
 
          mydispo(b.mydispo),
94
 
          myenabled(b.myenabled),
95
 
          myfile_name(b.myfile_name),
96
 
          myline_nr(b.myline_nr),
97
 
          myaddress(b.myaddress),
98
 
          myfunc(b.myfunc),
99
 
          myexpr(b.myexpr),
100
 
          myinfos(b.myinfos),
101
 
          myignore_count(b.myignore_count),
102
 
          mycondition(b.mycondition),
103
 
          mycommands(b.mycommands),
104
 
          myarg(b.myarg),
105
 
          mywatch_mode(b.mywatch_mode),
106
 
          myenabled_changed(b.myenabled_changed),
107
 
          myfile_changed(b.myfile_changed),
108
 
          myposition_changed(b.myposition_changed),
109
 
          myaddress_changed(b.myaddress_changed),
110
 
          myselected(b.myselected),
111
 
          mysource_glyph(b.mysource_glyph),
112
 
          mycode_glyph(b.mycode_glyph)
113
 
    {
114
 
        assert(0);
115
 
    }
116
 
    BreakPoint& operator = (const BreakPoint&)
117
 
    {
118
 
        assert(0); return *this;
119
 
    }
 
101
    BreakPoint(const BreakPoint&);
 
102
    BreakPoint& operator = (const BreakPoint&);
120
103
 
121
104
protected:
122
105
    // Helpers
123
 
    static string false_value();
124
 
    static string and_op();
 
106
    static const string& false_value();
 
107
    static const string& and_op();
125
108
    static bool is_false(const string& cond);
126
109
 
 
110
    void process_bash(string& info_output);
 
111
    void process_dbx(string& info_output);
 
112
    void process_dbg(string& info_output);
127
113
    void process_gdb(string& info_output);
128
 
    void process_dbx(string& info_output);
129
 
    void process_xdb(string& info_output);
130
114
    void process_jdb(string& info_output);
 
115
    void process_perl(string& info_output);
131
116
    void process_pydb(string& info_output);
132
 
    void process_perl(string& info_output);
 
117
    void process_xdb(string& info_output);
133
118
 
134
119
public:
135
120
    // Create new breakpoint from INFO_OUTPUT.  ARG denotes the
151
136
 
152
137
    // Breakpoint type.
153
138
    BPType type() const { return mytype; }
154
 
    string title() const;
 
139
    const string& title() const;
155
140
 
156
141
    // What to do when breakpoint is reached.
157
142
    BPDispo dispo() const { return mydispo; }
204
189
    // UNDO_COMMANDS contains commands to undo the change.
205
190
    // NEED_TOTAL_UNDO is set iff the change requires deleting and
206
191
    // setting a new breakpoint.
207
 
    bool update(string& info_output, ostream& undo_commands, 
 
192
    bool update(string& info_output, std::ostream& undo_commands, 
208
193
                bool& need_total_undo);
209
194
 
210
195
    // Return commands to restore this breakpoint, using the dummy
212
197
    // immediately in order to increase the breakpoint number.  If
213
198
    // ADDR is set, use ADDR as (fake) address.  If COND is set, use
214
199
    // COND as (fake) condition.  Return true iff successful.
215
 
    bool get_state(ostream& os, int nr, bool as_dummy = false, 
 
200
    bool get_state(std::ostream& os, int nr, bool as_dummy = false, 
216
201
                   string addr = "", string cond = char(-1));
217
202
 
218
203
    // Stuff for constructing `false' breakpoint conditions