Using Debug4x for large projects - Hewlett Packard

This is a discussion on Using Debug4x for large projects - Hewlett Packard ; First of all, sorry for asking what's probably a newbye question, that it seems i'm not able to sort out alone. I've been discovering Debug4x lately (build 134), and i'm just trying to understand how i can revamp an old ...

+ Reply to Thread
Results 1 to 15 of 15

Thread: Using Debug4x for large projects

  1. Using Debug4x for large projects

    First of all, sorry for asking what's probably a newbye question, that
    it seems i'm not able to sort out alone.

    I've been discovering Debug4x lately (build 134), and i'm just trying
    to understand how i can revamp an old project using this pretty and
    efficient development GUI.

    The problem is, this project is (for the time being) using dozens of
    global variables.
    And i've not been successfull in making Debug4x creating more than one
    variable per project.
    Each variable can be either a value (any type), a program
    (secondaries) or assembler code.
    I typically write one source file for each.

    Of course, a work around wold be to create dozens of project, but i'm
    sure it exists a better way to handle this situation.

    Now i understand that the limitation is coming from RPLCOMP, not
    Debug4x itself. But the HP documentation has not fully helped.

    I've been trying to create a Directory lately, using INCLUDE
    statements for each variable. But no luck up to now.

    Regards

  2. Re: Using Debug4x for large projects

    "Yann" wrote in message
    news:34d3f8ff-53cb-4c12-8cbf-f12c19cb49be@y38g2000hsy.googlegroups.com...
    > I've been discovering Debug4x lately (build 134), and i'm just trying
    > to understand how i can revamp an old project using this pretty and
    > efficient development GUI.
    >
    > The problem is, this project is (for the time being) using dozens of
    > global variables.


    What kind of project are we talking about here?
    Is it SysRPL or UserRPL?
    If SysRPL, is it a program or a library?

    A simple program can create variables as part of a project's source code.
    A library (in SysRPL) will have to write some code that checks for existence
    and creates the variables in RAM as needed.

    > I've been trying to create a Directory lately, using INCLUDE
    > statements for each variable. But no luck up to now.


    Did you look at the directory "DIRECT" example project included with
    Debug4x?

    -- - - - - - - - - - - - - - - - -
    Bill Graves RKBA!
    bgraves@ix.netcom.com



  3. Re: Using Debug4x for large projects

    Thank you very much William (or is that Bill ? for pointing to
    DIRECT example code. Indeed, the different example codes provided with
    Debug4x are very instructive.

    I think DIRECT example this will do the trick. A single file within
    the project, a single MACRO call, definition of all variables with as
    many includes as necessary for each variable, this will most probably
    help me out.

    The project i'm referring to is hosted at this website :
    http://phantasie.tonempire.net/portal.htm
    or for english :
    http://translate.google.fr/translate...hl=fr&ie=UTF-8

    It is a pretty huge code, having a mixture of nearly every object type
    possible on HP48. This includes UserRPL, SystemRPL, Saturn Assembly
    Code, and of course many data values (string, grobs, strings, real,
    etc..). Because the program was built into several consecutive waves,
    using their own set of tools and assembler, there is no such thing as
    a "unified code source".

    Although the latest versions are now provided in Library Format for
    the user, the Development version is still a Directory structure.

    It could change in the future, but for now, due to the way the program
    was developped, the base source code is too broad to expect integrate
    everything within a single project.
    At least for now....

    Well, a big thank you for showing me the way.

  4. Re: Using Debug4x for large projects

    hello,

    I would suggest that you put your whole project in a single library object.
    this should solve your problems.

    cyrille


    "Yann" wrote in message
    news:34d3f8ff-53cb-4c12-8cbf-f12c19cb49be@y38g2000hsy.googlegroups.com...
    > First of all, sorry for asking what's probably a newbye question, that
    > it seems i'm not able to sort out alone.
    >
    > I've been discovering Debug4x lately (build 134), and i'm just trying
    > to understand how i can revamp an old project using this pretty and
    > efficient development GUI.
    >
    > The problem is, this project is (for the time being) using dozens of
    > global variables.
    > And i've not been successfull in making Debug4x creating more than one
    > variable per project.
    > Each variable can be either a value (any type), a program
    > (secondaries) or assembler code.
    > I typically write one source file for each.
    >
    > Of course, a work around wold be to create dozens of project, but i'm
    > sure it exists a better way to handle this situation.
    >
    > Now i understand that the limitation is coming from RPLCOMP, not
    > Debug4x itself. But the HP documentation has not fully helped.
    >
    > I've been trying to create a Directory lately, using INCLUDE
    > statements for each variable. But no luck up to now.
    >
    > Regards




  5. Re: Using Debug4x for large projects

    You right Cyrille, however there are 2 problems :

    1) Source Code is not currently unified, using different set of
    mnemonics and/or comments convention.
    So I would need first to rewrite every little bit before
    considering this possibility.
    Including ressources, which means Large Grobs, for which Debug4x
    is not so nice.
    Quite some work, will cost many weeks.

    2) From a directory, i can create a library, which is actually what
    i'm doing;
    the end user already manipulates a simple library object.

    Now for the good and important part :
    Because the initial binary is pretty large (about 80KB), i'm using a
    tool which creates a compressed library.
    The tool is called MkLibZ, and is a simple modification of MkLib, from
    Detlef Muller. You can find it here :
    http://phantasie.tonempire.net/mklib...bz-v04-t43.htm

    The way it works is by compressing every single object when it's worth
    it, excluding too small object, those that compress badly, and a
    selected set of objects i want to save for performance.
    The end result is a 55KB library, with little (if any) performance
    impact, which is an important enough saving to be considered.

    Now you can guess one consequence : if i build a library directly from
    the output Debug4x/Rplcomp, then i can say farewell to those
    compression savings, as i don't currently know of a tool which
    compresses an already created library.


    One last comment : the current target system is HP48 S/G, so i cannot
    use HP49 specific library compression tools.

    Regards

  6. Re: Using Debug4x for large projects

    > * * Including ressources, which means Large Grobs, for which Debug4x
    > is not so nice.


    You can simply INCLUDE them in the project. Save the grob as a file,
    make sure it doesn't have the HPHP49-X which is stuck in automatically
    when you store an item to the SD card. The help file says it strips
    this out, but I have seen it not do it sometimes in the past.

    > Now you can guess one consequence : if i build a library directly from
    > the output Debug4x/Rplcomp, then i can say farewell to those
    > compression savings, as i don't currently know of a tool which
    > compresses an already created library.


    How about Debug4x? To compress the library, create a file named
    MyProjectName_Cmprs.h and put it in like so:

    E FSelevBox
    E FreesecBox
    E GeoSetup
    E GeodGridtoGrndInvBox
    E GeodGridtoLatLongBox
    ...
    and so on.

    From the debug4x help file:

    Compression of Output Files

    What Happens
    After a project is built, Debug4x can automatically use BZ compression
    to shrink the size of the project on the calculator. How much
    compression is achieved varies greatly from project to project. Inform
    Boxes using the newer IfMain (HP-49) style entries are already partly
    compressed and will benefit the least.

    Check Compress Project on the Project Data Tab
    When this box is checked, Debug4x will look for the
    ProjectName_Cmprs.h compression header file. The ProjectName_Cmprs.h
    lists commands to cause the various compression options to be used.

    No Breakpoints in Compressed Files
    Compressed files cannot be debugged with breakpoints. Debug4x will
    not be able to find the project on the calculator. The project can be
    loaded but it cannot be debugged. It is a simple matter to uncheck the
    Compress Project box to debug. Once fixed the project can be rebuilt
    with compression on. The ProjectName_Cmprs.h file does not have to
    change, only the check mark has to be unchecked to turn off
    compression.

    ProjectName_Cmprs.h File

    Once compression has been selected on the Project Data tab, the
    projectName_Cmprs.h file tells Debug4x what to compress and how to
    build the compressed verbs.

    The file consists of comments and commands.

    Comments
    Comments lines start with an asterisk * in column 1. The rest of the
    line will be ignored. Blank lines will also be treated as comments.

    Commands
    Compression commands have a command in column 1, followed by a space
    and then the name of the entry name to be compressed. For example:

    * This is a sample of a _Cmprs.h file. This line is a comment
    E xDemo anything after the name can be a comment also
    E InfDemo

    would cause the above two items from the Demo (see ..\Program Files
    \Hewlett-Packard\Debug4x\Examples\Demo) library to be compressed using
    the Eval option. A list of possible names can always be copied from
    the ProjectName_def.h file built for all libraries.

    Command Options
    The compression command options are one of the following:

    E: Compress the object. When a reference is made to the object's
    name, the object will be uncompressed and then EVALuated. This is the
    most common type of command. Use this option for executable programs.
    U: Compress the object. When a reference is made to the object's
    name, the object will be Uncompressed only. Your code must then decide
    what else should be done. Use this option for data. The E option often
    works for data as well but be warned, an E for a list { ... } will
    break the list down into its components! This is what happens when you
    EVAL a list.
    S: Compress the object. This is called Simple compression. When a
    reference is made to the object's name, the object will be left on the
    stack in compressed form. Your code must then decide what else should
    be done. Your code is responsible for uncompressing the object.
    N: Do not compress this object. This entry is really not required.
    By default, unlisted objects will not be compressed. Use the N option
    when you wish to experiment and change one of the entries so it is no
    longer compressed.
    space: A space in column 1 does the same thing as the N command
    above.


    Compression for Simple (not libraries) Projects
    Simple projects can also be compressed. The ProjectName_Cmprs.h file
    has a single entry. The first command option in column 1 will be
    applied to the project. An entry name is not required and it will be
    ignored if listed.

    > One last comment : the current target system is HP48 S/G, so i cannot
    > use HP49 specific library compression tools.


    Debug4x builds BZ strings. You just need to use the S option so you
    get the compressed string and not a 49 specific decompressor call
    which is put in with U or E.

    TW


  7. Re: Using Debug4x for large projects

    Thanks for this detailed information on compression with Debug4x, TW.

    I'm unsure however if this can work for HP48, because the "compress
    project" checkbox is unselectable (greyed) when selecting an HP48
    target.
    Therefore, it seems the ProjectName_Cmprs.h File will never be used...

  8. Re: Using Debug4x for large projects

    hello,

    > 1) Source Code is not currently unified, using different set of
    > mnemonics and/or comments convention.
    > So I would need first to rewrite every little bit before
    > considering this possibility.
    > Including ressources, which means Large Grobs, for which Debug4x
    > is not so nice.
    > Quite some work, will cost many weeks.


    you can use the INCLOB command that includes a binary file in a source as
    in:
    ASSEMBLE
    INCLOB asm
    END
    this will make a quick job of including your ressources...


    regards, cyrille



  9. Re: Using Debug4x for large projects

    Thanks for the tip, Cyrille

  10. Re: Using Debug4x for large projects

    Small Additionnal Question :

    It may sound ridiculous, but I have not found any way up to now
    to write long string over several lines
    using Debug4x Editor.

    I believe this is a limitation of RPLCOMP,
    but i could not find any way to get around it (for example an Escape
    sequence)

    Now i understand that a CR/LF in the editor does not translate into
    NewLine on the target,
    i use \n for that.
    but at least this would allow to have some readable text directly in
    the source code
    instead of loading them separately.

    Is that a known limitation, or is there any way to get around it ?

    Regards

  11. Re: Using Debug4x for large projects

    Hello Yann,

    > It may sound ridiculous, but I have not found any way up to now
    > to write long string over several lines
    > using Debug4x Editor.

    If it is a string you can ignore any given error, it will compile
    fine. But you can not edit it in the editor of debug4x, use Notepad in
    this case.

    If it is compiled source code that you want to include you can use
    NIBHEX anywhere you want inside you ML-Program and you can even have
    your own code before or after, this is an example of a complete
    compiled binary ML-Code inside your RPL-code:

    ASSEMBLE
    CON(5) =DOCODE
    * Size-Field = 5 Nibbles
    REL(5) EndOfYourCodeObject
    *
    12345678911234567892123456789312345678941234567895 123456789612345678971234567898
    NIBHEX opcode representation of you binray, maximum of 80 characters
    NIBHEX opcode representation of you binray, maximum of 80 characters
    EndOfYourCodeObject
    RPL

    It is also possible to use binary ML-code inside a ML program.

    HTH,
    Andreas

  12. Re: Using Debug4x for large projects

    Hello Andreas

    Yes, it is just a text string,
    but of course included within an RPL code.

    I've got a simple code to illustrate :

    ::
    " Single Line "
    " Line Number 1
    Line Number 2 "
    ;

    I tried as you propose to "ignore error", but the result is not
    correct.
    When testing the resulting program, i've got as output
    " Single Line "
    "Undefined"
    "Undefined"
    <2h>


  13. Re: Using Debug4x for large projects

    Hello Yann,

    no, that wont work. The whole string has to be on one line. If you
    need a line break use \0A

    For example, this string is in one line but it is too long for
    debug4x, yet it will compile fine but you wont be able to get to the
    end of the string in the editor (I do not get any errors anymore with
    the current version but IIRC there used to be an error message if the
    string is to long.):

    "Hypothesentest einer einzelnen Stichprobe fr den Bestands-
    \0Amittelwert mit bekannter Bestandsvarianz oder bei groen
    Stichproben mit unbekannter Bestandsvarianz. H0: = 0\0A
    \0ABeispieldatensatz:\0AEine Zufallsstichprobe von 50 Nummern von 0
    bis 1 die mit einem Taschenrechner ermittelt wurde hat einen
    Mittelwert von 0,461368. Fr den Bestand sollte sich folgendes
    ergeben: = 0,5 und = 0,2887.\0A\0ABerechnung:\0AEs wird
    angenommen, da die Standardabweichung des Bestandes 0,2887 ist. Die
    Nullhypothese wird mit H0: = 0,5 gegen die Alternativhypothese H1:
    < 0,5 bei der der Mittelwert unter 0,5 ist getestet. Eine statistische
    Sicherheit von 95 %, d. h. = 0,05, ergibt folgendes Ergebnis:\0Ap >
    0,05. Da der P-Wert > ist wird die Nullhypothese angenommen. Es gibt
    keinen hinreichenden Anhaltspunkt, da der Taschenrechner unkorrekt
    funktioniert."

    Otherwise, just post your example ;-)
    HTH,
    Andreas



  14. Re: Using Debug4x for large projects

    Thanks Andreas; i think i get the idea

    btw, \0A seems equivalent to \n in your example


  15. Re: Using Debug4x for large projects


    > btw, \0A seems equivalent to \n in your example

    I do not what \n stands for but \0A is the newline character.

    Best wishes,
    Andreas


+ Reply to Thread