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.

  • I haven't seen the problems you describe about missing breakpoints. What version of DS-5 are you using? (The build number is in the release notes.) What version does 'gdbserver --version' say?

    Where there any messages in the Command view?

    There are two basic stepping modes in DS-5: by source and by instruction. There is a button in the Debug Control view that chooses between the two modes. To step by assembly instruction for code that doesn't have debug info loaded you'll need to use "by instruction" mode.

    In addition, the default behavior of "step into" when there is no debug info for the callee depends on a setting see 'help set step-mode'.

    Breakpoints in shared libraries (dynamic libraries) may be "pending" until the debugger is notified that the shared library is loaded (see 'info shared').

  • Select the menu Window -> Preferences, and in the filter box at the top type "browser". This will locate you the preference where you can configure which web browser is used.

  • >>
    I tried to consult step-mode by search and click, but ...
    <<

    I'm sorry, I'm not sure I understand how you did the search. Were you using search in Eclipse's help? That works for me -- the information shows up inside Eclipse. I also use Firefox (but have IE installed, too.)

    You can also find the latest DS-5 docs at <infocenter.arm.com/.../index.html

    What platform are you using (Windows or Linux)? What build of DS-5 are you using?

    >>
    Another issue is when pointer is in assembly code, there is no stack display.
    <<

    Without the .debug_frame part of the debug information, the debugger does not have enough information to display the stack frames.

  • I tried to consult step-mode by search and click, but it pops up "Could not open a Web browser because there are none configured. Check the web browser preference". I use firefox. Which one should be set?
    Another issue is when pointer is in assembly code, there is no stack display.

  • I used the same compiling options for c and assembly codes as follows in Linux environment.
    ccache arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -DHAVE_AV_CONFIG_H -Wundef -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99 -O0 -fno-omit-frame-pointer -ggdb3 -funit-at-a-time

    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. I got an issue when I play a video file, it hangs in assembly code (NEON code). This problem happens at some point in a video file. When application got stuck, it stops in assembly code. But no stack frames displays, I can not see who is caller. Any idea of how to solve the issue? This is a trial version, build id is 20100218-1602

  • The version of the trial that you are using is quite old, and it is worth mentioning that a newer version of the trial was recently released. The download has moved to ARM's website, and you will need to register (free):

    silver.arm.com/.../DS5TR

  • >>
    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.

  • I downloaded a new version. But I found the register panel is blank. Is this function disabled?

  • >>
    I downloaded a new version. But I found the register panel is blank. Is this function disabled?
    <<

    No, the Registers view should work (when you are connected).

    Is the Command view working? What output does 'info reg' produce?

    What OS and version is your host running?

  • There are messages on Command view, but info reg doesn't work, nothing displays. I use Fedora 12.

  • I tried arm-angstrom-linux-gnueabi-as -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp on new DS-5
    there are still no stack frames, no registers, and register and frame commands have no response on command view window.

  • The top of the stack is determined by the SP register, so the lack of stack frames is probably to do with the lack of registers.

    I would recommend that you check the version of gdbserver that you are using. We recommend using version 6.8, and a copy of 6.8 gdbserver binaries is included with the product in the following directory:

    <installation_directory>/arm/armv5t/gdbserver

    You can try using this gdbserver to see if this solves the lack of registers.

    Another suggestion is to quit Eclipse, delete the following directory and restart Eclipse:

    %APPDATA%\ARM\DS-5\configdb (on Windows)
    $HOME/.ds-5/configbd (on Linux)

    Finally, a new release of DS-5 was recently made available on Mon 9th Aug which you might like to try. You can download it from:

    silver.arm.com/.../DS5TR

    Please let us know if any of these help to resolve your register problems.

  • I tried gdbserver 6.8 and deleted $HOME/.ds-5/configbd. But no joy. I tried to download new release, it doesn't download.
    Another issue is after I enter assembly codes, step out doesn't work, here is error message.

    ERROR(CMD440-CMD354-COR61):
    ! Stepping failed
    ! Unable to step out of the current function
    ! Cannot step out, no stack unwind data to determine return address

  • The lack of stack unwind data can be fixed by adding -fno-omit-frame-pointer to your gcc compiler options, and then rebuilding your image.

  • I am sorry, my last reply about -fno-omit-frame-pointer is incorrect. For assembly code it is probably necessary to add additional directives to the code to specify the start and end of functions, but I do not know the correct syntax for this.

    For the download problem, I tried the Windows build and it was Ok. When I downloaded the Linux build I found it had what looks like the wrong file extension, which may cause errors when you try to extract it. The Linux build downloaded for me as:

    DS5TR-BN-00001-r5p0-03rel0.tgz.tar

    And it can be extracted using:

    gtar -zxvf DS5TR-BN-00001-r5p0-03rel0.tgz.tar