From 92b1c26914404b7fc288a3de1480331a1f42bd94 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 13 Jun 2012 11:02:30 +0200 Subject: [PATCH] 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). --- ir/debug/debugger.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ir/debug/debugger.c b/ir/debug/debugger.c index d119ff113..0d02f3b0a 100644 --- a/ir/debug/debugger.c +++ b/ir/debug/debugger.c @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -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) -- 2.20.1