boolean_t _doprnt_truncates = FALSE;
+#if (DEVELOPMENT || DEBUG)
+boolean_t doprnt_hide_pointers = FALSE;
+#else
+boolean_t doprnt_hide_pointers = TRUE;
+#endif
+
int
__doprnt(
const char *fmt,
/* character output routine */
void (*putc)(int, void *arg),
void *arg,
- int radix) /* default radix - for '%r' */
+ int radix, /* default radix - for '%r' */
+ int is_log)
{
int length;
int prec;
if (truncate) u = (long long)((int)(u));
+ if (doprnt_hide_pointers && is_log) {
+ const char str[] = "<ptr>";
+ const char* strp = str;
+ int strl = sizeof(str) - 1;
+
+ if (u >= VM_MIN_KERNEL_AND_KEXT_ADDRESS && u <= VM_MAX_KERNEL_ADDRESS) {
+ while(*strp != '\0') {
+ (*putc)(*strp, arg);
+ strp++;
+ }
+ nprinted += strl;
+ break;
+ }
+ }
+
if (u != 0 && altfmt) {
if (base == 8)
prefix = "0";
void (*putc)(char),
int radix) /* default radix - for '%r' */
{
- __doprnt(fmt, *argp, dummy_putc, putc, radix);
+ __doprnt(fmt, *argp, dummy_putc, putc, radix, FALSE);
+}
+
+void
+_doprnt_log(
+ register const char *fmt,
+ va_list *argp,
+ /* character output routine */
+ void (*putc)(char),
+ int radix) /* default radix - for '%r' */
+{
+ __doprnt(fmt, *argp, dummy_putc, putc, radix, TRUE);
}
#if MP_PRINTF
if (fmt) {
disable_preemption();
va_start(listp, fmt);
- _doprnt(fmt, &listp, conslog_putc, 16);
+ _doprnt_log(fmt, &listp, conslog_putc, 16);
va_end(listp);
enable_preemption();
}
va_list listp;
va_start(listp, fmt);
- _doprnt(fmt, &listp, consdebug_putc, 16);
+ _doprnt_log(fmt, &listp, consdebug_putc, 16);
va_end(listp);
return 0;
}
va_start(listp, fmt);
copybyte_str = buf;
- __doprnt(fmt, listp, copybyte, ©byte_str, 16);
+ __doprnt(fmt, listp, copybyte, ©byte_str, 16, FALSE);
va_end(listp);
*copybyte_str = '\0';
return (int)strlen(buf);