Community
Participate
Working Groups
The following code from flush_instructions() unplants software breakpoints, and this is causing troubles to the VxWorks application mode debugger. This application mode debugger (As opposed to the VxWorks stop mode debugger) does not stop all VxWorks contexts. This means that when executing flush_instructions() other VxWorks tasks are still running, and calling remove_instruction() may cause some breakpoints not to be hit. Disabling this part of the code resolves the issue on VxWorks (See #ifdef(_WRS_KERNEL). /* Unplant breakpoints */ l = lst.next; while (l != &lst) { BreakInstruction * bi = link_lst2bi(l); l = l->next; if (!bi->valid) { assert(!bi->hardware); assert(!bi->virtual_addr); continue; } if (bi->stepping_over_bp) continue; if (bi->planted) { if (bi->dirty || bi->address_error) { (void)remove_instruction(bi); } else if (bi->ref_cnt == 0 && bi->virtual_addr) { (void)remove_instruction(bi); } #if !defined(_WRS_KERNEL) /* * It is an issue if the TCF agent removes and install again and again * the breakpoints on a VxWorks target even if the breakpoint has not * changed. It may cause some breakpoints to not be hit. * This is caused by the optimisation below; this optimisation * does not apply to VxWorks and can be safely disabled. */ else if (bi->saved_size == 0 && !bi->hardware) { /* Free space for hardware breakpoints */ (void)remove_instruction(bi); } #endif /* _WRS_KERNEL */ } if (bi->planted || bi->ref_cnt == 0 || bi->address_error || bi->cb.ctx->exiting || bi->cb.ctx->exited) { list_remove(&bi->link_lst); } } Unless you have a better idea, I suggest to either integrate the above workaround, or to define a macro in breakpoints-ext.h (See Bug 478914). Something like this: else if (DISABLE_SOFT_BP_ON_FLUSH && bi->saved_size == 0 && !bi->hardware) { /* Free space for hardware breakpoints */ (void)remove_instruction(bi); } The default breakpoints-ext.h would define: #define DISABLE_SOFT_BP_ON_FLUSH TRUE Thanks to provide me your feedback.
I have added #if !defined(_WRS_KERNEL). Fixed. Thanks!
Thanks!