You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/05/10 19:26:35 UTC
[GitHub] [mynewt-core] kasjer commented on a change in pull request #1807:
[RFC] Using software breakpoints
kasjer commented on a change in pull request #1807: [RFC] Using software breakpoints
URL: https://github.com/apache/mynewt-core/pull/1807#discussion_r283014391
##########
File path: hw/hal/include/hal/hal_system.h
##########
@@ -52,6 +54,17 @@ void hal_system_restart(void *img_start) __attribute((noreturn));
*/
int hal_debugger_connected(void);
+#if MYNEWT_VAL(HAL_BREAK_HOOK)
+/* User defined function to be called before code is stopped in debugger */
+void hal_break_hook(void);
+#else
+#define hal_break_hook()
+#endif
+
+#ifndef HAL_DEBUG_BREAK
+#define HAL_DEBUG_BREAK() do { if (hal_debugger_connected()) { hal_break_hook(); hal_debug_break(); }} while (0)
+#endif
Review comment:
@wes3 similar pattern was use in some files, but I'm not going to force this. I could drop () for once, or change it to static inline.
Macro with ifdef makes is easier to completely drop it if someone wants to like -DHAL_DEBUG_BREAK or such.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services