summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/cmake_language
diff options
context:
space:
mode:
authorBraulio Valdivielso Martinez <bvaldivielso@bloomberg.net>2022-02-04 17:19:32 (GMT)
committerBraulio Valdivielso Martinez <bvaldivielso@bloomberg.net>2022-02-07 21:03:22 (GMT)
commita41d6e4d7a264954bebd6c1c45475647da60e14c (patch)
treec080acd8e9a85ae4b43387ae2ec9f380bf6af382 /Tests/RunCMake/cmake_language
parentca4bb89f276e244b5b56d1988cd659d30df1ca5a (diff)
downloadCMake-a41d6e4d7a264954bebd6c1c45475647da60e14c.zip
CMake-a41d6e4d7a264954bebd6c1c45475647da60e14c.tar.gz
CMake-a41d6e4d7a264954bebd6c1c45475647da60e14c.tar.bz2
Trace: add global_frame field to json-v1 format
Tools using the json-v1 format might want to trace stack frames across different `CMakeLists.txt` files, in order to, for example, provide stacktraces that span from the top-level `CMakeLists.txt` in a project. One would think that `frame` lets you do that, but it doesn't, because it tells you the depth of the stack within the current `CMakeLists.txt`, so it gets reset across calls to `add_subdirectory`. The solution involves adding a field with a "global frame". This value gets incremented on calls to `add_subdirectory`, which makes it easier for tools to reconstruct "global stacktraces". I considered changing the current "frame" value, but I didn't because it would be a breaking change. I cannot think of any use-case where "frame" is more useful to "global-frame", but maybe I'm missing something.
Diffstat (limited to 'Tests/RunCMake/cmake_language')
-rw-r--r--Tests/RunCMake/cmake_language/defer_call_trace_json-stderr.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/Tests/RunCMake/cmake_language/defer_call_trace_json-stderr.txt b/Tests/RunCMake/cmake_language/defer_call_trace_json-stderr.txt
index 647beb0..3bde16d 100644
--- a/Tests/RunCMake/cmake_language/defer_call_trace_json-stderr.txt
+++ b/Tests/RunCMake/cmake_language/defer_call_trace_json-stderr.txt
@@ -1,5 +1,5 @@
-{"args":\["DEFER","CALL","message","Deferred Message"\],"cmd":"cmake_language","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":2,"line":2,"time":[0-9.]+}
-{"args":\["Immediate Message"\],"cmd":"message","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":2,"line":3,"time":[0-9.]+}
+{"args":\["DEFER","CALL","message","Deferred Message"\],"cmd":"cmake_language","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":2,"global_frame":2,"line":2,"time":[0-9.]+}
+{"args":\["Immediate Message"\],"cmd":"message","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":2,"global_frame":2,"line":3,"time":[0-9.]+}
Immediate Message
-{"args":\["Deferred Message"],"cmd":"message","defer":"__0","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":1,"line":2,"time":[0-9.]+}
+{"args":\["Deferred Message"],"cmd":"message","defer":"__0","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":1,"global_frame":1,"line":2,"time":[0-9.]+}
Deferred Message$