From 88ca371b1a97ea4ef00288c1ec4fc6c6108fc29d Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Wed, 28 Dec 2016 02:03:37 +0000 Subject: [PATCH] Add DEBUGFG macro: log groups git-svn-id: svn://kolibrios.org@6818 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/debug-fdo.inc | 11 +++++ .../develop/examples/loggroups/loggroups.asm | 41 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 programs/develop/examples/loggroups/loggroups.asm diff --git a/programs/debug-fdo.inc b/programs/debug-fdo.inc index 40b2cb00e4..a4ec21b31c 100644 --- a/programs/debug-fdo.inc +++ b/programs/debug-fdo.inc @@ -372,6 +372,17 @@ macro DEBUGF _level,_format,[_arg] { end if } +macro DEBUGFG _level, _group, _format, [_arg] { + common + if _group eqtype + DEBUGF _level, _format,_arg + else + if _level >= _group + DEBUGF 999, _format,_arg + end if + end if +} + macro __include_debug_strings dummy,[_id,_fmt,_len] { common local c1,a1,a2 diff --git a/programs/develop/examples/loggroups/loggroups.asm b/programs/develop/examples/loggroups/loggroups.asm new file mode 100644 index 0000000000..8f5ca85eeb --- /dev/null +++ b/programs/develop/examples/loggroups/loggroups.asm @@ -0,0 +1,41 @@ +use32 + org 0x0 + db 'MENUET01' + dd 0x01,start,i_end,e_end,e_end,0,0 + +__DEBUG__ = 1 +__DEBUG_LEVEL__ = 2 + +LOG_FLOW equ 1 +LOG_CALC equ 3 +LOG_SEND equ + +include '../../../macros.inc' +include '../../../debug-fdo.inc' + +start: + DEBUGFG 1, LOG_FLOW, '1 flow\n' + DEBUGFG 2, LOG_FLOW, '2 flow\n' + DEBUGFG 3, LOG_FLOW, '3 flow\n' + + DEBUGFG 1, LOG_CALC, '1 calc\n' + DEBUGFG 2, LOG_CALC, '2 calc\n' + DEBUGFG 3, LOG_CALC, '3 calc\n' + + DEBUGFG 1, LOG_SEND, '1 send\n' + DEBUGFG 2, LOG_SEND, '2 send\n' + DEBUGFG 3, LOG_SEND, '3 send\n' + + DEBUGF 1, '1 blah\n' + DEBUGF 2, '2 blah\n' + DEBUGF 3, '3 blah\n' + + mov eax, -1 + int 0x40 + + +include_debug_strings + +i_end: +rb 0x100 ;stack +e_end: