User Tools

Site Tools


blog:pushbx:2023:1008_early_october_work_on_extensions_for_ldebug

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

blog:pushbx:2023:1008_early_october_work_on_extensions_for_ldebug [2023-10-08 18:49:57 +0200 Oct Sun] (current)
ecm created
Line 1: Line 1:
 +====== Early October work on Extensions for lDebug ======
 +
 +**2023-10-08**
 +
 +This week was spent on greatly adding to the utility of the Extension for lDebug ecology. One change was needed in the lmacros collection to support an ELD.
 +
 +
 +===== lmacros section types =====
 +
 +The lmacros3.mac family of sectioning directives, ''addsection'' and ''usesection'', [[https://hg.pushbx.org/ecm/lmacros/rev/541d99bc6847|gained the "section type" defines]]. A new third parameter to ''addsection'' can be specified to explicitly set a section type. If it is not specified then the section name doubles as type, which is required to assemble old sources with macros expecting the new types.
 +
 +The macros using the types previously compared only the section name, which is obviously limited. Rather than only detecting the exact name "DATA" they now work with the **type** "DATA", enabling to match multiple sections with minimal hassle.
 +
 +
 +===== lDebug ELD work =====
 +
 +==== Build environment ====
 +
 +The sources for all ELDs moved into the ''source/eld/'' subdirectory, except for include files used by both the main debugger assembly and any of the ELDs.
 +
 +A mak.sh and cfg.sh were created in the subdirectory to build all non-test ELDs. (The eldcomp ELD is included here albeit it is useful only for ELD developers.)
 +
 +The default ELD code section size was increased to 16 KiB for application and device mode to match the boot loaded mode. Extensions for lDebug are still not supported in the default builds.
 +
 +
 +==== Infrastructure ====
 +
 +I define ELD infrastructure to refer mainly to the debugger parts of the ELD interfaces. Therefore, parts that are always loaded and not specific to each ELD. These are the additions:
 +
 +  * QUIETINSTALL noun [[https://hg.pushbx.org/ecm/ldebug/rev/713a49e07a09|to quieten the installation]] of resident ELDs. (This barely counts as infrastructure because it is only an install noun, zero code section use.)
 +  * Reclaim [[https://hg.pushbx.org/ecm/ldebug/rev/bdcd894b5e63|correctly]] detects [[https://hg.pushbx.org/ecm/ldebug/rev/a586e356b4cc|and clears]] zero-length ELD data blocks.
 +  * Additional links, these also are zero code section use.
 +  * An environment block of nearly 2 KiB is allocated to the debugger. If they fit, device parent and application environments are copied to initialise the block. This supports the SET commands ELD.
 +  * [[https://hg.pushbx.org/ecm/ldebug/rev/c3bc2f91a13d|Command preprocess handler]] to make sure certain ELDs always see commands before another ELD can process them as commands. This is for the VARIABLES expansion ELD.
 +  * Intercepting ''puts'' handler so ELDs can [[https://hg.pushbx.org/ecm/ldebug/rev/ae43260f6fa0|filter or redirect output]] of other commands. This is used for the SET /E command ELD to assign an output line of another command to an environment variable.
 +  * ELD variables: A certain amount of "isvariable structures" [[https://hg.pushbx.org/ecm/ldebug/rev/5816603432ba|are set aside for ELDs]] to add their own variables. Read only variables are fully supported, writing variables is supported only for simple non-alias scalar data types. Added for the AMOUNT variable ELD, which provides the ELDAMOUNT variable to query the number of resident ELDs.
 +
 +
 +==== The specific ELDs ====
 +
 +These are the ELDs I added:
 +
 +  * WITHHDR: Allows to run D commands with a single-command header or trailer, modifying DCO flags to accomplish this.
 +  * PRINTF: Provides some support for formatting text, with the specifiers %X, %u, %d, %c, %s (memory range, memory ASCIZ, or list-like parameter). A special %b code is used to call the size display function of the debugger, which formats a number as Bytes, KiB, MiB, or GiB.
 +  * IFEXT: Adds an IF [NOT] EXT "name" THEN command construct which conditionally executes another command, based on whether a certain ELD is installed residently.
 +  * SET: Dumps all variables, or dumps a single variable, or deletes a variable, or writes to a variable. FreeCOM-style SET /E captures a line of output of another command into a variable. (The /E switch accepts an additional numeric switch to skip a number of lines before the one to capture.)
 +  * VARIABLE: Expand %-delimited variables in debugger commands.
 +  * AMOUNT: Adds the ELDAMOUNT variable which reads the number of currently resident ELDs.
 +
 +
 +==== Misc ====
 +
 +The manual gained two sections on ELDs. Those are [[https://pushbx.org/ecm/doc/ldebug.htm#cmdext|the description of the EXT command]] as well as [[https://pushbx.org/ecm/doc/ldebug.htm#eld|the ELD format chapter]] which details some of the interfaces available to ELDs.
 +
 +{{tag>ldebug eld}}
 +
 +
 +~~DISCUSSION~~
  
blog/pushbx/2023/1008_early_october_work_on_extensions_for_ldebug.txt ยท Last modified: 2023-10-08 18:49:57 +0200 Oct Sun by ecm