version 1.12, 2025/05/01 21:02:31
|
version 1.13, 2025/05/20 18:07:41
|
Line 24
|
Line 24
|
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* |
* |
* $Log$ |
* $Log$ |
|
* Revision 1.13 2025/05/20 18:07:41 snw |
|
* Add completion to debugger |
|
* |
* Revision 1.12 2025/05/01 21:02:31 snw |
* Revision 1.12 2025/05/01 21:02:31 snw |
* Documentation updates |
* Documentation updates |
* |
* |
Line 98 extern int read_history ();
|
Line 101 extern int read_history ();
|
#include "freem.h" |
#include "freem.h" |
#include "mref.h" |
#include "mref.h" |
|
|
|
#ifdef HAVE_LIBREADLINE |
|
char *dbg_commands[] = { |
|
"backtrace", |
|
"continue", |
|
"examine", |
|
"exit", |
|
"halt", |
|
"next", |
|
"quit", |
|
"step", |
|
"trace", |
|
"watch", |
|
NULL |
|
}; |
|
|
|
char **dbg_completion(const char *, int, int); |
|
char *dbg_generator(const char *, int); |
|
|
|
char **dbg_completion(const char *text, int start, int end) |
|
{ |
|
if (start > 0) return NULL; |
|
rl_attempted_completion_over = 1; |
|
return rl_completion_matches (text, dbg_generator); |
|
} |
|
|
|
char *dbg_generator(const char *text, int state) |
|
{ |
|
static int list_index, len; |
|
char *name; |
|
|
|
if (!state) { |
|
list_index = 0; |
|
len = strlen(text); |
|
} |
|
|
|
while ((name = dbg_commands[list_index++])) { |
|
if (strncmp (name, text, len) == 0) { |
|
return strdup (name); |
|
} |
|
} |
|
|
|
return NULL; |
|
} |
|
#endif |
|
|
dbg_watch dbg_watchlist[MAXWATCH]; /* list of watchpoints */ |
dbg_watch dbg_watchlist[MAXWATCH]; /* list of watchpoints */ |
short dbg_enable_watch; /* 0 = watches disabled, 1 = watches enabled */ |
short dbg_enable_watch; /* 0 = watches disabled, 1 = watches enabled */ |
int dbg_pending_watches; |
int dbg_pending_watches; |
Line 142 int debugger (int entry_mode, char *entr
|
Line 190 int debugger (int entry_mode, char *entr
|
char tbuf2[512]; |
char tbuf2[512]; |
register int i; |
register int i; |
register int j; |
register int j; |
|
|
|
rl_attempted_completion_function = dbg_completion; |
set_io (UNIX); |
set_io (UNIX); |
|
|
if (first_entry) { |
if (first_entry) { |