Recently https://reviews.llvm.org/D88103 introduced a nice API for converting a JSON object into C++ types, which include nice error messaging. I'm using that new functioniality to perform the parsing in a much more elegant way. As a result, the code looks simpler and more maintainable, as we aren't parsing anymore individual fields manually. I updated the test cases accordingly. Differential Revision: https://reviews.llvm.org/D88264
33 lines
561 B
JSON
33 lines
561 B
JSON
{
|
|
"trace": {
|
|
"type": "intel-pt",
|
|
"pt_cpu": {
|
|
"vendor": "intel",
|
|
"family": 6,
|
|
"model": 79,
|
|
"stepping": 1
|
|
}
|
|
},
|
|
"processes": [
|
|
{
|
|
"pid": 1234,
|
|
"triple": "x86_64-*-linux",
|
|
"threads": [
|
|
{
|
|
"tid": 5678,
|
|
"traceFile": "3842849.trace"
|
|
}
|
|
],
|
|
"modules": [
|
|
{
|
|
"file": "a.out",
|
|
"systemPath": "a.out",
|
|
"loadAddress": 400000,
|
|
"uuid": "6AA9A4E2-6F28-2F33-377D-59FECE874C71-5B41261A"
|
|
}
|
|
]
|
|
},
|
|
{}
|
|
]
|
|
}
|