Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Setting environment variables on remote target via GDB/Momentics: Page 1 of 4 (4 Items)
   
Setting environment variables on remote target via GDB/Momentics  
First off I'm running:

----
$ ntox86-gdb -v
GNU gdb 6.8 qnx-nto (rev. 506)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=i486-pc-nto-qnx6.5.0".

----
QNX® Momentics® Integrated Development Environment
Version: 4.7.0
Build id: 201006232051

----

I'm trying to preload a library into an application I'm debugging remotely, but seem to be unable to influence the 
environment on the target. Something as simple as LD_PRELOAD=foo.so on the target would be useful.

Right now I'm using the gdb command-line, but if there is a way to do this from Momentics that's fine too. 

After connecting to the target via:
(gdb) target qnx x.x.x.x:####

All of the following commands operate in the context of the host machine:
(gdb) set environment LD_PRELOAD=foo.so
(gdb) set sysroot /location/of/foo.so/
(gdb) set solib-search-path /location/of/foo.so/

Also doing the following doesn't work:
(gdb) r LD_PRELOAD=foo.so bar

I was wondering if anyone had any idea on how I can set the environment remotely through gdb? IN the mean time I know 
that I can use gdb locally on the target machine. And I can also create a wrapper application that sets LD_PRELOAD via 
execve() and start by debugging that. I was just hoping there would be some feature of gdb, or Momentics, that someone 
knew about.

Thanks