Commit 92b1c269 authored by Matthias Braun's avatar Matthias Braun
Browse files

debugger: add randnode debug command

This call initializes the node_nr with a random value on startup. This
lets you test wether the compile behaves deterministically regardless of
node numbers (which isn't always the case right now).
parent b01ef44b
......@@ -39,6 +39,7 @@
#include <signal.h>
#include <string.h>
#include <strings.h>
#include <time.h>
#include <ctype.h>
......@@ -590,6 +591,7 @@ static void show_commands(void)
"setoutfile name file redirects debug output of module name to file\n"
"irgname name prints address and graph number of a method given by its name\n"
"irgldname ldname prints address and graph number of a method given by its ldname\n"
"randnodenr randomize initial node number\n"
"help list all commands\n"
);
}
......@@ -906,6 +908,7 @@ enum tokens {
tok_setoutfile,
tok_showent,
tok_showtype,
tok_randnodenr,
tok_identifier,
tok_number,
tok_eof,
......@@ -931,6 +934,7 @@ static const char *reserved[] = {
"setoutfile",
"showent",
"showtype",
"randnodenr",
};
/**
......@@ -1227,6 +1231,12 @@ void firm_debug(const char *cmd)
irg_name(name);
break;
case tok_randnodenr:
dbg_printf("Randomizing initial node number\n");
srand(time(0));
irp->max_node_nr += rand() % 6666;
break;
case tok_irgldname:
token = get_token();
if (token != tok_identifier)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment