epasveer / seer

Seer - a gui frontend to gdb
GNU General Public License v3.0
2.11k stars 67 forks source link

Support the use of environment variables for settings #139

Closed Joebeazelman closed 1 year ago

Joebeazelman commented 1 year ago

It's common for a debugging target to reference settings stored in environment variables such as its GDB toolchain path. While such values can be manually evaluated and entered in Seer's settings, it would save a lot of effort if it supported environment variables directly.

epasveer commented 1 year ago

Hi,

I'm not clear yet with your request. Can you give a couple real examples of the environment variables you are talking about.

THanks.

Joebeazelman commented 1 year ago

Basically, it would be nice to enter environment variables such as $(GDB_PATH) into the configuration dialog fields.

epasveer commented 1 year ago

Hi,

To confirm, to allow environment variables when specifying the path to the gdb executable. Something like this?

image

There are some paths in the "Source" tab that can benefit as well. I suspect, though, that you're suggesting any field might benefit from environment variables.

If a $XXXX something can't be expanded, there should be an error dialog.

I think this is all do-able.

Joebeazelman commented 1 year ago

Exactly! This would be excellent, since some tools have special toolpaths.

epasveer commented 1 year ago

I just pushed a change to the "main" branch that you can clone. I've only added support for environment variables for the name of the gdb program and to the gdb arguments.

For example, if I set these environment variables:

$ export GDBHOME=/usr/bin
$ export GDBMI='mi'
$ seergdb -s myprog one two three

The config dialog can work with:

image

I support both ways of expanding environment variables.

${HOME}
$HOME

But not this way. I've only seen that in Makefile. Unless its a MacOS thing.

$(HOME)

Anyway, clone the latest, when you are able, and let me know what you think.

Thanks.

Joebeazelman commented 1 year ago

I mentioned this in another issue, but I'll repeat it here. The configuration dialog doesn't save the settings. Typing it over is a bit tedious.

epasveer commented 1 year ago

After changing the settings, you can save the settings with "Settings -> Save Configuration".

I did it this way because you may want to debug something with the new settings to try out. If the new settings work, they can be saved. If not, they can be forgotten just by quitting out of Seer.

epasveer commented 1 year ago

Hi Joe. Can this task be closed?

Joebeazelman commented 1 year ago

Yes.

epasveer commented 1 year ago

Thanks. Closing task.