KolibriOS KolibriOS
Menuet OS evolved to KolibriOS
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   fchat fChat   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FDO (formatted debug output)

 
Post new topic   Reply to topic    KolibriOS Forum Index -> Useful Routines
View previous topic :: View next topic  
Author Message
mike.dld



Joined: 08 Mar 2006
Posts: 47
Location: Belarus, Minsk

PostPosted: Sat Feb 17, 2007 3:38 pm    Post subject: FDO (formatted debug output) Reply with quote

FDO (formatted debug output) - macros collection to improve programs debug convenience. It works like printf() function, printing debug messages to BOARD.

In most cases you'll need only DEBUGF, but DEBUGS, DEBUGD, DEBUGH are also available.

Here's an example from short description:
Code:
Available format specifiers are: %s, %d, %u, %x (with partial width support)

To be defined within your sources:
  __DEBUG__ equ 1
  __DEBUG_LEVEL__ equ 5

Examples:
  DEBUGF 1, "%s - %d (%x)", eax, 123, ch
  DEBUGF 1, "%d.%d.%d.%d", [ip+0]:1, [ip+1]:1, [ip+2]:1, [ip+3]:1
  DEBUGF 1, <"function ", __FNAME__, ": %s - %x - %u">, "text here", [var]:5, [esp+16]

  DEBUGF 1, "[%d][%d][%d][%d][%d]n", al, ax, ebx, [eax], [eax]:1
  DEBUGF 2, "[%u][%u][%u][%u][%u]n", al, ax, ebx, [eax], [eax]:1
  DEBUGF 3, "[%x][%x][%x][%x][%x]n", al, ax, ebx, [eax], [eax]:1
  DEBUGF 4, "[%s][%s][%s][%s][%s][%s][%s]n", "string":4, eax, eax:5, [ebx]:5, eax:ecx, eax:[ecx], eax:byte[ecx]

Widths:
  for %s - any number, register, or in-memory variable
  for %d - 1, 2, 4 (only for in-memory arguments)
  for %u - 1, 2, 4 (only for in-memory arguments)
  for %x - 1 .. 8

Download: (7z|zip)

There's also a way to use FDO in kernel. Patches are available at russian forum: http://meos.sysbin.com/viewtopic.php?p=9414
_________________
[ KolibriOS.org ] - [ Home Page (Blog) ] - [ A1QA ]
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
trolly



Joined: 03 Aug 2006
Posts: 103
Location: belgium

PostPosted: Sat Feb 17, 2007 6:30 pm    Post subject: Reply with quote

cool we can make a console and use the debug bord for the stdout. it will be easy to print character to the console from the application without IPC
_________________
http://trolly.wordpress.com
http://stephaneweg.no-ip.org
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
diamond



Joined: 05 Apr 2006
Posts: 77
Location: Russia, WASM

PostPosted: Mon Feb 19, 2007 3:18 pm    Post subject: Reply with quote

trolly
Console code is already developing and supports ANSI C printf. Look at testcon2 example in the distributive.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KolibriOS Forum Index -> Useful Routines All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum