This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: diag_printf refuses to print ANSI escape sequences?


 Grant Edwards <grante@visi.com> writes:

> > Ah, the diag_printf() for me always did mean the diagnostic (read debug)
> > output function, but it didn't mean for me any type of the printf+send.
> > IMHO, those diag_*() functions should be the light weight things.
> 
> Then adding extra code to reject strings with escape character
> in them seems to be the wrong way to go them.

diag_printf() is expressly designed to generate diagnostic
output. This often happens after memory has been corrupted, or during
development, when it would be easy to try and print a string that has
been overwritten, or has not yet been initialized. This has the
potential of making a total mess of the diagnostic output,
particularly if minicom/Hyperterm interprets escape sequences.

After suffering this one too many times, we added code to check all
strings for printable characters and reject those that don't. This
greatly improved the quality of diagnostics during development and the
dying moments of a system.


-- 
Nick Garnett                                     eCos Kernel Architect
eCosCentric Limited     http://www.eCosCentric.com/   The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.    Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]