Skip to content
Snippets Groups Projects
Commit 056bd552 authored by David Sidrane's avatar David Sidrane Committed by Lorenz Meier
Browse files

New NuttX debug API

parent 56613709
No related branches found
No related tags found
No related merge requests found
......@@ -80,7 +80,7 @@ warnerr_core(int errcode, const char *fmt, va_list args)
fprintf(stderr, "\n");
#elif CONFIG_ARCH_LOWPUTC
lowsyslog("%s: ", px4_get_taskname());
syslog("%s: ", px4_get_taskname());
lowvsyslog(fmt, args);
/* convenience as many parts of NuttX use negative errno */
......@@ -89,10 +89,10 @@ warnerr_core(int errcode, const char *fmt, va_list args)
}
if (errcode < NOCODE) {
lowsyslog(": %s", strerror(errcode));
syslog(": %s", strerror(errcode));
}
lowsyslog("\n");
syslog("\n");
#endif
}
......
......@@ -56,7 +56,7 @@
#define debug(fmt, args...) do { } while(0)
//#define debug(fmt, args...) do { printf("[mixer] " fmt "\n", ##args); } while(0)
//#include <debug.h>
//#define debug(fmt, args...) lowsyslog(fmt "\n", ##args)
//#define debug(fmt, args...) syslog(fmt "\n", ##args)
MixerGroup::MixerGroup(ControlCallback control_cb, uintptr_t cb_handle) :
Mixer(control_cb, cb_handle),
......
......@@ -61,7 +61,7 @@
#define debug(fmt, args...) do { } while(0)
//#define debug(fmt, args...) do { printf("[mixer] " fmt "\n", ##args); } while(0)
//#include <debug.h>
//#define debug(fmt, args...) lowsyslog(fmt "\n", ##args)
//#define debug(fmt, args...) syslog(fmt "\n", ##args)
/*
* Clockwise: 1
......
/************************************************************************************
* configs/stm32f4discovery/src/up_cxxinitialize.c
* src/modules/systemlib/up_cxxinitialize.c
* arch/arm/src/board/up_cxxinitialize.c
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
......@@ -54,25 +54,12 @@
/* Debug ****************************************************************************/
/* Non-standard debug that may be enabled just for testing the static constructors */
#ifndef CONFIG_DEBUG
# undef CONFIG_DEBUG_CXX
#endif
#undef CONFIG_DEBUG_CXX
#ifdef CONFIG_DEBUG_CXX
# define cxxdbg dbg
# define cxxlldbg lldbg
# ifdef CONFIG_DEBUG_VERBOSE
# define cxxvdbg vdbg
# define cxxllvdbg llvdbg
# define cxxinfo _info
# else
# define cxxvdbg(x...)
# define cxxllvdbg(x...)
# endif
#else
# define cxxdbg(x...)
# define cxxlldbg(x...)
# define cxxvdbg(x...)
# define cxxllvdbg(x...)
# define cxxinfo(x...)
#endif
/************************************************************************************
......@@ -128,14 +115,14 @@ void up_cxxinitialize(void)
{
initializer_t *initp;
cxxdbg("_sinit: %p _einit: %p _stext: %p _etext: %p\n",
&_sinit, &_einit, &_stext, &_etext);
cxxinfo("_sinit: %p _einit: %p _stext: %p _etext: %p\n",
&_sinit, &_einit, &_stext, &_etext);
/* Visit each entry in the initialzation table */
for (initp = &_sinit; initp != &_einit; initp++) {
initializer_t initializer = *initp;
cxxdbg("initp: %p initializer: %p\n", initp, initializer);
cxxinfo("initp: %p initializer: %p\n", initp, initializer);
/* Make sure that the address is non-NULL and lies in the text region
* defined by the linker script. Some toolchains may put NULL values
......@@ -143,7 +130,7 @@ void up_cxxinitialize(void)
*/
if ((void *)initializer > (void *)&_stext && (void *)initializer < (void *)&_etext) {
cxxdbg("Calling %p\n", initializer);
cxxinfo("Calling %p\n", initializer);
initializer();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment