Browse Source

New NuttX debug API

sbg
David Sidrane 8 years ago committed by Lorenz Meier
parent
commit
056bd5527d
  1. 6
      src/modules/systemlib/err.c
  2. 2
      src/modules/systemlib/mixer/mixer_group.cpp
  3. 2
      src/modules/systemlib/mixer/mixer_multirotor.cpp
  4. 27
      src/modules/systemlib/up_cxxinitialize.c

6
src/modules/systemlib/err.c

@ -80,7 +80,7 @@ warnerr_core(int errcode, const char *fmt, va_list args) @@ -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) @@ -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
}

2
src/modules/systemlib/mixer/mixer_group.cpp

@ -56,7 +56,7 @@ @@ -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),

2
src/modules/systemlib/mixer/mixer_multirotor.cpp

@ -61,7 +61,7 @@ @@ -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

27
src/modules/systemlib/up_cxxinitialize.c

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
/************************************************************************************
* 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 @@ @@ -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
#ifdef CONFIG_DEBUG_CXX
# define cxxdbg dbg
# define cxxlldbg lldbg
# ifdef CONFIG_DEBUG_VERBOSE
# define cxxvdbg vdbg
# define cxxllvdbg llvdbg
# else
# define cxxvdbg(x...)
# define cxxllvdbg(x...)
# endif
# define cxxinfo _info
# 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) @@ -128,14 +115,14 @@ void up_cxxinitialize(void)
{
initializer_t *initp;
cxxdbg("_sinit: %p _einit: %p _stext: %p _etext: %p\n",
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) @@ -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();
}
}

Loading…
Cancel
Save