|
Message
From: =?unknown-8bit?Q?Gy=F6rgy?= 'nog' Jeney<nog@s...>
Date: Thu Mar 24 21:10:20 CET 2005
Subject: [openrisc] [or1ksim #56] Rearange some code for easier readability
Hi,This piece of code has been bothering me to no end so I decided to do something about it.
ChangeLog: * Rearange some code to make it clearer what it does.
nog. -------------- next part -------------- diff -urp --unidirectional-new-file /home/nog/or1ksim-split/cpu/common/trace.c ./cpu/common/trace.c --- /home/nog/or1ksim-split/cpu/common/trace.c 2005-02-09 18:03:36.000000000 +0100 +++ ./cpu/common/trace.c 2005-01-29 11:28:09.000000000 +0100 @@ -36,19 +36,19 @@ Foundation, Inc., 675 Mass Ave, Cambridg void set_insnbrkpoint(oraddr_t addr) { - addr &= 0xfffffffc; /* 32-bit aligned */ - - if (verify_memoryarea(addr)) - if (has_breakpoint (addr)) { - remove_breakpoint (addr); - PRINTF("\nBreakpoint at 0x%"PRIxADDR" cleared.\n", addr); - } else { - add_breakpoint (addr); - PRINTF("\nBreakpoint at 0x%"PRIxADDR" set.\n", addr); - } - else - PRINTF("ERROR: Can't set this breakpoint out of memory.\n"); + addr &= ~ADDR_C(3); /* 32-bit aligned */ + if (!verify_memoryarea(addr)) + PRINTF("WARNING: This breakpoint is out of the simulated memory range.\n"); + + if (has_breakpoint (addr)) { + remove_breakpoint (addr); + PRINTF("\nBreakpoint at 0x%"PRIxADDR" cleared.\n", addr); + } else { + add_breakpoint (addr); + PRINTF("\nBreakpoint at 0x%"PRIxADDR" set.\n", addr); + } + return; }
|
 |