User Tools

Site Tools


blog:pushbx:2023:0911_debugger_relocation_all_switches_explained

Debugger relocation: Newer switches explained

As described in yesterday's blog post, I added the /T switch to lDebug's init to relocate the application mode debugger. However, one bit I forgot to include was the consideration of adding multiple different strategies to try in order. I wasn't sure how I would expose these as switches to the debugger, so I didn't include them until today.

I finally settled on the /TX, /TY, and /TZ switches. Each letter has to go before an U, L, or numeric specifier specified to the same /T switch: Except for /TX, which is allowed for symmetry but also addresses the same UMB link state and memory allocation as is the default in the absence of /TY and /TZ.

The default status is equivalent to /TX,U,82,O,- – The first strategy is Last fit, High then low, the UMB link state is enabled, relocation is mandatory, and the entire relocation is disabled. The /TY and /TZ state cannot be represented by the available switches, as their UMB link state is internally set to 0FFFFh which is a flag to skip the second and third attempt if they are not otherwise enabled. The memory allocation strategy is 82h by default for all three attempts. The initial /TP switch state is also not representable, as the breakpoint cannot be turned off using the switches once it is enabled. The default, of course, is not to run the breakpoint.

To enable the /TY or /TZ attempt, a single /T switch must specify the attempt's identifier letter and then either L or U to set the UMB link state to 0 or 1. For instance, /TY,L,2 would set up the second attempt with UMBs unlinked and a Last fit, Low then high strategy. Of course, the second or third attempt are only actually run if the prior attempts did not succeed in allocating sufficient memory blocks for the installed resident debugger and its environment.

The /TI switch is unchanged, but it will only be effective if all attempts either failed or were skipped. In this case, the debugger will stay unrelocated and finish its installation. The /TP switch's breakpoint will only run, once, before any attempt is made to allocate memory for relocation. If the second or third attempt happen, the breakpoint is not run a second or third time.

It is important to keep in mind that only a plain /T switch (no further specifiers) or a /T switch ending in a plus will actually enable the relocation. For instance, /TX,U,41,Y,L,2 would not on its own enable relocation at all. The way to enable relocation is to include a /T switch without any additional specifiers, or to append a plus sign to the end of the more specific switch, like /TX,U,41,Y,L,2,+. (After a plus sign or minus sign, parsing of the /T switch stops immediately, and parsing of the next switch or pathname begins.)

You could leave a comment if you were logged in.
blog/pushbx/2023/0911_debugger_relocation_all_switches_explained.txt · Last modified: 2023-09-11 21:19:54 +0200 Sep Mon by ecm