[GDB] Cannot execute this command while the selected thread is running

Former Member
Former Member

こんにちは。うっちーです。

GCCでメイクしたelfファイルをRX Simulatorを使ってデバッグしようとしています。e2studio上では正常にデバッグできますが、コマンドラインの e2-server-gdb + rx-elf-gdb で、実行("C"コマンド)すると、「Cannot execute this command while the selected thread is running」が表示されて、実行できません。
何かご存じの方は教えていただけないでしょうか?

ツールチェイン: GCC for Renesas RX
デバイス: R5F51403AxFM

よろしくお願いいたします。

  • うっちー さん、こんにちは。NoMaYと申します。

    以下のコマンド群で試してみてエラー無く実行出来るようになりませんでしょうか?

    RX Simulator環境でコマンドラインからプロジェクトを実行する
    japan.renesasrulz.com/cafe_rene/f/forum5/7608/rx-simulator/40131#40131
    ↑より、rx-elf-gdbの起動後の操作から、実行するだけの場合向けに、必要な箇所を抜粋(portはそちらに合わせて下さい)↓

    set pagination off
    set non-stop on
    target extended-remote-rx localhost:60916
    monitor enable_stopped_notify_on_connect
    monitor enable_execute_on_connect
    # wait for a notification
    load

    c

     
    最近Atom IDEとかVisual Studio Codeとか新しい開発環境が出て来てますね(Renesas CSplusと連携させる方法を探したいですね)
    japan.renesasrulz.com/cafe_rene/f/forum21/4553/atom-ide-visual-studio-code-renesas-csplus/40706#40706
    ↑のvscode_helper_files_rx_20211227.zipより、インタラクティブにデバッグもする場合向けに、取り出し↓

    .vscode/.scripts/gdb_setup.gdbと.vscode/.scripts/gdb_custom_launch_setup.gdbと.vscode/launch.jsonを切り貼り
    (portはそちらに合わせて下さい)

    set breakpoint pending on
    set detach-on-fork on
    enable pretty-printing
    set python print-stack none
    set print object on
    set print sevenbit-strings on
    set host-charset UTF-8
    #set target-charset WINDOWS-31J # Because this charset does not exist.
    set target-wide-charset UTF-16
    set target-async on
    set pagination off
    set non-stop on
    set auto-solib-add on
    set step-mode off
    set breakpoint always-inserted on
    inferior 1
    set remotetimeout 10
    set tcp connect-timeout 30
    # For Visual Studio (i.e. not for Visual Studio Code)
    alias logout=quit

    target extended-remote-rx localhost:60916

    monitor enable_stopped_notify_on_connect
    monitor enable_execute_on_connect
    load
    monitor reset

    c

     

  • Former Member
    Former Member in reply to NoMaY

    NoMaYさん。ありがとうございます。

    (gdb) monitor enable_stopped_notify_on_connect

    を実行した直後に以下のようなメッセージが出てしまいます。

    (gdb) set pagination off
    (gdb) set non-stop on
    (gdb) target extended-remote-rx localhost:60916
    Remote debugging using localhost:60916
    (gdb) monitor enable_stopped_notify_on_connect
    (gdb) warning: while parsing target memory map (at line 6): Required element <memory> is missing

    Program received signal SIGINT, Interrupt.
    0x00000000 in ?? ()

    無視して、コマンドを続けると実行できるようですが、問題ないでしょうか?

  • うっちー さん、こんにちは。NoMaYです。

    > (gdb) warning: while parsing target memory map (at line 6): Required element <memory> is missing

    しばらく単体rx-elf-gdbの起動に注意を払っていませんでしたので、そういうメッセージが表示されるようになっていたことに気付きませんでした。影響は分からないです。ただ、以下のスレッドのように i mem とコマンド入力をした時に何が表示されるか、知りたいと思いました。(以下のスレッドではe2 studioのデバッガコンソールから入力していますが、rx-elf-gdbのプロンプトから入力すると?、ということです。)

    SDRAM領域に割り付けられた変数が確認できない
    japan.renesasrulz.com/cafe_rene/f/forum5/7606/sdram/40105#40105

    [関連リンク]

    ファームウェアのロードに失敗する。【デュアルバンク】【RX72N】
    japan.renesasrulz.com/cafe_rene/f/forum5/7269/rx72n/38781#38781
     

  • Former Member
    Former Member in reply to NoMaY

    NoMaYさん、こんにちは。

    "i mem"コマンドを入力したら、以下のようになりました。

    (gdb) monitor enable_stopped_notify_on_connect
    (gdb) warning: while parsing target memory map (at line 6): Required element <memory> is missing

    Program received signal SIGINT, Interrupt.
    0x00000000 in ?? ()
    monitor enable_execute_on_connect
    (gdb) # wait for a notification
    (gdb) load
    Loading section .text, size 0x5c1a lma 0xffff0000
    Loading section .rvectors, size 0x400 lma 0xffff5c1c
    Loading section .rodata, size 0x2a4 lma 0xffff601c
    Loading section .data, size 0x844 lma 0xffff62c0
    Loading section .exvectors, size 0x7c lma 0xffffff80
    Loading section .fvectors, size 0x4 lma 0xfffffffc
    Start address 0xffff0000, load size 27522
    Transfer rate: 866 KB/sec, 2117 bytes/write.
    (gdb) i mem
    Using memory regions provided by the target.
    There are no memory regions defined.
    (gdb)

    よろしくお願いいたします。

  • うっちー さん、こんにちは。NoMaYです。

    > Using memory regions provided by the target.

    ワーニングメッセージの印象ですと、何かe2-server-gdbとrx-elf-gdbの間でやりとりされている内部情報に関して齟齬があったのかな、という感じですが、ちょっと詳細まで分からなさそうですね。

    そうなると、この状況ですと、自分なら何か問題が出るまでそのまま使ってみる、問題が起きても mem コマンドで何とか対処出来るだろう、という方向で行くかな、と思うのです。

  • Former Member
    Former Member in reply to NoMaY

    NoMaYさん、こんにちは。

    ワーニングの詳細はわからないけど、とりあえず使ってみるということにします。

    それから、VS Codeについては、時間があるときに試してみたいと思います。

    ありがとうございました。