Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ddb Allow for MD code to use a different function than d...



details:   https://anonhg.NetBSD.org/src/rev/830d114563ca
branches:  trunk
changeset: 951979:830d114563ca
user:      simonb <simonb%NetBSD.org@localhost>
date:      Wed Feb 10 07:17:39 2021 +0000

description:
Allow for MD code to use a different function than db_stack_trace_print()
to be used with db_stacktrace() and friends by pre-defining the
db_stacktrace_print macro.

diffstat:

 sys/ddb/db_interface.h |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (34 lines):

diff -r b4665267fef7 -r 830d114563ca sys/ddb/db_interface.h
--- a/sys/ddb/db_interface.h    Wed Feb 10 00:28:55 2021 +0000
+++ b/sys/ddb/db_interface.h    Wed Feb 10 07:17:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.h,v 1.37 2019/06/02 06:09:17 mrg Exp $    */
+/*     $NetBSD: db_interface.h,v 1.38 2021/02/10 07:17:39 simonb Exp $ */
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -80,16 +80,16 @@
 /* kern/subr_disk.c, dev/dksubr.c */
 void           db_show_disk(db_expr_t, bool, db_expr_t, const char *);
 
-#define        db_stacktrace() \
-    db_stack_trace_print((db_expr_t)(intptr_t)__builtin_frame_address(0), \
-       true, 65535, "", printf)
 
-#define        db_ustacktrace() \
+/* The db_stacktrace_print macro may be overridden by an MD macro */
+#ifndef db_stacktrace_print
+#define        db_stacktrace_print(prfunc) \
     db_stack_trace_print((db_expr_t)(intptr_t)__builtin_frame_address(0), \
-       true, 65535, "", uprintf)
+       true, 65535, "", prfunc)
+#endif /* !db_stacktrace_print */
 
-#define        db_lstacktrace() \
-    db_stack_trace_print((db_expr_t)(intptr_t)__builtin_frame_address(0), \
-       true, 65535, "", addlog)
+#define        db_stacktrace()         db_stacktrace_print(printf);
+#define        db_ustacktrace()        db_stacktrace_print(uprintf);
+#define        db_lstacktrace()        db_stacktrace_print(log);
 
 #endif /* _DDB_DB_INTERFACE_H_ */



Home | Main Index | Thread Index | Old Index