最近Atom IDEとかVisual Studio Codeとか新しい開発環境が出て来てますね(Renesas CSplusと連携させる方法を探したいですね)

最近、Atom IDE(まだC/C++サポートは無い模様)とかVisual Studio Code(C/C++サポートのプレビュー版は有る模様)とか、新しい開発環境が出て来ていますね。ルネサスCS+と連携させる方法を探してみたいですね。

Google検索: Atom IDE site:マイナビニュース
www.google.co.jp/search?q=Atom+IDE+site%3Anews.mynavi.jp

Google検索: Visual Studio Code site:マイナビニュース
www.google.co.jp/search?q=Visual+Studio+Code+site%3Anews.mynavi.jp

[リンク]

C/C++ for VS Code (Preview)
code.visualstudio.com/docs/languages/cpp

[案(当面)]

・ ビルドはCS+のコマンドラインモードを使用する
・ ビルドエラーメッセージパーサはVisual Studio Codeのソースを改造する
・ もちろんCS+のコマンドラインモードでビルドした.absファイルはCS+のGUIモードでデバッグ可能
・ e² studio同梱のrenesas_cc_converter.exeでCC-RXやCC-RLの.absファイルをGDBで読める.xファイルに変換可能
・ e² studio同梱のe2-server-gdb.exeでGDBとE1/E2Lite等を接続可能
・ Visual Studio CodeはGDBと接続可能(任意のGDBと接続可能かは分からないが少なくともARM GDBとは接続可能な模様)

[案(将来)]

・ Visual Studio CodeをルネサスCS+と接続出来れば、、、(出来ればGDBを介さずに、、、)
・ Visual Studio CodeをルネサスCS+のmtpjファイル内のソース情報が読めるように改造出来れば、、、

