This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How can I programmatically find LOG_printf's trace$buf address

Hello:

We are implementing reading the DSP_BIOS logs without JTAG as mentioned here.

http://processors.wiki.ti.com/index.php/Accessing_DSP_BIOS_logs_without_JTAG

We would like to find the address of the buffers (i.e., trace$buf and my own LOG_Obj) from the running program without needing to look into the map file.

Any ideas how to do this?  

I can do (LOG_Obj*) trace in the watch window and see all of the structure members,

(LOG_Obj*)trace 0x858997CC struct LOG_Obj * hex Edited
bufend 0x00000000 Arg * hex NotEdited
flag 0 Uns unsigned NotEdited
seqnum 0 Uns unsigned NotEdited
curptr 0x85890000 LOG_Event * hex NotEdited
lenmask 16383 Uns unsigned NotEdited
bufbeg 0x85890000 LOG_Event * hex NotEdited

However,

(LOG_Obj*)trace.bufbeg gives "cannot access member of rvalue"

(LOG_Obj*)trace->bufbeg gives "cannot access member of non-structure"

--B

  • This looks like the same issue I had in this thread:

    Watch Window having trouble understanding structure data types

    Are you trying to do this in your code or in the watch window?  There's some confusion in the watch window due to the way these variables are defined by BIOS (lots of detail in the post referenced above).

    In the bios generated header file you'll see something like:

    extern far LOG_Obj trace;

    Then in log.h you can find the definition of a LOG_Obj:

    typedef struct LOG_Obj {
        Arg* bufend;
        Uns flag;
        Uns seqnum;
        LOG_Event* curptr;
        Uns lenmask;
        LOG_Event* bufbeg;
    } LOG_Obj;

    In your code you should do something like:

    trace.bufbeg

    In the watch window you can do something like this:

    (LOG_Obj*)_trace

    Then you should be able to expand by clicking the plus sign to see bufbeg, etc.

    Brad

  • To the first part of your question - are you writing a script to analyze the data? Are you trying to do a symbol lookup from a script?

     

     

  • I am doing this in code.  (i.e., making an address MAP for the host)

    trace.bufbeg works perfectly.   I got confused because I first tried using CCS to figure out what fields I would need and ran into the problem that is discussed in detail in the link. 

    Okay, before I close this out,  Is LOG_system always written to?  Even when compiled with no debug, with optimizations etc. 

  • LOG_system is written to by default.

    You can disable this in the CCS tooling via the RTA control panel.

    You can also disable this in your application with the following line:

    TRC_disable(TRC_LOGSWI | TRC_LOGPRD | TRC_LOGTSK | TRC_LOGCLK);