yast2-core
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
debugger
Debugger.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: Debugger.h
14
15
Author: Stanislav Visnovsky <visnov@suse.cz>
16
Maintainer: Stanislav Visnovsky <visnov@suse.cz>
17
18
/-*/
19
// -*- c++ -*-
20
21
#ifndef Debugger_h
22
#define Debugger_h
23
24
#include <stdio.h>
25
#include <list>
26
#include <string>
27
#include <
y2/SymbolEntry.h
>
28
29
class
Y2Namespace
;
30
34
class
Debugger
35
{
36
public
:
37
typedef
enum
{
38
c_unknown
,
39
c_next
,
40
c_step
,
41
c_continue
,
42
c_print
,
43
c_backtrace
,
44
c_breakpoint
,
45
c_removebreakpoint
,
46
c_setvalue
47
}
command_t
;
48
49
private
:
50
int
m_socket
,
m_ns
;
51
FILE *
m_descriptor
;
52
command_t
m_last_command
;
53
std::string
m_outputstash
;
54
55
bool
m_tracing
;
56
57
typedef
struct
{
58
Y2Namespace
*
ns
;
59
bool
tracing
;
60
}
stackitem_t
;
61
62
std::list<stackitem_t>
m_blockstack
;
63
64
bool
m_remote
;
65
66
public
:
67
68
Debugger
();
69
70
~Debugger
();
71
75
bool
initialize
(
bool
remote);
76
bool
initializeRemote
();
77
bool
initializeLocal
();
78
85
bool
processInput
(
command_t
&command, std::list<std::string> &arguments);
86
87
bool
sendOutput
(std::string
output
);
88
89
// save the text for the next output sending
90
void
stashOutput
(std::string
output
);
91
92
command_t
lastCommand
()
const
{
return
m_last_command
; }
93
94
// sets the last command to be c_step, enables tracing of the next block to be
95
// entered
96
void
setTracing
();
97
void
setTracing
(
bool
enable);
98
99
void
setBreakpoint
(std::list<std::string> &arguments);
100
void
removeBreakpoint
(std::list<std::string> &arguments);
101
void
generateBacktrace
();
102
void
printVariable
(std::string variable_name);
103
void
setVariable
(std::string arg);
104
105
void
enableTracing
(
Y2Namespace
* block,
bool
enable);
106
bool
tracing
(
Y2Namespace
* block)
const
;
107
bool
tracing
()
const
;
108
109
void
pushBlock
(
Y2Namespace
* block,
bool
tracing
);
110
void
popBlock
();
111
112
private
:
113
SymbolEntryPtr
findSymbol
(std::string name);
114
};
115
116
#endif // Debugger_h
Generated on a sunny day for yast2-core by
1.8.2