mike.dld

Joined: 08 Mar 2006 Posts: 47 Location: Belarus, Minsk
|
Posted: Sat Feb 17, 2007 3:38 pm Post subject: FDO (formatted debug output) |
|
|
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 ] |
|