| 1 | /* capture.h -*- C++ -*-
|
|---|
| 2 | Copyright (c) 1996 Eberhard Mattes
|
|---|
| 3 |
|
|---|
| 4 | This file is part of pmgdb.
|
|---|
| 5 |
|
|---|
| 6 | pmgdb is free software; you can redistribute it and/or modify
|
|---|
| 7 | it under the terms of the GNU General Public License as published by
|
|---|
| 8 | the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 9 | any later version.
|
|---|
| 10 |
|
|---|
| 11 | pmgdb is distributed in the hope that it will be useful,
|
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | GNU General Public License for more details.
|
|---|
| 15 |
|
|---|
| 16 | You should have received a copy of the GNU General Public License
|
|---|
| 17 | along with pmgdb; see the file COPYING. If not, write to
|
|---|
| 18 | the Free Software Foundation, 59 Temple Place - Suite 330,
|
|---|
| 19 | Boston, MA 02111-1307, USA. */
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 | class capture_string
|
|---|
| 23 | {
|
|---|
| 24 | public:
|
|---|
| 25 | capture_string () { str = NULL; }
|
|---|
| 26 | ~capture_string () { delete[] str; }
|
|---|
| 27 | void set (const char *s, size_t len);
|
|---|
| 28 | void set (const char *s) { set (s, strlen (s)); }
|
|---|
| 29 | bool is_set () const { return str != NULL; }
|
|---|
| 30 | const char *get () const { return str; }
|
|---|
| 31 | private:
|
|---|
| 32 | char *str;
|
|---|
| 33 | };
|
|---|
| 34 |
|
|---|
| 35 | class capture_number
|
|---|
| 36 | {
|
|---|
| 37 | public:
|
|---|
| 38 | capture_number () { flag = false; }
|
|---|
| 39 | ~capture_number () {}
|
|---|
| 40 | void set (long v) { value = v; flag = true; }
|
|---|
| 41 | bool is_set () const { return flag; }
|
|---|
| 42 | long get () const { return value; }
|
|---|
| 43 | private:
|
|---|
| 44 | long value;
|
|---|
| 45 | bool flag;
|
|---|
| 46 | };
|
|---|
| 47 |
|
|---|
| 48 | class capture_bool
|
|---|
| 49 | {
|
|---|
| 50 | public:
|
|---|
| 51 | capture_bool () { flag = false; }
|
|---|
| 52 | ~capture_bool () {}
|
|---|
| 53 | void set (bool v) { value = v; flag = true; }
|
|---|
| 54 | bool is_set () const { return flag; }
|
|---|
| 55 | bool get () const { return value; }
|
|---|
| 56 | private:
|
|---|
| 57 | // TODO: Use three-value enum?
|
|---|
| 58 | bool value;
|
|---|
| 59 | bool flag;
|
|---|
| 60 | };
|
|---|
| 61 |
|
|---|
| 62 | class capture
|
|---|
| 63 | {
|
|---|
| 64 | public:
|
|---|
| 65 | capture () { next = NULL; }
|
|---|
| 66 | ~capture () {}
|
|---|
| 67 |
|
|---|
| 68 | class capture *next; // TODO: make private, add iterator
|
|---|
| 69 | capture_string source_file;
|
|---|
| 70 | capture_number source_lineno;
|
|---|
| 71 | capture_number source_addr;
|
|---|
| 72 | capture_number bpt_number;
|
|---|
| 73 | capture_string bpt_disposition;
|
|---|
| 74 | capture_bool bpt_enable;
|
|---|
| 75 | capture_number bpt_address;
|
|---|
| 76 | capture_string bpt_what;
|
|---|
| 77 | capture_string bpt_condition;
|
|---|
| 78 | capture_number bpt_ignore;
|
|---|
| 79 | capture_number disp_number;
|
|---|
| 80 | capture_string disp_format;
|
|---|
| 81 | capture_string disp_expr;
|
|---|
| 82 | capture_string disp_value;
|
|---|
| 83 | capture_bool disp_enable;
|
|---|
| 84 | capture_string srcs_file;
|
|---|
| 85 | capture_string source_location;
|
|---|
| 86 | capture_string show_value;
|
|---|
| 87 | capture_string error;
|
|---|
| 88 |
|
|---|
| 89 | friend void delete_capture (capture *capt);
|
|---|
| 90 | };
|
|---|