Parents
  • こんにちは。NoMaYです。

    先日の投稿にURLを書いた記事には、VSCode内でコマンドライン版RFPを起動&書き込み出来るようにするやり方も書かれていましたが、それはひとまず後回しにして、それから、ビルドにリビルドやクリーンを追加することとかエラーパーサー(VSCodeではProblemMatcherと呼ぶらしい)を追加することとかも後回しにして、次は以下のあたりでしょうかね、、、(うまくいくかどうかは分からないですけれども、、、)

    Google検索: VSCode gdb OpenOCD
    www.google.com/search?q=VSCode+gdb+OpenOCD

    Google検索: VSCode gdb gdbserver
    www.google.com/search?q=VSCode+gdb+gdbserver
     

  • こんにちは。NoMaYです。

    まだVSCode外で幾らか下準備が必要ですが、ひとまずrx-elf-gdb.exeとe2-server-gdb.exeを使用して、VSCode上で以下の画面コピーのようにデバッグが出来るようになりました。今のところVSCodeの設定ファイルの内容は以下の通りです。これからVSCode外の下準備を減らせるよう試行錯誤してみます。







    .vscode/launch.json

    {
        // IntelliSense を使用して利用可能な属性を学べます。
        // 既存の属性の説明をホバーして表示します。
        // 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "name": "(rx-elf-gdb) 起動",
                "type": "cppdbg",
                "request": "launch",
                "program": "${workspaceFolder}/HardwareDebug/TestProgRun.x",
                "args": [],
                "stopAtEntry": false,
                "cwd": "${workspaceRoot}",
                "externalConsole": false,
                "MIMode": "gdb",
                "miDebuggerPath": "C:\\Renesas\\e2studio64\\SupportFiles\\.eclipse\\com.renesas.platform_1643561029\\DebugComp\\RX\\rx-elf-gdb.exe",
                "miDebuggerArgs": "--silent -rx-force-isa=v3 -rx-force-double-fpu",
                "setupCommands": [
                    {
                        "text": "-gdb-set pagination off"
                    },
                    {
                        "text": "-gdb-set non-stop on",
                    },
                    {
                        "text": "-target-select extended-remote-rx localhost:60916",
                    },
                    {
                        "text": "-interpreter-exec console \"monitor enable_stopped_notify_on_connect\"",
                    },
                    {
                        "text": "-interpreter-exec console \"monitor enable_execute_on_connect\"",
                    },
                    {
                        "text": "-file-exec-and-symbols C:/Renesas/GitHubDesktop/workspaces/work_csplus/TestProgRun/HardwareDebug/TestProgRun.x",
                    },
                    {
                        "text": "-target-download",
                    },
                    {
                        "text": "-interpreter-exec console \"monitor reset\"",
                    }
                ]
            }
        ]
    }

     

  • こんにちは。NoMaYです。

    VSCodeの設定ファイルを修正して、rx-elf-gdb.exeだけでなくてe2-server-gdb.exeもVSCode内で起動&実行させるようにしてみました。これで、VSCode外で必要な下準備は、rx-elf-gdb.exeがPython 2.7を必要とすることによる、PathとPYTHONPATHの2つの環境変数設定だけで済むようになりました。(なお、今のところ、Renesas RX Simulatorで試しています。) そこで、まだ、rx-elf-gdb.exeやe2-server-gdb.exeの設定がミニマム過ぎである点とかVSCodeの設定ファイルの作成を簡素化出来ないものかとか(CS+のPythonコンソールのIronPythonスクリプトで生成させてみるとか?)といった件はありますが、それは後回しにして、週末にエラーパーサーについて調べてみたいと思います。

    以下、デバッグ開始時のVSCodeの画面コピーとVSCodeの設定ファイルの内容と環境変数設定に関しての情報です。



    .vscode/launch.json

    {
        // IntelliSense を使用して利用可能な属性を学べます。
        // 既存の属性の説明をホバーして表示します。
        // 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
        // NoMaYメモ VSCode C/C++起動設定: https://code.visualstudio.com/docs/cpp/launch-json-reference
        // NoMaYメモ GDB/MIコマンド:       https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html
        "version": "0.2.0",
        "configurations": [
            {
                "name": "(rx-elf-gdb) 起動",
                "type": "cppdbg",
                "request": "launch",
                "program": "C:/Renesas/GitHubDesktop/workspaces/work_csplus/TestProgRun/HardwareDebug/TestProgRun.x",
                "args": [],
                "cwd": "${fileDirname}",
                "environment": [],
                "externalConsole": false,
                "targetArchitecture": "x86",
                "debugServerPath": "C:/Renesas/e2studio64/SupportFiles/.eclipse/com.renesas.platform_1643561029/DebugComp/RX/e2-server-gdb.exe",
                "debugServerArgs": "-p 60916 -g SIMULATOR -t R5F572NN -uPeripheralClkRatio= 4 -uCpuClkFreq= 240 -uRegisterSetting= 0 -uModePin= 0 -uCacheDecode= 1 -uIOModule= IodllForCMT.dll -uIOModule= IodllForICU_dpfpu.dll -n 0 -uWorkRamAddress= 0 -uEmStopInt= 0 -uEmStopInterrupt= 0 -uEmStopFPexp= 0 -l -uCore= SINGLE_CORE|enabled|1|main -uSyncMode= async -uFirstGDB= main",
                "serverStarted": "GDB: ",
                "MIMode": "gdb",
                "miDebuggerPath": "C:/Renesas/e2studio64/SupportFiles/.eclipse/com.renesas.platform_1643561029/DebugComp/RX/rx-elf-gdb.exe",
                "miDebuggerArgs": "--silent -rx-force-isa=v3 -rx-force-double-fpu",
                "stopAtEntry": true,
                "stopAtConnect": true,
                "setupCommands": [
                    {
                        "text": "-gdb-set pagination off"
                    },
                    {
                        "text": "-gdb-set non-stop on",
                    },
                ],
                "customLaunchSetupCommands": [
                    {
                        "text": "-target-select extended-remote-rx localhost:60916",
                    },
                    {
                        "text": "-interpreter-exec console \"monitor enable_stopped_notify_on_connect\"",
                    },
                    {
                        "text": "-interpreter-exec console \"monitor enable_execute_on_connect\"",
                    },
                    {
                        "text": "-file-exec-and-symbols C:/Renesas/GitHubDesktop/workspaces/work_csplus/TestProgRun/HardwareDebug/TestProgRun.x",
                    },
                    {
                        "text": "-target-download",
                    },
                    {
                        "text": "-interpreter-exec console \"monitor reset\"",
                    },
                ],
                "logging": {
                    "exceptions": true,
                    "moduleLoad": false,
                    "programOutput": true,
                    "engineLogging": false,
                    "trace": false,
                    "traceResponse": false,
                },
            }
        ]
    }

     

    Path          C:\Renesas\e2studio64_v202110\eclipse\runtimes\python\2.7.12_x86
    PYTHONPATH    C:\Renesas\e2studio64_v202110\eclipse\runtimes\python\2.7.12_x86\lib

     

  • こんにちは。NoMaYです。

    VSCodeのCC-RX対応エラーパーサを取り敢えず書いて動かしてみました。(CC-RL/RHでも同じ記述が使えると思います。) ただ、VSCodeの設定ファイルのドキュメントに目を通してみましたが、CC-RX/RL/RHとVSCodeを素朴に組み合わせただけでは重大度(エラー/ワーニング/インフォメーション)を扱うことが出来ないっポイです。何とかならないかな、と思いを巡らせていて、ひとつ思い浮かんだのは、PowerShellスクリプトで(コンソール版CS+経由の)CC-RX/RL/RHのメッセージを一度マイクロソフトコンパイラ互換のメッセージフォーマットに変換してはどうか、という案でした。それを、この後、試してみるつもりです、、、

    VSCodeの設定ファイルのエラーパーサのドキュメント
    code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher

    以下、試したエラーパーサの記述です。

                "problemMatcher": {
                    "owner": "cpp",
                    "fileLocation": ["relative", "${workspaceFolder}"],
                    "pattern": {
                        "regexp": "^(.*)\\((\\d+)\\):(.*):(.*)$",
                        "file": 1,
                        "line": 2,
                        "code": 3,
                        "message": 4
                    }
                }

     
    以下、VSCodeの画面コピーです。

    問題ウィンドウの表示


    CC-RXのもともとのメッセージ


    設定ファイルの内容

     

  • こんにちは。NoMaYです。

    以下のPowerShellスクリプトを使用してVSCodeでCC-RX/RL/RHの重大度(エラー/ワーニング/インフォメーション)を扱えるようにしてみました。リンカメッセージに関する調査/検討は後回しにして、次はIntelliSense回りを調べてみます。

    .vscode/build_wrapper.ps1

    # Related links
    # https://docs.microsoft.com/powershell/scripting/overview
    # https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_regular_expressions
    # https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comparison_operators

    filter msgconv_Renesas_MS
    {
        # Remove some progress and status messages from CubeSuite+.exe
        $_ = $_ -replace '^P:\[Notice\]$', ''
        $_ = $_ -replace '^  \(\d+%\).* \.\.\.$', ''
        $_ = $_ -replace '^\[(Error|Warning|Information)\].*', ''

        # file(line):Ccode:message --> file(line): error Ccode: message
        # file(line):Ecode:message --> file(line): error Ecode: message
        # file(line):Fcode:message --> file(line): error Fcode: message
        $_ = $_ -replace '^(.*)\((\d+)\):([CEF]\d+):(.*)$', '$1($2): error $3: $4'

        # file(line):Wcode:message --> file(line): warning Wcode: message
        $_ = $_ -replace '^(.*)\((\d+)\):(W\d+):(.*)$', '$1($2): warning $3: $4'

        # file(line):Mcode:message --> file(line): info Mcode: message
        $_ = $_ -replace '^(.*)\((\d+)\):(M\d+):(.*)$', '$1($2): info $3: $4'

        # Show converted message
        if ( $_ -ne '' )
        {
            return $_
        }
    }

    echo "========== Start console version CS+($(Get-Date)) =========="
    C:\Renesas\CS+\CC\CubeSuite+.exe $Args | msgconv_Renesas_MS

     
    以下、VSCodeの画面コピーです。




    [関連リンク]

    PowerShell とは
    docs.microsoft.com/powershell/scripting/overview

    正規表現について
    docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_regular_expressions

    比較演算子について
    docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comparison_operators

    [追記]

    【連載】PowerShell Core入門 - 基本コマンドの使い方
    著者:後藤大地
    目次
    news.mynavi.jp/itsearch/series/devsoft/powershell_core_-.html
     

  • こんにちは。NoMaYです。

    CC-RX/RL/RHでコンパイルされることを前提としたソースコードとVSCodeのIntelliSenseとの辻褄合わせを試行錯誤する前に少し場合分けを考えてみました。当面は以下の青字のケースのみ調べてみるつもりです。

    CC-RX

    (RX-1) ソフトウェア開発フレームワーク無し or 下記以外のソフトウェア開発フレームワーク
    (RX-2) ソフトウェア開発フレームワークにPDG2を使用
    (RX-3) ソフトウェア開発フレームワークに旧CGを使用
    (RX-4) ソフトウェア開発フレームワークにRXスマートコンフィグレータ(BSP+新CG+FIT)を使用

    CC-RL

    (RL78-1) ソフトウェア開発フレームワーク無し or 下記以外のソフトウェア開発フレームワーク
    (RL78-2) ソフトウェア開発フレームワークに旧CGを使用
    (RL78-3) ソフトウェア開発フレームワークにRL78スマートコンフィグレータ(BSP+新CG)を使用

    CC-RH

    (RH850-1) ソフトウェア開発フレームワーク無し or 下記以外のソフトウェア開発フレームワーク
    (RH850-2) ソフトウェア開発フレームワークに旧CGを使用
    (RH850-3) ソフトウェア開発フレームワークにRH850スマートコンフィグレータ(BSP+新CG)を使用

    あと、かふぇルネではVSCodeのIntelliSenseについて今までにも(最近リプライあり)以下のスレッドがありました。

    VSCode上での#pragma packエラーを黙らせる良い方法は?
    japan.renesasrulz.com/cafe_rene/f/forum21/6615/vscode-pragma-pack/38783#38783
     

  • こんにちは。NoMaYです。

    前の投稿に書いたスレッドで最近アドバイスされていた、強制インクルードするヘッダファイルを作成する方法で、CC-RXでコンパイルされることを前提としたソースコードとVSCodeのIntelliSenseとの辻褄合わせをしてみました。以下の画面コピーの後半にCC-RXのヘルプの拡張言語仕様の項目から関係する部分を抜き出してみましたが、以下のヘッダファイルは概ね充分な内容かとは思うのですけど、細かいことを言うと、CC-RXで事前定義されているマクロ定義はもっと沢山ありますし、予約語に関しても今回こんなものがあったのかと実は始めて知ったものもあります。(そういうところは後回しにしました、、、もしかすると放置するかも、、、) 次は、RXスマートコンフィグレータ(というか本来はFIT)のBSPモジュールのr_rx_compiler.hというヘッダファイル内のCC-RX/GNURX/ICCRXの相互間でインラインアセンブラ関数記述を共通化するマクロにe2 studioのINDEXER/CODANがエラーを表示しないようにする小細工が入っていますので、その辺りをIntelliSense対応にしてみます。

    以下、VSCodeの画面コピーとVSCodeの設定ファイルとVSCodeで強制インクルードするヘッダファイルの内容です。

    内蔵周辺I/Oレジスタに対してもコーディングアシストされます (e2 studioも出来ますが、CS+は出来ません、、、)


    ./.vscode/c_cpp_intellisense_helper.h

    2438.c_cpp_intellisense_helper.h.20211109_2.txt
    #ifndef C_CPP_INTELLISENSE_HELPER_H
    #define C_CPP_INTELLISENSE_HELPER_H
    
    #ifdef __INTELLISENSE__
    
    /*
    Tips to make IntelliSense work with code written for Renesas CC-RX compiler
    */
    
    /*
    4.2.1 Macro Names
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRX.chm/Output/ccrx04c0201y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/csp/V8.06.00/CS+.chm/Compiler-CCRX.chm/Output/ccrx04c0201y.html
    */
    #define __CCRX__ 1
    #define __RX 1
     #define __LIT 1
    // #define __BIG 1
     #define __FPU 1
    // #define __RXV1 1
    // #define __RXV2 1
    #define __RXV3 1
    #define __TFU 1
    #define __DPFPU 1
    
    /*
    4.2.2 Keywords
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRX.chm/Output/ccrx04c0202y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/csp/V8.06.00/CS+.chm/Compiler-CCRX.chm/Output/ccrx04c0202y.html
    */
    #pragma diag_suppress 661
    #define __evenaccess
    
    /*
    4.2.6 Intrinsic Functions
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRX.chm/Output/ccrx04c0206y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/V8.06.00/CS+.chm/Compiler-CCRX.chm/Output/ccrx04c0206y.html
    */
    #include "builtin.h"
    
    /*
    4.2.7 Section Address Operators
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRX.chm/Output/ccrx04c0207y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/csp/V8.06.00/CS+.chm/Compiler-CCRX.chm/Output/ccrx04c0207y.html
    */
    #define __sectop( secname )  ( ( void * ) 0U )
    #define __secend( secname )  ( ( void * ) 0U )
    #define __secsize( secname ) (0UL)
    
    #endif /* __INTELLISENSE__ */
    
    #endif /* C_CPP_INTELLISENSE_HELPER_H */
    

     
    ./.vscode/c_cpp_properties.json

    c_cpp_properties.json.20211109.txt
    {
        "configurations": [
            {
                "name": "CC-RX",
                "includePath": [
                    "C:/Renesas/CS+/CC/CC-RX/V3.03.00/include",
                    "${workspaceFolder}/**"
                ],
                "defines": [
                ],
                "compilerPath": "",
                "cStandard": "c99",
                "cppStandard": "c++17",
                "intelliSenseMode": "windows-msvc-x86",
                "forcedInclude": [
                    "./.vscode/c_cpp_intellisense_helper.h"
                ]
            }
        ],
        "version": 4
    }

     
    以下、CC-RXのヘルプの拡張言語仕様の項目の関係する部分の画面コピーです。







     

  • こんにちは。NoMaYです。

    RXスマートコンフィグレータ(というか本来はFIT)のBSPモジュールのr_rx_compiler.hというヘッダファイル内にはCC-RX/GNURX/ICCRXの相互間でインラインアセンブラ関数記述を共通化するマクロがあるのですけれども、そこにe2 studioのINDEXER/CODANがエラーを表示しないようにする小細工が入っているので、その辺りもIntelliSense対応にしてみました。

    もっとも、以下のそのR_BSP_ASM○○○というマクロは、上記3コンパイラ対応にソースを書くという目的が無いと面倒の方が多いというのは確かにありますので、単にインラインアセンブラ関数記述部でIntelliSenseがエラーを表示するのが気になるぐらいであるなら、#ifndef __INTELLISENSE__ ~ #endif で括るだけというのが手軽です。なお、__INTELLISENSE__ は、VSCodeのIntelliSense動作に関してだけ、VSCodeが自前で定義してくれるようです。

    src/smc_gen/r_bsp/mcu/all/r_rx_compiler.h    (青字の部分を追加)

    /* ---------- Inline Expansion of Assembly-Language Function (part2) ---------- */
    #if defined(__CDT_PARSER__) || defined(__INTELLISENSE__)

    #define R_BSP_ASM(...)            /* none */
    #define R_BSP_ASM_LAB_NEXT(n)     /* none */
    #define R_BSP_ASM_LAB_PREV(n)     /* none */
    #define R_BSP_ASM_LAB(n_colon)    /* none */
    #define R_BSP_ASM_BEGIN           /* none */
    #define R_BSP_ASM_END             /* none */

    #else

    #if defined(__CCRX__)



    #elif defined(__GNUC__)



    #elif defined(__ICCRX__)



    #endif

    #endif /* defined(__CDT_PARSER__) || defined(__INTELLISENSE__) */

     
    以下、VSCodeの画面コピーです。

    r_rx_compiler.h対処前はインラインアセンブラ関数記述部でIntelliSenseがエラーを表示してしまう


    r_rx_compiler.h対処後はエラーは表示されない (残っているメッセージはワーニングレベルを上げた時のCC-RXによるもの)


    r_rx_compiler.hのフォルダツリー上の場所


    [追記]

    あらら、VSCodeが認識しているコンパイルメッセージでは右端部分が切れてしまってますね、、、VSCodeのバグ?

    以下、VSCodeの画面コピーです。

    Parameter "loop_cnt" was never referenced の referenced の文字列がVSCodeに認識されてない

     

  • こんにちは。NoMaYです。

    CC-RLでコンパイルされることを前提としたソースコードとVSCodeのIntelliSenseとの辻褄合わせをしてみました。以下の画面コピーの後半にCC-RLのヘルプの拡張言語仕様の項目から関係する部分を抜き出してみましたが、以下のヘッダファイルは概ね充分な内容かとは思うのですけど、細かいことを言うと、CC-RLで事前定義されているマクロ定義はもっと沢山あります。(そういうところは後回しにしました、、、もしかすると放置するかも、、、)

    以下、VSCodeの画面コピーとVSCodeの設定ファイルとVSCodeで強制インクルードするヘッダファイルの内容です。

    内蔵周辺I/Oレジスタに対してもコーディングアシストされます(e2 studioも出来ますが、CS+は出来ません、、、)


    ./.vscode/c_cpp_intellisense_helper.h

    c_cpp_intellisense_helper.h.20211110.txt
    #ifndef C_CPP_INTELLISENSE_HELPER_H
    #define C_CPP_INTELLISENSE_HELPER_H
    
    #ifdef __INTELLISENSE__
    
    /*
    Tips to make IntelliSense work with code written for Renesas CC-RL compiler
    */
    
    /*
    4.2.2 Macro
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0202y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0202y.html
    */
    #define __CCRL__ 1
    
    /*
    4.2.1 Reserved words
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0201y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0201y.html
    */
    #define __saddr
    #define __callt
    #define __near
    #define __far
    #define __sectop( secname )  ( ( void * ) 0U )
    #define __secend( secname )  ( ( void * ) 0U )
     
    /*
    4.2.4 #pragma directive
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0204y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0204y.html
    */
    #pragma diag_suppress 661
    
    /*
    4.2.7 Intrinsic functions
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0207y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0207y.html
    */
    #include "builtin.h"
    
    #endif /* __INTELLISENSE__ */
    
    #endif /* C_CPP_INTELLISENSE_HELPER_H */
    

     
    ./.vscode/c_cpp_properties.json

    c_cpp_properties.json.20211110.txt
    {
        "configurations": [
            {
                "name": "CC-RL",
                "includePath": [
                    "C:/Renesas/CS+/CC/CC-RL/V1.10.00/inc",
                    "${workspaceFolder}/**"
                ],
                "defines": [
                ],
                "compilerPath": "",
                "cStandard": "c99",
                "cppStandard": "c++17",
                "intelliSenseMode": "windows-msvc-x86",
                "forcedInclude": [
                    "./.vscode/c_cpp_intellisense_helper.h"
                ]
            }
        ],
        "version": 4
    }

     
    以下、CC-RLのヘルプの拡張言語仕様の項目の関係する部分の画面コピーです。








    [追記]

    VSCodeのIntelliSenseは2進定数を認識しますね。

    以下、VSCodeの画面コピーです。


     

