execute shell script before debug

Sysprogs forums Forums VisualGDB execute shell script before debug

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #741
    sch_vitaliy
    Participant

    Hi!
    I need to execute shell script on linux remote mashine before debug to set environment. How can i do this?

    #2950
    support
    Keymaster

    If you want to set the environment variables to some static values, simply select “Use a custom GDB executable” on the Debug Settings page in VisualGDB Project Properties and specify the environment variables there.
    If you want to do some computations and set the variables based on those, create an executable shell script (e.g. run-gdb.sh) that will set the necessary variables and then invoke gdb with the command line arguments passed to the script, e.g.:

    export A=B
    gdb $@

    Then specify the location of that script file in the “GDB Debugger Executable” field in custom GDB settings editor.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.