DynamoRIO / DynamoRIO/dynamorio
move drcov2lcov file format abstraction violation parsing into drcovlib
- Dominant language
- C
- Stars
- 3.2k
- Forks
- 629
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 31
Description
Today the drcov file format is not formally defined and the particular strings
used are hardcoded in multiple places. This was made worse by #1829's
refactoring into the drcovlib extension.
For example, version_print() in drcovlib.c has:
```
dr_fprintf(log, "DRCOV VERSION: %d\n", DRCOV_VERSION);
dr_fprintf(log, "DRCOV FLAVOR: %s\n", DRCOV_FLAVOR);
```
With the string and precise format duplicated in read_file_header() in drcov2lcov.cpp:
```
if (dr_sscanf(buf, "DRCOV VERSION: %u\n", &version) != 1) {
```
There are similar duplicated strings in other parts of the file.
The cleanest solution would be to add new API routines to drcovlib:
- read header, return ver + flavor
- read module table: iterator?
- read bb data: iterator?
Contributor guide
Assessment
This issue has not been assessed yet.