summaryrefslogtreecommitdiff
path: root/dtc.h
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2018-11-16 17:30:00 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2018-11-19 11:18:12 +1100
commit5667e7ef9a9a30c54a572ae976ed5b65ccf24d8b (patch)
tree8630dfecf55a47dbb87a7f65cef963d301050555 /dtc.h
parent8e20ccf52f90ed7e5ee29f870c7ee8bd0854794c (diff)
downloaddevice-tree-compiler-5667e7ef9a9a30c54a572ae976ed5b65ccf24d8b.tar.gz
annotations: add the annotation functionality
Provide the new command-line option: --annotate (abbreviated -T) --annotate provides one or more filenames and line numbers indicating the origin of a given line. The filename is expressed relative the the filename provided on the command line. Nothing is printed for overlays, etc. -T can be repeated giving more verbose annotations. These consist of one or more tuples of: filename, starting line, starting column, ending line ending column. The full path is given for the file name. Overlays, etc are annotated with <no-file>:<no-line>. The verbose annotations may be too verbose for normal use. There are numerous changes in srcpos.c to provide the relative filenames (variables initial_path, initial_pathlen and initial_cpp, new functions set_initial_path and shorten_to_initial_path, and changes in srcfile_push and srcpos_set_line). The change in srcpos_set_line takes care of the case where cpp is used as a preprocessor. In that case the initial file name is not the one provided on the command line but the one found at the beginnning of the cpp output. shorten_to_initial_path only returns a string if it has some shortening to do. Otherwise it returns NULL and relies on the caller to use the initial string. This simplifies memory management, by making clear to the caller whether a new string is allocated. The new functions srcpos_string_comment, srcpos_string_first, and srcpos_string_last print the annotations. srcpos_string_comment is recursive to print a list of source file positions. Various changes are sprinkled throughout treesource.c to print the annotations. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc.h')
-rw-r--r--dtc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/dtc.h b/dtc.h
index 8722cbc..789e0b1 100644
--- a/dtc.h
+++ b/dtc.h
@@ -58,6 +58,7 @@ extern int phandle_format; /* Use linux,phandle or phandle properties */
extern int generate_symbols; /* generate symbols for nodes with labels */
extern int generate_fixups; /* generate fixups */
extern int auto_label_aliases; /* auto generate labels -> aliases */
+extern int annotate; /* annotate .dts with input source location */
#define PHANDLE_LEGACY 0x1
#define PHANDLE_EPAPR 0x2