Community
Participate
Working Groups
-- Configuration Details -- Product: Eclipse 1.3.1.20100913-1228 (org.eclipse.epp.package.cpp.product) Installed Features: org.eclipse.platform 3.6.1.r361_v20100909-9gF78GrkFqw7GrsZnvz0JWNTeb6fue6896L Platform Windows Vista Home (continuesly updated) Build tools mingw-get-inst-20101030.exe based. Includes MSys, gcc 4.5 (and 3.4 in msys), gdb 7.2 1. Environment variables set in for debugging are not set in the debugged process, apperrently the command used to instruct GDB is wrong. gdb set env (or set environment) does not set the environment variable within the debugged process, not even if the gdb commandline insterface (without eclipse interference) is used. Apperrently the wrong syntax is used: gdb-set-env TRACE_MODE=4 does not work set environment TRACE_MODE 4 without '=' does work In fact a bug in Gdb since it's working syntax 2. Writing to standard error doees not work when debugging an application. This is an extremely annoying bug, since developpers depend on error message reporting from the program under development. Bugs 1 and 2 can be reproduced with a simple modified Hello World program. #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main() { char *name= getenv("TRACE_MODE"); fprintf(stderr, "fprintf C alike error reporting\n"); cerr << "!!!Hello World!!! of errors "<< name<< endl; return 0; } Build and run and debug it. It works when running at full speed, but not when debugging it (invoking the gdb debugger)
#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main() { char *name= getenv("TRACE_MODE"); fprintf(stderr, "fprintf C alike error reporting\n"); cerr << "!!!Hello World!!! of errors "<< name<< endl; return 0; }
Not sure why I'm assigned this bug.
(In reply to comment #0) For next time, please use two different bugs to report two different problems. > 1. Environment variables set in for debugging are not set in the debugged > process, > apperrently the command used to instruct GDB is wrong. > > gdb set env (or set environment) does not set the environment variable > within the debugged process, not even if the gdb commandline insterface > (without eclipse interference) is used. > Apperrently the wrong syntax is used: > gdb-set-env TRACE_MODE=4 does not work > set environment TRACE_MODE 4 without '=' does work > > In fact a bug in Gdb since it's working syntax You can set environment variables for your debugged process by using the Environment tab of the launch. > 2. Writing to standard error doees not work when debugging an application. This was just fixed in bug 327617. I'm marking this bug as a duplicate. If the environment part of the bug is still a problem, please open a new bug for that issue specifically. *** This bug has been marked as a duplicate of bug 327617 ***