Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338418

Summary: Launch configuration's Environment tab variables are not passed to the gdb process itself
Product: [Tools] CDT Reporter: Gaetano Santoro <gaetano.santoro>
Component: cdt-debug-cdi-gdbAssignee: Project Inbox <cdt-debug-cdi-gdb-inbox>
Status: CLOSED WONTFIX QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: normal    
Priority: P3 CC: cdtdoug, marc.khouzam, pawel.1.piech
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed patch
none
proposed patch none

Description Gaetano Santoro CLA 2011-02-28 09:45:34 EST
Build Identifier: I20110127-2034

environment variables defined in launch configurations environment tab are not visible by the gdb process. As consequence of this, command/executable launched inside .gdbinit script or other gdb script cannot use the above defined environment variable
this appears only in debug, while works in run mode

Reproducible: Always

Steps to Reproduce:
1. create a simple C hello world project
2. in launch configuration environment tab add a variable, for eg. ZHELLO = CIAO
3. start debug
4. with external tool like sysinternals project explorer check that the environment of gdb process don't have the ZHELLO variable defined
Comment 1 Gaetano Santoro CLA 2011-02-28 09:46:56 EST
Created attachment 189947 [details]
proposed patch

attached my proposed patch
Comment 2 Gaetano Santoro CLA 2011-02-28 11:22:31 EST
Created attachment 189963 [details]
proposed patch

moved code to AbstractCLaunchDelegate so it is available to general class that extend it
Comment 3 Marc Khouzam CLA 2016-04-02 16:18:59 EDT
CDI has been removed so there is no more need for this fix.