Run-time debugger in Blackbox Component Builder

Usage of the framework, compiler and tools

Re: Run-time debugger in Blackbox Component Builder

Postby Ivan Denisov » Tue Feb 06, 2018 7:28 am

Checked with Windows 10 and Wine-3.0

Published
https://blackbox.obertone.ru/component/RemDebug
I used X512 version and ideas of Josef. That is why I added you to the authors.

works with
https://blackbox.obertone.ru/unstable/m ... a1.053.zip
The Kernel was patched with one procedure for integer to string conversion and several lines in the Init procedure.
User avatar
Ivan Denisov
 
Posts: 221
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: Run-time debugger in Blackbox Component Builder

Postby Josef Templ » Thu Feb 15, 2018 9:06 am

Would it be possible to add a feature to the debugger that allows one to
debug the 'active' process instead of creating a new process that is then debugged?

In many cases, at least in my experience, what the user wants to do is to
run a command in its current environment under the control of a debugger.
The newly started BlackBox process would act as the debugger and the currently
active BlackBox process is the one that is being debugged.
The operation of the debugger would not be changed, only the roles of the involved processes
are reversed.

WinAPI.DebugActiveProcess seems to be exactly for that purpose.


<<EDITED>>
One more comment:
The old way of passing kernelAdr is to use register EBX.
For BlackBox 1.7.1 the line
kernelAdr := context.(*Ebx*)Edi; (* for old realisation *)
needs to be changed to
kernelAdr := context.Ebx(*Edi*); (* for old realisation *)

- Josef
Josef Templ
 
Posts: 151
Joined: Tue Sep 17, 2013 6:50 am

Re: Run-time debugger in Blackbox Component Builder

Postby Josef Templ » Thu Feb 15, 2018 1:35 pm

The test for the new versus old style of passing kernelAdr has a little bug, I think.
In "IF string[17] = "[" THEN" the character in string[17] is undefined for the old style
because it is after the terminating 0X character.

While it works in practice, I would suggest to check string[16] # 0X before setting it to 0X
or to save it in an extra character, like:
Code: Select all
ch := string[16]; string[16] := 0X; ...
IF string$ = "BlackBox started" THEN ...
  IF (ch = " ") & (string[17] = "[") THEN ...

In addition, what is passed here in the string is not modList but the address of variable modList
named kernelAdr in the debugger. Therefore it is misleading to output the string
"BlackBox started [modList=xxx]" as the debug string.
I would suggest to use something like "BlackBox started [dbgBase=xxx]".

- Josef
Josef Templ
 
Posts: 151
Joined: Tue Sep 17, 2013 6:50 am

Previous

Return to Common questions

Who is online

Users browsing this forum: No registered users and 2 guests