5.6. Debug

any operates via the generaion and execution of scripts, which code may be repeated step by step. Generated scripts are stored in var/dump/ directory.

Generated scripts may be used to repeat commands, written in anybuilds, manually from command string. Script dump.sh contains environment, which was loaded during the process of building. If it is included in current shell session, we will get access to all interface variables like D or MAKEOPTS, we will be able to call functions from any-api(7).

To recreate the environment during the build of zlib-1.2.11 package with configuration id, execute:

    # 1
    . var/dump/zlib-1.2.11_id/dump.sh
    # 2
    set +e
    # 3
    tobuild

Command 1 includes script with build environment, generated by any. It does not execute anything on itself, just initialises the variables and loads the functions.
Command 2 turns off the shell mode "exit on error". The mode is set up by the engine for correct operation and timely diagnostics. It will disturb us during debug.
Command 3 goes to directory with package sources, where build process has been going.

After the given actions we may manually repeat build commands, interesting for us: launch configure anew, launch separate tests from the inners of configure, repeat compilation strings for particular object files and everything else we would need. Shell environment will be identical to the one within the engine during the build, launched from command string.

It is possible to launch large functions from the anybuild as a whole, if we want to step over until later stages:

    # preparation
    . var/dump/zlib-1.2.11_id/dump.sh
    set +e
    tobuild

    # repeat
    src_config
    src_compile
    make install DESTDIR=${D}

    #new debug steps
    ...