* Implemented parse_expression(). The back-end is an expression parser

that is a little more powerful than BeOS'. It features:
  - Persistent and temporary uint64 variables. The former kind is set
    only by the user. The latter (those prefixed "_") can be set
    automatically by commands, thus e.g. making it easier to access
    members of a dumped structure. They are unset when the next command
    is invoked. The special temporary variable "_" is defined as a
    command's return value.
  - Expressions can contain nested command invocations using brackets
    ("[ ... ]").
  - Command lines are parsed by the expression parser, too. They can
    contain command invocations (in brackets) and expressions (in
    parentheses).
* Added debugger commands:
  - expr: Evaluates the given expression and prints the result.
  - unset: Undefines a variable.
  - vars: Prints the values of all defined variables.
* Moved debugger command code into its own source file.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23546 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-01-16 00:01:20 +00:00
parent 5d24ef2e15
commit 3b4fa1664e
8 changed files with 1537 additions and 279 deletions
+12 -1
View File
@@ -59,7 +59,18 @@ extern void debug_stop_screen_debug_output(void);
extern void dprintf_no_syslog(const char *format, ...)
__attribute__ ((format (__printf__, 1, 2)));
extern void _user_debug_output(const char *userString);
extern bool is_debug_variable_defined(const char* variableName);
extern bool set_debug_variable(const char* variableName, uint64 value);
extern uint64 get_debug_variable(const char* variableName,
uint64 defaultValue);
extern bool remove_debug_variable(const char* variableName);
extern void remove_all_temporary_debug_variables();
extern bool evaluate_debug_expression(const char* expression,
uint64* result, bool silent);
extern int evaluate_debug_command(const char* command);
extern void _user_debug_output(const char *userString);
#ifdef __cplusplus
}