ReactOS
0.4.15-dev-5606-gf34e425
|
#include <ntoskrnl.h>
#include <debug.h>
Go to the source code of this file.
Classes | |
struct | _RPN_OP |
struct | _RPN_STACK |
Macros | |
#define | NDEBUG |
#define | stricmp _stricmp |
#define | RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field)) |
#define | CONST_STRCPY(dst, src) do { if ((dst)) { memcpy(dst, src, sizeof(src)); } } while (0); |
#define | RPN_OP_STACK_SIZE 256 |
#define | RPN_VALUE_STACK_SIZE 256 |
Typedefs | |
typedef enum _RPN_OP_TYPE | RPN_OP_TYPE |
typedef ULONGLONG(* | RPN_BINARY_OPERATOR) (ULONGLONG a, ULONGLONG b) |
typedef struct _RPN_OP | RPN_OP |
typedef struct _RPN_OP * | PRPN_OP |
typedef struct _RPN_STACK | RPN_STACK |
typedef struct _RPN_STACK * | PRPN_STACK |
Enumerations | |
enum | _RPN_OP_TYPE { RpnOpNop, RpnOpBinaryOperator, RpnOpUnaryOperator, RpnOpImmediate, RpnOpRegister, RpnOpDereference } |
Variables | |
struct { | |
ULONG Size | |
ULONG Sp | |
RPN_OP Ops [RPN_OP_STACK_SIZE] | |
} | RpnStack |
struct { | |
PCHAR Name | |
UCHAR Offset | |
UCHAR Size | |
} | RegisterToTrapFrame [] |
static const INT | RegisterToTrapFrameCount = sizeof (RegisterToTrapFrame) / sizeof (RegisterToTrapFrame[0]) |
Definition at line 87 of file kdb_expr.c.
#define NDEBUG |
Definition at line 37 of file kdb_expr.c.
#define RPN_OP_STACK_SIZE 256 |
Definition at line 90 of file kdb_expr.c.
#define RPN_VALUE_STACK_SIZE 256 |
Definition at line 91 of file kdb_expr.c.
Definition at line 84 of file kdb_expr.c.
Definition at line 81 of file kdb_expr.c.
typedef struct _RPN_STACK * PRPN_STACK |
Definition at line 51 of file kdb_expr.c.
typedef enum _RPN_OP_TYPE RPN_OP_TYPE |
typedef struct _RPN_STACK RPN_STACK |
Enumerator | |
---|---|
RpnOpNop | |
RpnOpBinaryOperator | |
RpnOpUnaryOperator | |
RpnOpImmediate | |
RpnOpRegister | |
RpnOpDereference |
Definition at line 41 of file kdb_expr.c.
BOOLEAN KdbpRpnEvaluateExpression | ( | IN PCHAR | Expression, |
IN PKDB_KTRAP_FRAME | TrapFrame, | ||
OUT PULONGLONG | Result, | ||
OUT PLONG ErrOffset | OPTIONAL, | ||
OUT PCHAR ErrMsg | OPTIONAL | ||
) |
Evaluates the given expression.
Expression | Expression to evaluate. |
TrapFrame | Register values. |
Result | Variable which receives the result on success. |
ErrOffset | Variable which receives character offset on parse error (-1 on other errors) |
ErrMsg | Buffer which receives an error message on failure (128 bytes) |
TRUE | Success. |
FALSE | Failure. |
Definition at line 1102 of file kdb_expr.c.
Referenced by KdbpEvaluateExpression().
BOOLEAN KdbpRpnEvaluateParsedExpression | ( | IN PVOID | Expression, |
IN PKDB_KTRAP_FRAME | TrapFrame, | ||
OUT PULONGLONG | Result, | ||
OUT PLONG ErrOffset | OPTIONAL, | ||
OUT PCHAR ErrMsg | OPTIONAL | ||
) |
Evaluates the given expression and returns the result.
Expression | Expression "handle" returned by KdbpRpnParseExpression. |
TrapFrame | Register values. |
Result | Variable which receives the result on success. |
ErrOffset | Variable which receives character offset on parse error (-1 on other errors) |
ErrMsg | Buffer which receives an error message on failure (128 bytes) |
Definition at line 1196 of file kdb_expr.c.
Referenced by KdbEnterDebuggerException().
PVOID KdbpRpnParseExpression | ( | IN PCHAR | Expression, |
OUT PLONG ErrOffset | OPTIONAL, | ||
OUT PCHAR ErrMsg | OPTIONAL | ||
) |
Parses the given expression and returns a "handle" to it.
Expression | Expression to evaluate. |
ErrOffset | Variable which receives character offset on parse error (-1 on other errors) |
ErrMsg | Buffer which receives an error message on failure (128 bytes) |
Definition at line 1142 of file kdb_expr.c.
Referenced by KdbpInsertBreakPoint().
Definition at line 158 of file kdb_expr.c.
Referenced by RpnpDumpStack(), and RpnpParseExpression().
Definition at line 182 of file kdb_expr.c.
Referenced by RpnpDumpStack(), RpnpEvaluateStack(), and RpnpParseExpression().
Definition at line 198 of file kdb_expr.c.
Referenced by RpnpDumpStack(), and RpnpParseExpression().
Definition at line 230 of file kdb_expr.c.
Referenced by RpnpDumpStack(), and RpnpParseExpression().
Definition at line 238 of file kdb_expr.c.
Referenced by RpnpDumpStack(), and RpnpParseExpression().
Definition at line 214 of file kdb_expr.c.
Referenced by RpnpDumpStack(), and RpnpParseExpression().
Definition at line 222 of file kdb_expr.c.
Referenced by RpnpDumpStack(), and RpnpParseExpression().
Definition at line 190 of file kdb_expr.c.
Referenced by RpnpDumpStack(), and RpnpParseExpression().
Definition at line 174 of file kdb_expr.c.
Referenced by RpnpDumpStack(), and RpnpParseExpression().
Definition at line 206 of file kdb_expr.c.
Referenced by RpnpDumpStack(), and RpnpParseExpression().
Definition at line 166 of file kdb_expr.c.
Referenced by RpnpDumpStack(), and RpnpParseExpression().
|
static |
Clears the given RPN stack.
Stack | Pointer to a RPN_STACK structure. |
Definition at line 325 of file kdb_expr.c.
Referenced by KdbpRpnEvaluateExpression(), and KdbpRpnParseExpression().
VOID RpnpDumpStack | ( | IN PRPN_STACK | Stack | ) |
Dumps the given RPN stack content.
Stack | Pointer to a RPN_STACK structure. |
Definition at line 250 of file kdb_expr.c.
Referenced by KdbpRpnEvaluateExpression(), and KdbpRpnParseExpression().
|
static |
Evaluates the RPN op stack and returns the result.
Stack | Pointer to a RPN_STACK structure. |
TrapFrame | Register values. |
Result | Pointer to an ULONG to store the result into. |
ErrOffset | On failure this is set to the character offset at which the error occoured. |
ErrMsg | Buffer which receives an error message on failure (128 bytes) |
TRUE | Success. |
FALSE | Failure. |
Definition at line 893 of file kdb_expr.c.
Referenced by KdbpRpnEvaluateExpression(), and KdbpRpnEvaluateParsedExpression().
|
static |
Parses an expression.
This functions parses the given expression until the end of string or a closing brace is found. As the function parses the string it pushes RPN_OPs onto the stack.
Examples: 1+2*3 ; eax+10 ; (eax+16) * (ebx+4) ; dword[eax]
Stack | Pointer to a RPN_STACK structure. |
Expression | String to parse. |
CharacterOffset | Character offset of the subexpression from the beginning of the expression. |
End | On success End is set to the character at which parsing stopped. |
ErrOffset | On failure this is set to the character offset at which the error occoured. |
ErrMsg | On failure a message describing the problem is copied into this buffer (128 bytes) |
TRUE | Success. |
FALSE | Failure. |
Definition at line 422 of file kdb_expr.c.
Referenced by KdbpRpnEvaluateExpression(), and KdbpRpnParseExpression().
Pops the top op from the stack.
Stack | Pointer to a RPN_STACK structure. |
Op | Pointer to an RPN_OP to store the popped op into (can be NULL). |
TRUE | Success. |
FALSE | Failure (stack empty) |
Definition at line 363 of file kdb_expr.c.
Referenced by RpnpParseExpression().
Pushes an RPN_OP onto the stack.
Stack | Pointer to a RPN_STACK structure. |
Op | RPN_OP to be copied onto the stack. |
Definition at line 338 of file kdb_expr.c.
Referenced by RpnpParseExpression().
|
static |
Gets the top op from the stack (not popping it)
Stack | Pointer to a RPN_STACK structure. |
Op | Pointer to an RPN_OP to copy the top op into. |
TRUE | Success. |
FALSE | Failure (stack empty) |
Definition at line 388 of file kdb_expr.c.
Referenced by RpnpParseExpression().
Definition at line 108 of file kdb_expr.c.
Definition at line 109 of file kdb_expr.c.
RPN_OP Ops[RPN_OP_STACK_SIZE] |
Definition at line 98 of file kdb_expr.c.
Referenced by KdbpRpnParseExpression().
const { ... } RegisterToTrapFrame[] |
Referenced by RpnpDumpStack(), RpnpEvaluateStack(), and RpnpParseExpression().
|
static |
Definition at line 153 of file kdb_expr.c.
Referenced by RpnpParseExpression().
struct { ... } RpnStack |
Referenced by KdbpRpnEvaluateExpression(), and KdbpRpnParseExpression().
Definition at line 96 of file kdb_expr.c.
Referenced by KdbpRpnParseExpression().
ULONG Sp |
Definition at line 97 of file kdb_expr.c.