diag_dump_*

Michael Bergandi <[email protected]>
Newsgroups gmane.os.ecos.devel
Message-ID <CAOHvnTNK2=UV6XRmhBF=v+M05Amuq+X-VGEZgOJYjoy+w8mgzA@mail.gmail.com>
Hi all,

I have been poking around looking at the diag_dump_* routines in
infra/current/src/diag.cxx and I see the following test in
diag_vdump_buf_with_offset() that makes me wonder what the intent was:

diag_vdump_buf_with_offset(__printf_fun *pf,
                           cyg_uint8     *p,
                           CYG_ADDRWORD   s,
                           cyg_uint8     *base)
{
    int i, c;
    if ((CYG_ADDRWORD)s > (CYG_ADDRWORD)p) {
        s = (CYG_ADDRWORD)s - (CYG_ADDRWORD)p;
    }

My understanding of the parameters are:

pf = pointer to function to use to print
p = pointer to buffer that you want to print
s = size (number of bytes to print)
base = base address to use for printing the addresses

I hope this is right. I can't find any documentation that actually
says what these parameters are. There is no documentation for the
function in diag.cxx, diag.hxx, or the reference manual.

So, the test above doesn't make much sense based on what I understand
the parameters to be.

If I stretch my brain a bit, it looks like 's' is being treated as a
pointer in the test and not a size or length value. Is this right or
what is intended?

-- 
Mike
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.