• 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: Can Xcode run my application elevated?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can Xcode run my application elevated?


  • Subject: Re: Can Xcode run my application elevated?
  • From: Terry Simons <email@hidden>
  • Date: Mon, 3 Mar 2008 22:38:47 -0700

Well I could do that before. ;)

My interest is really in using Xcode because of the inherent speed advantages associated with graphical debugging.

So there's no way to do this whatsoever with Xcode?

I guess I'll have to learn how to use the Force and become a true GDB master. ;)

Are there any plans in making this sort of thing doable in the future? Would it help for me to file a radar?

What I imagine in my head is the ability to check some sort of "Run this program with elevated privileges" checkbox in the properties for the application target, and then being prompted for my account password when I attempt to run the application (just like every other OS X action that requires elevation).

- Terry

On Mar 3, 2008, at 10:31 PM, Rick Altherr wrote:

Of course, I forgot the important bit. GDB can only attach to a process for which you have privileges to look at. So, if you are running setuid process, it's unlikely that your normal user account will have privileges to attach to it. You can use sudo to run gdb such that GDB is running as root. It can then attach to just about any process. This does limit you to using GDB directly, however.

Rick


On Mar 3, 2008, at 9:16 PM, Terry Simons wrote:

I tried that... it isn't behaving for me.

I can attach to the PID of the running process (The Debugger window says "GDB: Program loaded." in the bottom left corner and I have the stop/restart/pause buttons available) but when I try to do something such as pause the program, nothing happens.

When I bring up the GDB console and try to do something I am told "The program is not being run."

Here's what I'm doing:

* sudo <my app>
* ps xa | grep <my app>  (To get the PID)

* Open XCode
* File->Open Recent Project-><My Project>
* Run->Attach to Process->Process ID...-><My PID>

And just in case it crosses anyone's mind... the executable I'm running *is* the debug build of the exectuable. ;)

Am I doing something wrong?

Also, which debugging format should I use for something like this? Is the "DWARF" default sufficient?

- Terry

On Mar 3, 2008, at 9:59 PM, Rick Altherr wrote:


On Mar 3, 2008, at 8:53 PM, Terry Simons wrote:

I'd like to use Xcode to debug my executable, which needs elevated privileges.

Can Xcode run an executable with elevated privileges?

Thanks,

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


In general, no. You can however have Xcode's debugger not launch your program and then manually attach GDB to an already running process.

--
Rick Altherr
Architecture and Performance Group
email@hidden




-- Rick Altherr Architecture and Performance Group email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Can Xcode run my application elevated?
      • From: Rick Altherr <email@hidden>
References: 
 >Can Xcode run my application elevated? (From: Terry Simons <email@hidden>)
 >Re: Can Xcode run my application elevated? (From: Rick Altherr <email@hidden>)
 >Re: Can Xcode run my application elevated? (From: Terry Simons <email@hidden>)
 >Re: Can Xcode run my application elevated? (From: Rick Altherr <email@hidden>)

  • Prev by Date: Re: Can Xcode run my application elevated?
  • Next by Date: Re: Can Xcode run my application elevated?
  • Previous by thread: Re: Can Xcode run my application elevated?
  • Next by thread: Re: Can Xcode run my application elevated?
  • Index(es):
    • Date
    • Thread