yast2-core
YCPDebugger.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | |
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
8 | |
9 | core system |
10 | (C) SuSE GmbH |
11 \----------------------------------------------------------------------/
12 
13  File: YCPDebugger.h
14 
15  Author: Arvin Schnell <arvin@suse.de>
16  Maintainer: Arvin Schnell <arvin@suse.de>
17 
18 /-*/
19 // -*- c++ -*-
20 
21 /*
22  * Debugger for YCP
23  */
24 
25 #ifndef YCPDebugger_h
26 #define YCPDebugger_h
27 
28 #include <string>
29 #include <vector>
30 
31 #include "ycp/y2log.h"
32 #include "ycp/YCPElement.h"
33 
35 {
36 public:
37 
43  YCPDebugger (bool);
44 
48  ~YCPDebugger ();
49 
54 
59  void debug (EntryPoint, const YCPElement &);
60 
61 private:
62 
66  string last_command;
67 
72 
73 private:
74 
78  struct Position
79  {
80  string file;
81  int line;
82 
83  void setpos (const string &, int);
84  };
85 
89  struct Breakpoint : public Position
90  {
92  };
93 
97  vector <Breakpoint> breakpoints;
98 
102  void add_breakpoint (const string &, int);
103 
108  bool delete_breakpoint (const string &, int);
109 
114  bool check_breakpoints (const string &, int);
115 
119  void list_breakpoints ();
120 
124  void list_source (const char *);
125 
129  void create_socket ();
130 
135  void check_socket (bool);
136 
140  int sock;
141 
146  int fd;
147 
152  string read_line (bool) const;
153 
157  void write_line (const char *, ...) const
158  __attribute__ ((format (printf, 2, 3)));
159 
163  void write_prompt () const;
164 
169  bool handle_command (const string &, const YCPElement &elem);
170 
175 
180 
185 
190 
195  struct Settings
196  {
197  Settings () { reset (); }
198  void reset ();
199 
200  bool ignorescr;
202  };
203 
208 
212  bool print_variable (const string &);
213 
217  void print_scope ();
218 
224  bool ignore (EntryPoint, const YCPElement &);
225 };
226 
227 #endif // YCPDebugger_h

Generated on a sunny day for yast2-core by doxygen 1.8.2