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

got error to set a break point in a shared lib.

When I try to set a break point in a shared library in DS-5 debugger, I got error as following,

ERROR(CMD440-CMD354-TAD8-NAL79):
! Stepping failed
! Unable to step out of the current function
! Unable to run device 1
! Failed to enable software breakpoints. Remote GDB returned error code 0x01

Parents
  • When I enter a function in a shared lib. At the beginning, the indicator would jump back, then everything looks normal. I think I use correct lib. The lib is loaded successfully. If I set breakpoint in the lib, but indicator is not in it yet, those messages will come up.

    Another problem is I can load the first shared lib successfully, but subsequent libs give errors although I use a script.

    add-symbol-file "../libavformat.so.52.55.0" 0x0
    ERROR(CMD16-COR97):
    ! Failed to load image "libavformat.so.52.55.0"
    ! Range 0x0000D2F4..0x0000D307 overlaps with range 0x0000D22C..0x0000D8B3 currently in map
    add-symbol-file "../libavutil.so.50.12.0" 0x0
    ERROR(CMD16-COR97):
    ! Failed to load image "libavutil.so.50.12.0"
    ! Range 0x000075FC..0x0000886F overlaps with range 0x00008148..0x00008167 currently in map

    set start-at main
    start
    ..
    source /v "/home/tang/Project/workspace/script"

Reply
  • When I enter a function in a shared lib. At the beginning, the indicator would jump back, then everything looks normal. I think I use correct lib. The lib is loaded successfully. If I set breakpoint in the lib, but indicator is not in it yet, those messages will come up.

    Another problem is I can load the first shared lib successfully, but subsequent libs give errors although I use a script.

    add-symbol-file "../libavformat.so.52.55.0" 0x0
    ERROR(CMD16-COR97):
    ! Failed to load image "libavformat.so.52.55.0"
    ! Range 0x0000D2F4..0x0000D307 overlaps with range 0x0000D22C..0x0000D8B3 currently in map
    add-symbol-file "../libavutil.so.50.12.0" 0x0
    ERROR(CMD16-COR97):
    ! Failed to load image "libavutil.so.50.12.0"
    ! Range 0x000075FC..0x0000886F overlaps with range 0x00008148..0x00008167 currently in map

    set start-at main
    start
    ..
    source /v "/home/tang/Project/workspace/script"

Children
  • Ah, this might be the cause of the breakpoint problems too. The "add-symbol-file" command currently requires an offset, which is the address where the shared library is located in memory. It is unlikely that your shared libraries are located at address 0x0, but determining the correct offset is not very easy. If you specify 0x0 for all of these, then not only is the location wrong but you will get overlap errors when doing this with multiple libraries.

    We are intending to improve the "add-symbol-file" command in a future release to not require an offset when loading a shared library and to work this out automatically.

    What you can do in the meantime is to use the "set so-lib-search-path" option to point at the directory on your computer containing the shared libraries, and once the libraries have been loaded by your application you can then issue the "sharedlibrary" command to load the debug symbols. Since it looks like you are already using a script file, I would recommend that you put these commands in your script so that you can easily re-run them each time you debug your application.

    A similar problem and solution are described in the following knowledgebase article:

    http://www.keil.com/support/docs/3489.htm