static void run_plant_and_detach_test(int is_early) { char before[BREAK_INSTR_SIZE]; char after[BREAK_INSTR_SIZE]; probe_kernel_read(before, (char *)kgdbts_break_test, BREAK_INSTR_SIZE); init_simple_test(); ts.tst = plant_and_detach_test; ts.name = "plant_and_detach_test"; /* Activate test with initial breakpoint */ if (!is_early) kgdb_breakpoint(); probe_kernel_read(after, (char *)kgdbts_break_test, BREAK_INSTR_SIZE); if (memcmp(before, after, BREAK_INSTR_SIZE)) { printk(KERN_CRIT "kgdbts: ERROR kgdb corrupted memory\n"); panic("kgdb memory corruption"); } /* complete the detach test */ if (!is_early) kgdbts_break_test(); }
static void run_breakpoint_test(int is_hw_breakpoint) { test_complete = 0; init_simple_test(); if (is_hw_breakpoint) { ts.tst = hw_breakpoint_test; ts.name = "hw_breakpoint_test"; } else { ts.tst = sw_breakpoint_test; ts.name = "sw_breakpoint_test"; } /* Activate test with initial breakpoint */ kgdb_breakpoint(); /* run code with the break point in it */ kgdbts_break_test(); kgdb_breakpoint(); if (test_complete) return; eprintk("kgdbts: ERROR %s test failed\n", ts.name); if (is_hw_breakpoint) hwbreaks_ok = 0; }