Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312422 - Gdb 7.1 does not take the environment correctly
Summary: Gdb 7.1 does not take the environment correctly
Status: RESOLVED NOT_ECLIPSE
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 0 DD 1.1   Edit
Hardware: PC Windows 7
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-11 09:29 EDT by Rudolf Hornig CLA
Modified: 2010-08-05 13:25 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rudolf Hornig CLA 2010-05-11 09:29:50 EDT
Build Identifier: 3.5.2

When using gdb 7.1 (MINGW) (and 7.0 too), when I set an environment variable, it is set by the "set environment VAR VALUE" command but because of a gdb bug the process does not receive the new variable. This causes the debug session to fail if path to required DLLs are set in the process environment (i.e. on the environment tab). This seems to be a gdb bug (http://sourceforge.net/tracker/?func=detail&atid=102435&aid=2994861&group_id=2435) but somehow it should be worked around in CDT too.

Reproducible: Always

Steps to Reproduce:
- Make sure you are using gdb 7.x
- Create a small C project using:

#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("TEST = %s\n", getenv("TEST"));
return 0;
}

Create a lauch configuration and set the TEST environement variable on the Environment tab to "HELLOWORLD"

Run the program. It will display correctly TEST=HELLOWORLD

Now debug with the same configuration. It will print TEST=(null)
Comment 1 Marc Khouzam CLA 2010-05-26 09:47:21 EDT
Another reference to this GDB problem
http://sourceware.org/ml/gdb-patches/2010-05/msg00317.html