|
| | | | Q D B F L A G S
| | | | |
qdbflags-0.1
-------------
---
As the 'qdev' introduces it's own feature-rich debug support that is flag
driven, this tool allows to rearrange these flags in the binaries who are
affected by the debug control/symbol blocks. The debug support was
explained in the 'docs/qdev_debug.txt'. You should go there if you have
never used that facility. As a tip, each function that is affected carries
a special symbol holder just before entry point which is very easy to
locate and that is why it is possible to change its properties which in
turn may have impact on either function output or the whole program. And
all that can be done without the need to recompile the program each time
different debug approach is to be taken.
---
NOTES:
[*]
Requires 68020(no FPU)+, OS2.04(theoretically)+, 8+ kilos of free memory.
[*]
Find out more on debug support in 'docs/' to get familiar with this library
feature and how to effectively use it and what to pass at compilation time.
[*]
See also the 'sadctrl' utility that allows to control the SAD debugger and
message flow as well as baud rate of built-in serial port!
[*]
Do not forget that debug support is redirectable with tools like 'sushi' or
'sashimi' like any other program that bangs built-in serial port.
[*]
A binary called 'example' is a build of 'examples/mem_dbsupport/example.c'.
Its debug contents is as follows(follow the numbers to get the meaning):
"
0001. ( 848): [example.c ] function_1()
^^^^ ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^
1 2 3 4
(0x00000001): irrelevant
^^^^^^^^^^ ^^^^^^^^^^
5 6
0002. ( 1216): [example.c ] function_2()
(0x00000004): outputonce
0003. ( 1682): [example.c ] function_3()
(0x00000180): heavysteps lightsteps
0004. ( 2180): [example.c ] GID_main()
(0x00000000): null
0005. ( 9292): [<unresolved> ] <unresolved>()
(0x00000000): null
"
1 - Order number of the debug block in file. This is tied to offset too.
2 - Offset in file at which the debug block was located. Normally after
this block, function entry can be found.
3 - Filename at the source level of a file that carries this function.
4 - Symbol of a function. If you see '<unresolved>' during execution of
the prog then such function lacks 'QDEVDEBUGIO()' statement.
5 - Control flags expressed as a hexadecimal value.
6 - Control flags as literals. Each flag is separated by a white space.
---
HELP:
> qdbflags ?
BINARY/A,SYMBOLS,F=FANCY/S,-A=-ALLFLAGS/S,
-I=-IRRELEVANT/S,-R=-IRECURSIVE/S,-O=-OUTPUTONCE/S,-V=-NOVOIDTELL/S,
-D=-DONOTSTORE/S,-S=-STACKTRACE/S,-U=-UPPERLEVEL/S,-H=-HEAVYSTEPS/S,
-L=-LIGHTSTEPS/S,-N=-NORMALFILL/S,+I=+IRRELEVANT/S,+R=+IRECURSIVE/S,
+O=+OUTPUTONCE/S,+V=+NOVOIDTELL/S,+D=+DONOTSTORE/S,+S=+STACKTRACE/S,
+U=+UPPERLEVEL/S,+H=+HEAVYSTEPS/S,+L=+LIGHTSTEPS/S,+N=+NORMALFILL/S
BINARY/A - Input/output file to be scanned for debug blocks
and possibly altered with certain flags that are
explained below.
SYMBOLS - Exact, case sensitive symbol name or a pattern of
symbols. This argument is optional, lack of any
input means: #? - all will be taken into account.
To list multiple objects by their exact names try
"(<name>|<name>|<name>|...)".
F=FANCY/S - Turns on CSI styles that make the output easily
readable. The entries are zebrified.
-A=-ALLFLAGS/S - Clears all the flags in the debug control block.
Of course after doing this you can set particular
flags at the same time. Same applies to all flags
that are to be cleared.
-+I=-+IRRELEVANT/S - If this flag is set then all 'QDEVDEBUG()' calls
within this very function will not emit anything
to the terminal, but will store the output for
later use unless of course 'QDEVDEBUG_R()' or
'QDEVDEBUG_RR()' were not encountered.
-+R=-+IRECURSIVE/S - This flag, when specified at the top level func.
will affect other functions that are called by
this function with the irrelevance.
-+O=-+OUTPUTONCE/S - When this is specified in a func. that is being
called often, then the output it produces will
appear only once("Listen carefully I shall say
this only once." - Michelle, Allo Allo). Useful
with callbacks and the like.
-+V=-+NOVOIDTELL/S - This switches the void function hint on and off.
-+D=-+DONOTSTORE/S - All irrelevant output this function produces will
not be memorised when irrelevance is active.
-+S=-+STACKTRACE/S - When this is set then on each function entry
stack contents will be hex dumped. For this to
work, binary must be compiled with instrument
function support.
-+U=-+UPPERLEVEL/S - When specified then all the flags(except for this
one) this function carries will be copied to the
subfunction. This is very useful in conjunction
with '-+O=-+OUTPUTONCE/S'.
-+H=-+HEAVYSTEPS/S - This will cause a pause of 1/4th of a second
after each 'QDEVDEBUG_[R][R]()', so that your
brain can easily follow program flow and act
accordingly to possible Enforcer hits or other
hits. This flag is somewhat global and can be
applied at any point.
-+L=-+LIGHTSTEPS/S - Switches back to "light speed" code execution. It
is the opposite to the above flag and can be put
at any stage. Even along with "heavy stepping" so
that only -this- function will be affected.
-+N=-+NORMALFILL/S - The irrelevant buffer will never be flushed. Use
with care as the buffer is incapable of holding
more than 8 * 1280 = 10240 bytes per program, so
excess information will be lost!
---
USAGE:
; Overlook the file affected by the debug blocks
qdbflags example fancy
; Change properties of the 'GID_main' to see the
; stack contents at entrance
qdbflags example GID_main +s
; Get rid of heavy stepping in the entire binary
qdbflags example -h -l
---
megacz
| |
| | | | |
|