This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Libmudflap for sh-elf toolchain cannot access environment variable MUDFLAP_OPTIONS


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]