Skip to content

Commit 506906d

Browse files
committed
CLI -liPathRelative bool replaced with -liPath string
1 parent e5fb8f8 commit 506906d

25 files changed

+9442
-9444
lines changed

β€Ž_test/testdata/li.json

+2,427-2,427
Large diffs are not rendered by default.

β€Ž_test/testdata/til.json

+44-44
Original file line numberDiff line numberDiff line change
@@ -8780,65 +8780,65 @@
87808780
"Strg": "rpc:FunctionNameYc"
87818781
},
87828782
"15695": {
8783-
"Type": "TRice",
8784-
"Strg": "Hello "
8785-
},
8786-
"15696": {
8787-
"Type": "TRice",
8788-
"Strg": "World!\\n"
8789-
},
8790-
"15697": {
8791-
"Type": "TRice64",
8792-
"Strg": "msg:Twelve 64-bit values: %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\\n"
8793-
},
8794-
"15698": {
8795-
"Type": "trice",
8796-
"Strg": "Hello again\\n"
8797-
},
8798-
"15699": {
87998783
"Type": "trice32F",
88008784
"Strg": "call:FunctionNameYd"
88018785
},
8802-
"15700": {
8786+
"15696": {
88038787
"Type": "TRICE64_F",
88048788
"Strg": "info:FunctionNameZa"
88058789
},
8806-
"15701": {
8790+
"15697": {
88078791
"Type": "TRice64F",
88088792
"Strg": "call:FunctionNameZb"
88098793
},
8810-
"15702": {
8794+
"15698": {
88118795
"Type": "Trice64F",
88128796
"Strg": "RPC:FunctionNameZc"
88138797
},
8814-
"15703": {
8798+
"15699": {
88158799
"Type": "trice64F",
88168800
"Strg": "Rpc:FunctionNameZd"
88178801
},
8818-
"15704": {
8802+
"15700": {
88198803
"Type": "TRice",
88208804
"Strg": "Hello "
88218805
},
8822-
"15705": {
8806+
"15701": {
88238807
"Type": "TRice",
88248808
"Strg": "World!\\n"
88258809
},
8826-
"15706": {
8810+
"15702": {
88278811
"Type": "TRice64",
88288812
"Strg": "msg:Twelve 64-bit values: %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\\n"
88298813
},
8830-
"15707": {
8814+
"15703": {
88318815
"Type": "trice",
88328816
"Strg": "Hello again\\n"
88338817
},
8834-
"15708": {
8818+
"15704": {
88358819
"Type": "TRice8B",
88368820
"Strg": "%3x\\n"
88378821
},
8838-
"15709": {
8822+
"15705": {
88398823
"Type": "TRice8B",
88408824
"Strg": "%3x\\n"
88418825
},
8826+
"15706": {
8827+
"Type": "TRice",
8828+
"Strg": "Hello "
8829+
},
8830+
"15707": {
8831+
"Type": "TRice",
8832+
"Strg": "World!\\n"
8833+
},
8834+
"15708": {
8835+
"Type": "TRice64",
8836+
"Strg": "msg:Twelve 64-bit values: %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\\n"
8837+
},
8838+
"15709": {
8839+
"Type": "trice",
8840+
"Strg": "Hello again\\n"
8841+
},
88428842
"15710": {
88438843
"Type": "TRice",
88448844
"Strg": "WARNING:USARTq OverRun Error Flag is set!\\n"
@@ -8848,29 +8848,29 @@
88488848
"Strg": "rx:received command:%s\\n"
88498849
},
88508850
"15712": {
8851-
"Type": "trice",
8852-
"Strg": "isr:TIM17_FDCAN_IT1_IRQHandler! (%u ms)\\n"
8853-
},
8854-
"15713": {
88558851
"Type": "TRice",
88568852
"Strg": "msg:StartDefaultTask\\n"
88578853
},
8858-
"15714": {
8854+
"15713": {
88598855
"Type": "TRice",
88608856
"Strg": "msg:StartTask02:Diagnostics and TriceTransfer\\n"
88618857
},
8858+
"15714": {
8859+
"Type": "trice",
8860+
"Strg": "isr:TIM17_FDCAN_IT1_IRQHandler! (%u ms)\\n"
8861+
},
88628862
"15715": {
8863+
"Type": "trice8",
8864+
"Strg": "dbg:CONFIGURATION == %d - An example configuration\\n"
8865+
},
8866+
"15716": {
88638867
"Type": "TRice",
88648868
"Strg": "WARNING:USARTq OverRun Error Flag is set!\\n"
88658869
},
8866-
"15716": {
8870+
"15717": {
88678871
"Type": "TRICE_S",
88688872
"Strg": "rx:received command:%s\\n"
88698873
},
8870-
"15717": {
8871-
"Type": "trice8",
8872-
"Strg": "dbg:CONFIGURATION == %d - An example configuration\\n"
8873-
},
88748874
"15718": {
88758875
"Type": "trice8",
88768876
"Strg": "dbg:CONFIGURATION == %d - An example configuration\\n"
@@ -8988,12 +8988,12 @@
89888988
"Strg": "dbg:CONFIGURATION == %d - An example configuration\\n"
89898989
},
89908990
"15747": {
8991-
"Type": "trice8",
8992-
"Strg": "dbg:CONFIGURATION == %d - An example configuration\\n"
8991+
"Type": "TRice",
8992+
"Strg": "msg:StartDefaultTask\\n"
89938993
},
89948994
"15748": {
8995-
"Type": "trice8",
8996-
"Strg": "dbg:CONFIGURATION == %d - An example configuration\\n"
8995+
"Type": "TRice",
8996+
"Strg": "msg:StartTask02:Diagnostics and TriceTransfer\\n"
89978997
},
89988998
"15749": {
89998999
"Type": "trice8",
@@ -9092,12 +9092,12 @@
90929092
"Strg": "dbg:CONFIGURATION == %d - An example configuration\\n"
90939093
},
90949094
"15773": {
9095-
"Type": "TRice",
9096-
"Strg": "msg:StartDefaultTask\\n"
9095+
"Type": "trice8",
9096+
"Strg": "dbg:CONFIGURATION == %d - An example configuration\\n"
90979097
},
90989098
"15774": {
9099-
"Type": "TRice",
9100-
"Strg": "msg:StartTask02:Diagnostics and TriceTransfer\\n"
9099+
"Type": "trice8",
9100+
"Strg": "dbg:CONFIGURATION == %d - An example configuration\\n"
91019101
},
91029102
"15775": {
91039103
"Type": "trice8",

β€Žcmd/trice/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func setupTest(t *testing.T, fSys *afero.Afero) func() {
3838
id.Min = id.TriceID(1000)
3939
id.Max = id.TriceID(7999)
4040
id.SearchMethod = "random"
41-
id.LiPathIsRelative = false
41+
id.LIPathKind = "base"
4242
//id.Srcs ArrayFlag
4343
//id.IDData idData
4444
id.ExtendMacrosWithParamCount = false

β€Ždocs/TriceUserManual.md

+1
Original file line numberDiff line numberDiff line change
@@ -1894,6 +1894,7 @@ The 14-bit IDs are used to display the log strings. These IDs are pointing in tw
18941894
* If the generated `li.json` is available, the Trice tool automatically displays file name and line number. But that is accurate only with the exact matching firmware version. That usually is the case right after compiling and of most interest at the developers table.
18951895
* The Trice tool will silently not display location information, if the `li.json` file is not found. For in-field logging, the option `-showID "inf:%5d"` could be used. This allows later an easy location of the relevant source code.
18961896
* An other option is to record the binary trice messages (`trice log -p com1 -blf aFileName`) and to play them later with the Trice tool using the correct `li.json` (`trice log -p FILEBUFFER -args aFileName` ).
1897+
* The user has the possibility to change the default kind of the location information path. Normally it is "base" and just the source code file names, containing Trice macros occur inside the _li.json_ file. That is sufficient as long there are no files with identical names on different places possibly containing identical Trices. Then it is not guarantied that the same IDs are always assigned. For such cases "relative" or "full" is selectable for the location information path kind (CLI -liPath). But both have weaknesses: The "full" path can differ between different machines and "relative" can difer between different projects on the same PC. Again: we-cache -liPath full are talking here about identical Trice maessges in files with identical names and the worst happening is that these "exchange" their IDs between `trice insert && trice clean && trice insert`. When using the Trice cache even less inconsistencies are expected.
18971898

18981899
<p align="right">(<a href="#top">back to top</a>)</p>
18991900

β€Žexamples/F030_inst/build.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ for arg in "$@"; do
99
done
1010

1111
# Trice is called here and not within make, to guarantee, it is finished before any other job starts.
12-
trice clean -cache -liPathIsRelative -src ../../_test/testdata -src ../exampleData -src ./Core # Run this first to trigger the used editor to show the Trice IDs cleaned state.
13-
trice insert -cache -liPathIsRelative -src ../../_test/testdata -src ../exampleData -src ./Core -IDMin 16200 -IDMax 16383 -IDMethod upward # Add project data.
12+
trice clean -cache -liPath full -src ../../_test/testdata -src ../exampleData -src ./Core # Run this first to trigger the used editor to show the Trice IDs cleaned state.
13+
trice insert -cache -liPath full -src ../../_test/testdata -src ../exampleData -src ./Core -IDMin 16200 -IDMax 16383 -IDMethod upward # Add project data.
1414

1515
case "$OSTYPE" in
1616
darwin*) make -j $(sysctl -n hw.ncpu) TRICE_FLAGS="$flags" -f OS_Darwin.mak ;;
@@ -22,4 +22,4 @@ case "$OSTYPE" in
2222
bsd*) echo "BSD not implemented" ;;
2323
esac
2424

25-
trice clean -cache -liPathIsRelative -src ../../_test/testdata -src ../exampleData -src ./Core # Run this again to get the Trice IDs cleaned state.
25+
trice clean -cache -liPath full -src ../../_test/testdata -src ../exampleData -src ./Core # Run this again to get the Trice IDs cleaned state.

β€Žexamples/F030_inst/clean.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

33
# Calling "make clean" does not remove the Trice IDs from the source code but "clean.sh" will do as well.
4-
trice clean -cache -liPathIsRelative -src ./Core -src ../exampleData -src ../../_test/testdata
4+
trice clean -cache -liPath full -src ./Core -src ../exampleData -src ../../_test/testdata
55
make clean

0 commit comments

Comments
 (0)