Skip to content

Commit

Permalink
reverted unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alwin-joshy committed Jan 15, 2024
1 parent f787553 commit 0e95e54
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
16 changes: 1 addition & 15 deletions apps/sel4test-tests/arch/x86/arch/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,9 @@
"int $3\n\t" \
"post_sbreak:\n\t")

#define TEST_SINGLE_STEP_ASM() \
asm volatile( \
".att_syntax\n\t" \
".global label_one, label_two\n\t" \
".type label_one, @function\n\t" \
".type label_two, @function\n\t" \
"label_one: \n\t" \
"nop \n\t" \
"label_two: \n\t" \
"nop \n\t" \
)

/* Tell C about the symbols exported by the ASM above. */
extern char post_sbreak, label_one, label_two;
extern char post_sbreak;
#define TEST_SOFTWARE_BREAK_EXPECTED_FAULT_LABEL post_sbreak
#define TEST_SS_LABEL_ONE label_one
#define TEST_SS_LABEL_TWO label_two
#define SINGLESTEP_EXPECTED_BP_CONSUMPTION_VALUE (false)
#define TEST_NUM_DATA_WPS seL4_NumDualFunctionMonitors
#define TEST_NUM_INSTR_BPS seL4_NumDualFunctionMonitors
Expand Down
2 changes: 1 addition & 1 deletion apps/sel4test-tests/src/arch/arm/tests/breakpoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ static int test_single_step_one(struct env *env) {
DEFINE_TEST(SINGLESTEP_001, "Test that single stepping 1 instruction works",
test_single_step_one, config_set(CONFIG_HARDWARE_DEBUG_API))

#endif /* CONFIG_HARDWARE_DEBUG_API */
#endif /* CONFIG_HARDWARE_DEBUG_API */
10 changes: 4 additions & 6 deletions apps/sel4test-tests/src/tests/breakpoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ static volatile uint32_t bpd;
* event may be the triggering of an instruction breakpoint, a data watchpoint,
* or a software break request.
*/
static int breakpoint_triggerer_main(seL4_Word type, seL4_Word size, seL4_Word rw, seL4_Word arg3) {
static int breakpoint_triggerer_main(seL4_Word type, seL4_Word size, seL4_Word rw, seL4_Word arg3)
{

if (type == seL4_InstructionBreakpoint) {
breakpoint_code();
Expand All @@ -123,7 +124,7 @@ static int breakpoint_triggerer_main(seL4_Word type, seL4_Word size, seL4_Word r
* by dereferencing null. The purpose of this is to ensure that if this
* test fails, the other tests will be allowed to continue.
*/
volatile int *pi = (volatile int *) BREAKPOINT_TEST_BAD_FAULT_MAGIC_ADDR;
volatile int *pi = (volatile int *)BREAKPOINT_TEST_BAD_FAULT_MAGIC_ADDR;
*pi = 1;
} else if (type == seL4_SoftwareBreakRequest) {
TEST_SOFTWARE_BREAK_ASM();
Expand Down Expand Up @@ -160,7 +161,7 @@ static int breakpoint_handler_main(seL4_Word _fault_ep_cspath, seL4_Word a1, seL
case seL4_Fault_DebugException:
return 0;
default:
ZF_LOGE("Fault of type %zd received. Vaddr 0x%zx\n", label, fault_data.vaddr);
ZF_LOGE("Fault of type %zd received. Vaddr %zu\n", label, fault_data.vaddr);
fault_data.bp_num = 0;
return -1;
}
Expand All @@ -176,8 +177,6 @@ static void setup_handler_thread_for_test(struct env *env, helper_thread_t *hand
0, 0, 0);
}



static void cleanup_breakpoints_from_test(struct env *env)
{
for (int i = TEST_FIRST_INSTR_BP; i < TEST_FIRST_INSTR_BP + TEST_NUM_INSTR_BPS; i++) {
Expand Down Expand Up @@ -483,5 +482,4 @@ DEFINE_TEST(BREAK_REQUEST_001, "Use an INT3/BKPT instruction to trigger a "
"listening handler.",
test_debug_api_software_break_request, config_set(CONFIG_HARDWARE_DEBUG_API))


#endif /* CONFIG_HARDWARE_DEBUG_API */

0 comments on commit 0e95e54

Please sign in to comment.