This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

assembly code debugging

I found if I set breakpoints in assembly code, the DS-5 debugger is not trapped there on omap3530 beagleboard. In addition, it doesn't step in assembly codes, if assembly codes are in a static/dynamic libs.

Parents
  • >>
    If assembly code is in application, I can set bp and stop there. But if it is in a static lib, it doesn't stop.
    <<

    That's quite odd; I would expect code in a static lib to behave essentially the same way a application code. Perhaps the static lib code is not actually making it into the link (e.g. duplicate symbols), or perhaps the execution isn't actually reaching the code.

    How are you setting the static lib breakpoint? From a source view? From a Disassembly view? Using the Command line?

    Can you post the break command from the Commands view and the output of 'info breakpoints' after setting the static lib breakpoint?

    >>
    But no stack frames displays, I can not see who is caller. Any idea of how to solve the issue?
    <<
    If your assembly code is being assembled by gas then I think the answer may be to use .cfi_* directives to produce appropriate .debug_frame information for your function. Unfortunately, I don't know enough to be sure or to explain in more detail.

    If you know the assembly code and can find the saved value of lr (maybe it's still in lr) then you can target a Disassembly view at the saved value and see the caller. If the caller has frame info you could try to see the caller's stack frame by putting the saved value of lr back into pc and restoring sp to what it was in the caller.

Reply
  • >>
    If assembly code is in application, I can set bp and stop there. But if it is in a static lib, it doesn't stop.
    <<

    That's quite odd; I would expect code in a static lib to behave essentially the same way a application code. Perhaps the static lib code is not actually making it into the link (e.g. duplicate symbols), or perhaps the execution isn't actually reaching the code.

    How are you setting the static lib breakpoint? From a source view? From a Disassembly view? Using the Command line?

    Can you post the break command from the Commands view and the output of 'info breakpoints' after setting the static lib breakpoint?

    >>
    But no stack frames displays, I can not see who is caller. Any idea of how to solve the issue?
    <<
    If your assembly code is being assembled by gas then I think the answer may be to use .cfi_* directives to produce appropriate .debug_frame information for your function. Unfortunately, I don't know enough to be sure or to explain in more detail.

    If you know the assembly code and can find the saved value of lr (maybe it's still in lr) then you can target a Disassembly view at the saved value and see the caller. If the caller has frame info you could try to see the caller's stack frame by putting the saved value of lr back into pc and restoring sp to what it was in the caller.

Children