# Clarification of 'backtrace' from file-api

**URL:** https://discourse.cmake.org/t/clarification-of-backtrace-from-file-api/2295
**Category:** Code
**Created:** [December 4, 2020, 12:21pm UTC](https://discourse.cmake.org/t/clarification-of-backtrace-from-file-api/2295 "2020-12-04T12:21:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mbee](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@mbee](https://discourse.cmake.org/u/mbee)
#### Post date: [December 4, 2020, 12:21pm UTC](https://discourse.cmake.org/t/clarification-of-backtrace-from-file-api/2295/1 "2020-12-04T12:21:12Z")

</div>

I’m not a beginner in cmake, but up to now have never used the file api or its predecessor, the server mode.

Currently, I am trying to exploit the api and stumbled into the term ‘backtrace’. [The documentation](https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html) states for the first example of a backtrace entry:

> `member that is present when a CMake language backtrace to the command in the source code that created the target is available.`

The remaining entries have similar explanations. What is the meaning of “if is available” here? Is this information from a cmake run in trace mode ( “CMake language backtrace”)? Would it be possible to clarify the relationship (if any) of both terms in the documentation? In any case, some kind of definition for `backtrace` would help.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 4, 2020, 8:38pm UTC](https://discourse.cmake.org/t/clarification-of-backtrace-from-file-api/2295/2 "2020-12-04T20:38:56Z")

</div>

Cc: @kyle.edwards @brad.king

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [December 7, 2020, 2:50pm UTC](https://discourse.cmake.org/t/clarification-of-backtrace-from-file-api/2295/3 "2020-12-07T14:50:43Z")

</div>

The term “backtrace” is very widely used in software to refer to a trace through the the call stack of functions in a program. It tells you where the project’s `CMakeLists.txt` files created whatever the backtrace is attached to.

---

<div class="post-metadata">

### Author: ![mbee](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/50afbb/32.png) [@mbee](https://discourse.cmake.org/u/mbee)
#### Post date: [December 11, 2020, 7:58pm UTC](https://discourse.cmake.org/t/clarification-of-backtrace-from-file-api/2295/4 "2020-12-11T19:58:47Z")

</div>

In the meantime, I have found some example files and this clarified things (it was simpler than I imagined).

Anyway, a related question:

Currently I am exploiting cmakes `--graphviz` output. Would it be possible - or are there any considerations - to mirror this functionality for the query interface? It shouldn’t be too hard considering the yet existing output format as json reply files. Both outputs should probably remain separate, but as a whole would allow for extending this kind of information from cmakes configure into the build domain.
