klonyyy / STMViewer

Real-time STM32 variable & trace viewer
GNU General Public License v3.0
536 stars 59 forks source link

Allow relative elf file path in cfg file #65

Closed dzid26 closed 1 month ago

dzid26 commented 2 months ago

I wanted to add project file to revision control, but it contains absolute path.

Related: https://github.com/klonyyy/STMViewer/blob/4d22bcdeb6d0a01148aff162177f075b49920258/test/STMViewer_test/STMViewer_project/STMViewer_test.cfg#L2

dzid26 commented 1 month ago

But does it work?

I tried:

[elf]
file_path = .\.pio\build\ServoCAN_release\firmware.elf

or:

[elf]
file_path = .pio\build\ServoCAN_release\firmware.elf

and it fails when updating variable addresses. image

klonyyy commented 1 month ago

Relative means to the place the binary is run from. So you have to make sure the directory you're referring to is in the binary folder, otherwise you have to step out of it using ../ (you can see the example in my commit - I've checked it on both Windows and Ubuntu and it works fine)

dzid26 commented 1 month ago

So this only works for your example.

The path should be relative to cfg file location. Can you reopen the issue?

klonyyy commented 1 month ago

Now I understand what you meant. Please provide a full issue description next time so that we're both on the same page.