Description of the format of C-STAT’s internal database

Technical Note 210218

Architectures:

All

Component:

general

Updated:

2021/3/8 7:54

Introduction

C-STAT stores its persistent data in a SQLite3 database. This database can, for example, be queried directly as an alternative to running icstat.exe or using the IAR Embedded Workbench to extract the messages of a previous analysis.

This Technical Note describes some of the database tables that are relevant if you want to access messages or suppression information from the database directly.

Disclaimer

  • The descriptions are for C-STAT version 2.1.0.
  • This format is subject to change in future versions of C-STAT

 

Discussion

Internally in C-STAT messages are called warnings and checks are called properties. Unless explicitly stated, all fields have type string.

TABLE warnings

The table representing the regular messages looks like this:

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

The table representing the link warnings is stored in the link_warnings table and have the same columns as the warnings table.

Note that: The information in the link_warnings table is deleted and repopulated in between every link analysis run, which can make the ordering of the messages differ.

TABLE warnings_meta

The table warnings_meta holds the information on suppressed messages.

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

This table holds the information on all locations where a suppression comment and/or pragma directive is specified in the project.

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 number in the warnings and link_warnings tables.

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.

If a directive is placed in a header file it might occur multiple times in the table, with one entry for each source file that includes it.

Conclusion

C-STAT messages and suppression information can be retrieved directly from C-STAT’s internal database.

很抱歉,该页面尚未翻译成中文。

如果您有任何问题,请联系我们的中国团队

We do no longer support Internet Explorer. To get the best experience of iar.com, we recommend upgrading to a modern browser such as Chrome or Edge.