yast2-core
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
libycp
src
include
ycp
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
34
class
YCPDebugger
35
{
36
public
:
37
43
YCPDebugger
(
bool
);
44
48
~YCPDebugger
();
49
53
enum
EntryPoint
{
Interpreter
,
Block
};
54
59
void
debug
(
EntryPoint
,
const
YCPElement
&);
60
61
private
:
62
66
string
last_command
;
67
71
bool
wait_for_frontend
;
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
{
91
bool
tmpinactive
;
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
174
bool
single_mode
;
175
179
int
hold_level
;
180
184
Position
leave_position
;
185
189
bool
close_request
;
190
195
struct
Settings
196
{
197
Settings
() { reset (); }
198
void
reset ();
199
200
bool
ignorescr
;
201
bool
printtoken
;
202
};
203
207
Settings
settings
;
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
1.8.2