Set environment variables for debugging
Is your feature request related to a problem? Please describe. Yes, it is not possible to set environment variables for a binary to debug.
Describe the solution you'd like Add an option in the debug section of preferences to set env variables something like this (taken from codeblocks).

This should probably done using rarun2/e dbg.profile files. In that case it should be an interface for managing and editing all(except ones that conflict with rest of UI) dbg.profile properties not just environment variables. It should be also possible to select existing handwritten rarun2 file.
Good idea! Thank you <3
I agree with Karliss, this can - and maybe should - be part in a bigger solution of modifying dbg.profile
This should probably done using rarun2/e dbg.profile files. In that case it should be an interface for managing and editing all(except ones that conflict with rest of UI) dbg.profile properties not just environment variables. It should be also possible to select existing handwritten rarun2 file.
I would be happy with a small embedded editor for that config file, I only need to switch a specific envvar for testing a binary. Thanks for your soon response.
In case you need a solution that works right now looks like setting e dbg.profile=/path/to/rarun_profile.rr2 in the console widget works. Didn't test with all the features but at least setting environment variable works.
You can unset env vars too with rarun2
On 14 Apr 2020, at 19:59, karliss [email protected] wrote:
In case you need a solution that works right now looks like setting e dbg.profile=/path/to/rarun_profile.rr2 in the console widget works. Didn't test with all the features but at least setting environment variable works.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
related:
in gdb, shims (wrapper scripts) can be debugged by debugging the interpreter with catch exec
/usr/bin/env bash /path/to/wrapper.sh
https://developers.redhat.com/articles/2022/12/27/debugging-binaries-invoked-scripts-gdb
ideally the debugger should also work on such wrappers
#! /usr/bin/env bash
export X=1
exec /path/to/some_binary
such wrapper scripts are common on nixos linux
~~related to #2052~~
It was supposed to be related to #3199