title: How to run gdb with LD_PRELOAD?
body: <p>I have a program using LD_PRELOAD. The program should be run like
  this, "LD_PRELOAD=/path/to/libfoo.so qemu -U LD_PRELOAD a.out", if
  without gdb.</p>
  
  <p>Here are what I did while running gdb. </p>
  
  <p><code>(gdb) set environment LD_PRELOAD=/nfs_home/chenwj/tools/lib/libdbo.so</code></p>
  
  <p><code>(gdb) file /nfs_home/chenwj/tools/bin/qemu-i386</code></p>
  
  <p><code>(gdb) r -U LD_PRELOAD bzip2_base.i386-m32-gcc44-annotated input.source 1</code></p>
  
  <p>But gdb gave me the error below</p>
  
  <p><code>Starting program: /nfs_home/chenwj/tools/bin/qemu-i386 -U LD_PRELOAD bzip2_base.i386-m32-gcc44-annotated input.source 1</code></p>
  
  <p><code>bash: open "/bin/bash" failed: Permission denied</code></p>
  
  <p><code>During startup program exited with code 66.</code></p>
  
  <p>Any sugguestion appreciated.</p>
  
  <p>Regards, chenwj</p>