On 2012-05-31 21:59, David Kopf wrote:
> I don't know if the preprocessor would choke on so many names, but if each
> module used something like DEBUG_CONTIKIMAC("foo is %u\n",foo) with at the
> top
> #ifndef DEBUG_CONTIKIMAC
> #define DEBUG_CONTIKIMAC(...)
> #endif
>
> then you could have a debug.h included in the contiki-conf.h on each
> platform which I guess could be overridden by a debug.h in the project, that
> defined them. For AVR the printf_p saves RAM, so
> #define DEBUG_CONTIKIMAC(FORMAT,args...) printf_P(PSTR(FORMAT),##args)
>
> The downside would be changing debug.h would force a complete rebuild. But
> in that file you could have
> #define DEBUG_PRINTF(FORMAT,args...) printf_P(PSTR(FORMAT),##args)
> and then in any individual module switch the debug on with
>
> #define DEBUG_CONTIKIMAC DEBUG_PRINTF
>
> have not tried that though.
>
> -----Original Message-----
> From: Fabio Giovagnini
> Sent: Thursday, May 31, 2012 2:22 PM
> To: Contiki developer mailing list
> Subject: Re: [Contiki-developers] Contiki Debug System
>
> Hi
> I'm interested in fixing the debug system.
> I also had the problem of my own printf, so I think it could be a very
> good improvement if easily could be possible in config to choose stdio
> printf or your own one.
> I think we can open a discussion
>
> Best regards
>
> Fabio Giovagnini
>
>
> Il giorno gio, 31/05/2012 alle 19.15 +0200, marcas ha scritto:
>> Hello,
>>
>> the current debug system of contiki is not flexible enough for my
>> purposes.
>> I saw a lot of other debug implementations in other C based projects
>> with following advantages :
>>
>> - centralized enabling and disabling of debug massages (per module!) in
>> one structured debug.h file
>> - printf function is replaceable by any other var arg output function
>> (also only within the debug.h file).
>> - DEBUG is defined during compiler invocation, not within code (=main
>> DEBUG switch)
>>
>>
>> Maybe I do not really understand the current debug system, so please
>> correct me if I am wrong. All modules have following definitions:
>>
>> #define DEBUG 0
>> #if DEBUG
>> #include<stdio.h>
>> #define PRINTF(...) printf(__VA_ARGS__)
>> #else
>> #define PRINTF(...)
>> #endif
>>
>> The only way to enable DEBUG for the module is to set DEBUG to 1 or
>> something other than 0 within the code of the module.
>> printf is fixed in all modules as standard output function. I tried to
>> globally replace it with following definition:
>>
>> #define printf MyPrintf
>>
>> This leads to a conflict with the existing printf of stdio.h with the
>> IAR compiler (warnings that do not need to be thrown and can be avoided).
>>
>> There are also some modules within contiki where DEBUG is set to 1
>> (looks like someone forgot to set it back to 0 again)
>>
>> Did some of you had a talk about the debug system yet? I would be
>> appreciated to receive some more information about it or to start a
>> discussion on how to improve the current debug system.
>>
>> Kind regards
>> marcas
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Contiki-developers mailing list
>>
Contiki-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>>
https://lists.sourceforge.net/lists/listinfo/contiki-developers
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Contiki-developers mailing list
>
Contiki-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>
https://lists.sourceforge.net/lists/listinfo/contiki-developers
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Contiki-developers mailing list
>
Contiki-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>
https://lists.sourceforge.net/lists/listinfo/contiki-developers
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Contiki-developers mailing list
Contiki-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.orghttps://lists.sourceforge.net/lists/listinfo/contiki-developers