C-STAT 내부 데이터베이스의 형식에 대한 설명
기술노트 210218
아키텍처:
All
컴포넌트:
general
업데이트:
2021-05-25 오전 2:46
소개
C-STAT는 영구 데이터를 SQLite3
데이터베이스에 저장합니다. 예를 들어, 이 데이터베이스는 icstat.exe
를 실행하는 대신 직접 질의될 수 있고, IAR Embedded Workbench를 사용하여 이전 분석에 대한 메시지를 추출할 수 있다.
본 기술 노트는 데이터베이스의 메시지 혹은 숨긴 정보에 직접적으로 접근을 할 경우에 연관되는 일부 데이터베이스 테이블에 대해 설명합니다.
Disclaimer
- The descriptions are for C-STAT version 2.1.0.
- This format is subject to change in future versions of C-STAT
논의
Internally in C-STAT messages are called warnings and checks are called properties. Unless explicitly stated, all fields have type string
.
내부적으로 C-STAT 메시지는 경고(warnings)라고 하고, checks는 속성(properties)이라고 합니다. 명시적으로 지정하지 않으면 모든 필드는 문자열(string)
타입을 가집니다.
TABLE warnings
일반적인 메시지를 나타내는 테이블은 다음과 같습니다:
Column | Description |
warning_id (integer) |
Unique numbering that increments for each found message. |
warning_hash |
Unique hash of each message. |
property_id |
Internal id for the check(s). |
property_alias |
Name of the check(s). Multiple identical checks are separated by commas. |
file_name |
Absolute path of the file where the message was found. |
src_name |
Absolute path of the source file that was analyzed when the message was found. |
fn_hash |
Unique hash of the function (or global scope) where the message was found. |
line_id |
Internal information mapping the message to a node in the Abstract Syntax Tree (AST). |
implied_id |
Internal information mapping the message to a node in the AST. |
line_num |
Line number of the message. |
iar_seq |
Sequential line number of the message. Basically, the line number a message would have if all includes were added in a single file. Used for message suppression. |
msg |
The informational output of a message. |
encoded_trace |
Trace information (if any). |
full_trace |
Not used. |
severity |
Severity of the message - Low , Medium or High . |
column_num |
Column number of the message. |
TABLE link_warnings
링크 경고를 나타내는 테이블은 link_warnings 테이블에 저장되고 warnings 테이블과 같은 컬럼(columns)을 가집니다.
참고 : link_warnings 테이블 안의 정보는 삭제되고, 모든 링크 분석을 실행하는 와중에 재생성됩니다. 그러면 메세지의 순서가 달라질 수 있습니다.
TABLE warnings_meta
warnings_meta 테이블은 숨겨진 메시지의 정보를 담고 있습니다.
Column | Description |
warning_hash |
Hash of the message. Matches the hash in the warnings or link_warnings table. |
meta_key |
Always status . |
meta_value |
Always 1 . |
TABLE suppression_directives
이 테이블은 숨김 주석 and/or pragma 지시자가 프로젝트에 명시되어 있는 모든 위치에 대한 정보를 담고 있다.
Column | Description |
suppress_id (integer) |
Unique id of the directive that increments for each found directive. |
property_id |
Name of the check used in the directive. |
iar_seq_start |
Starting sequential line number of the directive. Correlates to the |
iar_seq_end |
Final sequential line number of the directive. Correlates to the iar_seq number in the warnings and link_warnings tables. |
col_start |
Not used. Always 0 (zero). |
col_end |
Not used. Always 0 (zero). |
line |
Line number of the file where the directive is located. |
file |
File where the directive is located. |
src |
Source file that was analyzed when the directive was found. |
만약 지시어가 헤더 파일에 위치한다면 해당 지시어를 포함하는 각 소스파일에 대해 하나의 진입으로 테이블에서 여러 번 발생할 수 있다.
맺음말
C-STAT 메시지와 숨긴 정보는 C-STAT의 내부 데이터베이스에서 직접 검색될 수 있다.