Debug array of data Error multiple errors reported

Hi all.

Whenever I have to debug a large bayte array I always get this error. Is it some of my wrong e2studio settings? Every time I have to go see byte by byte (not practical at all).

Thank you

Paolo

  • Hi Paolo,

    How's this issue? What version of e2 studio you're experiencing this trouble? Or Have you been experiencing this problem even with the previous versions?

    JB
    RenesasRulz Forum Moderator

    https://renesasrulz.com/
    https://academy.renesas.com/
    https://en-us.knowledgebase.renesas.com/

  • In reply to JB:

    Hi JB.
    Now e2studio is V.7.8.0, but previous version was some problem.

    Thanks
    Paolo
  • In reply to Paolo Miatto:

    Hello, Paolo.
    What are the error messages exactly? (I can't see it in the screenshot.)

  • In reply to Okra:

    Hi Okra.
    I can't see the exact error because when I try to analyze the message the debugging stops.

    Best Regards
    Paolo
  • In reply to Paolo Miatto:

    You could check GDB trace. See the following FAQ page:
    https://en-support.renesas.com/knowledgeBase/18888647

  • In reply to Paolo Miatto:

    You can see issues like this when trying to view the contents of a local/automatic variable when it is out of scope, reducing the compiler optimisation can sometimes help (e.g Og or O0 for GCC compiler), making the variable global temporarily can also be way to solve the issue. If the debugger crashes while trying to inspect the value of the variable, try turning off "RTOS Integration in Debug view" in the debug settings :-

     

     

  • In reply to Jeremy:

    @Jeremy.
    I try to view global array. I turn off "RTOS Integration in Debug view".
    This is gdb-trace log:

    668,798 (gdb)
    668,798 1697-data-evaluate-expression --thread 1 --frame 0 sizeof(*(((struct_string_out).string)+500\
    )@12)
    668,802 1691^done,value="512"
    668,802 (gdb)
    668,802 1698-var-update 1 var20
    668,917 *running,thread-id="2"
    668,934 1692^error,msg="No memory available to program: call to malloc failed"
    668,935 (gdb)
    668,935 1699-var-update 1 var21
    668,935 1700-var-update 1 var22
    668,935 1701-var-update 1 var24
    668,935 1702-var-update 1 var26
    668,953 1693^error,msg="Remote failure reply: E31\nAn error occurred while in a function called from\
    GDB.\nEvaluation of the expression containing the function\n(malloc) will be abandoned.\nWhen the f\
    unction is done executing, GDB will silently stop."
    668,954 (gdb)
    669,060 *running,thread-id="2"
    669,094 1703-var-update 1 var28
    669,094 1704-data-evaluate-expression --thread 1 --frame 0 struct_string_out
    669,094 1705-stack-info-depth --thread 1 2
    669,124 1694^error,msg="Remote failure reply: E31\nAn error occurred while in a function called from\
    GDB.\nEvaluation of the expression containing the function\n(malloc) will be abandoned.\nWhen the f\
    unction is done executing, GDB will silently stop."
    669,124 (gdb)
    669,231 *running,thread-id="2"
    669,287 1695^error,msg="Remote failure reply: E31\nAn error occurred while in a function called from\
    GDB.\nEvaluation of the expression containing the function\n(malloc) will be abandoned.\nWhen the f\
    unction is done executing, GDB will silently stop."
    669,287 (gdb)
    669,389 *running,thread-id="2"
    669,419 1696^error,msg="Remote failure reply: E31\nAn error occurred while in a function called from\
    GDB.\nEvaluation of the expression containing the function\n(malloc) will be abandoned.\nWhen the f\
    unction is done executing, GDB will silently stop."
    669,420 (gdb)
    669,420 1706-interpreter-exec --thread-group i1 console kill
    669,522 *running,thread-id="2"
    669,572 1697^error,msg="Remote failure reply: E31\nAn error occurred while in a function called from\
    GDB.\nEvaluation of the expression containing the function\n(malloc) will be abandoned.\nWhen the f\
    unction is done executing, GDB will silently stop."

    Thank you
    Paolo
  • In reply to Paolo Miatto:

    In the log you posted above there seems to be a malloc failure on the target :-

    668,934 1692^error,msg="No memory available to program: call to malloc failed"

     

    Most of the time when evaluating C expressions (which reading a variable is) GDB can evaluate the expression itself and sends requests to only to read memory.

    Sometimes the expressions are more complicate for various reasons (like a function call) in which case GDB decides it needs to evaluate the expression on the target, which triggers a couple of changes: a “dummy” function call is push on the stack to execute, the code to be executed is set up (I believe here is where mallocs can occur, as many as GDB needs) this dummy function call is then executed, then “dummy” function is removed from the stack.

    We would need to see the expression and the communication between GDB and GDB server to see what happened and why GDB decided to evaluate something on the target.

    the full GDB trace is possible with “set debug remote 1”,

    1. You can just type it in the “Debugger Console”
    2. Or in the debug configuration (2 choices see below image)

     

     

    How much heap do you have in the Synergy project?

  • In reply to Jeremy:

    gdb.log

    Hi Jeremy.

    In this case I am trying to see a global structure that has a 512 bytes field. I don't know why it doesn't try to read directly.

    The heap size was 4K, I brought it to 8K but it doesn't work (I attach the log).

    The project is C++

     

    Best Regards

    Paolo

  • In reply to Paolo Miatto:

    At line 8 in the log you can see the first command 2285.

    000,907 2285-var-update 1 var29

    While the error comes form command 2284 (which is not part of the log), see line 138:

    001,057 2284^error,msg="No memory available to program: call to malloc failed"

     

    All console windows have limitations in Eclipse, you will need to increase the buffer size so we can get the full trace, I think it’s this one (Window->Preferences->type console):-

     

    Also if you could attach the source code definition of the structure it would be helpful.

  • In reply to Jeremy:

    Hi Jeremy.

    This is the code:

    struct String_out
    {
        uint16_t size;
        uint8_t unit_code;
        uint8_t spare;
        uint8_t string[512];
    };

    String_out struct_string_out;

    Best Regards

    Paolo

  • In reply to Paolo Miatto:

    UPDATE.
    I realized that if I go to see at runtime the value of the variable works. It only messes up if I try to see it when I'm at breakpoint

    Paolo