This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Libmudflap for sh-elf toolchain cannot access environment variable MUDFLAP_OPTIONS
- From: Andrew STUBBS <andrew dot stubbs at st dot com>
- To: Deepen Mantri <Deepen dot Mantri at kpitcummins dot com>
- Cc: "Frank Ch. Eigler" <fche at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 15 Jun 2007 16:32:27 +0100
- Subject: Re: Libmudflap for sh-elf toolchain cannot access environment variable MUDFLAP_OPTIONS
- References: <892C324111C95549A2C214BACAEA30986B7569@drsohm.kpit.com>
Deepen Mantri wrote:
We cannot place putenv("MUDFLAP_OPTIONS=<..>") in
libmudflap's __mf_init() function existing in mf-runtime.c.
Placing putenv(..) will limit the instrumented code's
runtime behaviour only to option being set in the code by me.
Well no, that would be silly - you might as well cut out the whole
environment read entirely. Put it somewhere else - main perhaps.
If you don't want to do that, you still have the option of injecting the
call via the debugger:
(gdb) break main
(gdb) continue
....
(gdb) call putenv("MUDFLAP_OPTIONS=<..>")
(gdb) continue
Of course, you have to have putenv linked into the program, but that can
be arranged easily enough.
Andrew