Reply
  • こんにちは。NoMaYです。

    CC-RLでコンパイルされることを前提としたソースコードとVSCodeのIntelliSenseとの辻褄合わせをしてみました。以下の画面コピーの後半にCC-RLのヘルプの拡張言語仕様の項目から関係する部分を抜き出してみましたが、以下のヘッダファイルは概ね充分な内容かとは思うのですけど、細かいことを言うと、CC-RLで事前定義されているマクロ定義はもっと沢山あります。(そういうところは後回しにしました、、、もしかすると放置するかも、、、)

    以下、VSCodeの画面コピーとVSCodeの設定ファイルとVSCodeで強制インクルードするヘッダファイルの内容です。

    内蔵周辺I/Oレジスタに対してもコーディングアシストされます(e2 studioも出来ますが、CS+は出来ません、、、)


    ./.vscode/c_cpp_intellisense_helper.h

    c_cpp_intellisense_helper.h.20211110.txt
    #ifndef C_CPP_INTELLISENSE_HELPER_H
    #define C_CPP_INTELLISENSE_HELPER_H
    
    #ifdef __INTELLISENSE__
    
    /*
    Tips to make IntelliSense work with code written for Renesas CC-RL compiler
    */
    
    /*
    4.2.2 Macro
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0202y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0202y.html
    */
    #define __CCRL__ 1
    
    /*
    4.2.1 Reserved words
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0201y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0201y.html
    */
    #define __saddr
    #define __callt
    #define __near
    #define __far
    #define __sectop( secname )  ( ( void * ) 0U )
    #define __secend( secname )  ( ( void * ) 0U )
     
    /*
    4.2.4 #pragma directive
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0204y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0204y.html
    */
    #pragma diag_suppress 661
    
    /*
    4.2.7 Intrinsic functions
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0207y.html
    http://tool-support.renesas.com/autoupdate/support/onlinehelp/ja-JP/csp/V8.06.00/CS+.chm/Compiler-CCRL.chm/Output/ccrl04c0207y.html
    */
    #include "builtin.h"
    
    #endif /* __INTELLISENSE__ */
    
    #endif /* C_CPP_INTELLISENSE_HELPER_H */
    

     
    ./.vscode/c_cpp_properties.json

    c_cpp_properties.json.20211110.txt
    {
        "configurations": [
            {
                "name": "CC-RL",
                "includePath": [
                    "C:/Renesas/CS+/CC/CC-RL/V1.10.00/inc",
                    "${workspaceFolder}/**"
                ],
                "defines": [
                ],
                "compilerPath": "",
                "cStandard": "c99",
                "cppStandard": "c++17",
                "intelliSenseMode": "windows-msvc-x86",
                "forcedInclude": [
                    "./.vscode/c_cpp_intellisense_helper.h"
                ]
            }
        ],
        "version": 4
    }

     
    以下、CC-RLのヘルプの拡張言語仕様の項目の関係する部分の画面コピーです。








    [追記]

    VSCodeのIntelliSenseは2進定数を認識しますね。

    以下、VSCodeの画面コピーです。


     

Children
No Data