• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: gdb problem with DYLD_INSERT_LIBRARIES and pthread in dylib constructor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gdb problem with DYLD_INSERT_LIBRARIES and pthread in dylib constructor


  • Subject: Re: gdb problem with DYLD_INSERT_LIBRARIES and pthread in dylib constructor
  • From: Jeff Johnson <email@hidden>
  • Date: Wed, 15 Jul 2009 14:40:04 -0500

On Jul 15, 2009, at 2:17 PM, Greg Parker wrote:

On Jul 15, 2009, at 12:07 PM, Jeff Johnson wrote:

Hi. I'm experiencing a strange problem with gdb. I'm testing a version of a dylib that has a long-running pthread created in the constructor. This can be simulated with the example code at the end. If I use DYLD_INSERT_LIBRARIES to load the dylib on the command line, it works fine:

$ DYLD_INSERT_LIBRARIES=/path/to/my.dylib /path/to/the/executable

However, I'm unable to run it in gdb:

$ gdb /path/to/the/executable
(gdb) set environment DYLD_INSERT_LIBRARIES=/path/to/my.dylib
(gdb) run

When I do that, I always get the following:

/bin/bash: /usr/bin/arch: Operation not supported
/bin/bash: /usr/bin/arch: Unknown error: 0
Program exited with code 01.

By default, gdb runs a shell and /usr/bin/arch in order to launch your program. DYLD_INSERT_LIBRARIES is inserting your dylib into those processes as well, which apparently confuses /usr/bin/arch. Try `set start-with-shell 0` in gdb before running your program.

Perfect, that works. Thanks!

-Jeff

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >gdb problem with DYLD_INSERT_LIBRARIES and pthread in dylib constructor (From: Jeff Johnson <email@hidden>)
 >Re: gdb problem with DYLD_INSERT_LIBRARIES and pthread in dylib constructor (From: Greg Parker <email@hidden>)

  • Prev by Date: Re: gdb problem with DYLD_INSERT_LIBRARIES and pthread in dylib constructor
  • Next by Date: ThreadViewer plug-ins?
  • Previous by thread: Re: gdb problem with DYLD_INSERT_LIBRARIES and pthread in dylib constructor
  • Next by thread: ThreadViewer plug-ins?
  • Index(es):
    • Date
    • Thread