• 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: XCode 2.1 breakpoints not working for command line apps?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XCode 2.1 breakpoints not working for command line apps?


  • Subject: Re: XCode 2.1 breakpoints not working for command line apps?
  • From: Jim Ingham <email@hidden>
  • Date: Mon, 11 Jul 2005 17:44:42 -0700

Did you turn off the Load Symbols Lazily checkbox in the Debugger preferences as the previous poster suggests? You have to do this if you are using a project that doesn't have any output so far as Xcode can tell. If this makes things work for you, you might want to file a bug about this. Xcode should be able to figure out when it doesn't have enough information to make the "Lazy Symbol Loading" work, and turn it off in those cases.

Jim



On Jul 11, 2005, at 5:20 PM, Julien Palmas wrote:

Here is what I did to see if I can debug a command line tool with Xcode and gdb :

0 - in the terminal : defaults write com.apple.Xcode PBXGDBDebuggerLogToFile YES
1 - create a new "Standard tool" project in Xcode
2 - remove the target and the executable
3 - in terminal : gcc -g main.c (result = a.out)
4 - add a new custom executable in the Xcode project pointing to a.out
5 - set a break point on line 3 : int main (...) { in Xcode
6 - run the debugger in Xcode


and this is an exerpt of the log file created :

-> 205-break-insert -f "\"main.c:3\""
# PBXGDB_MICreateFileBreakpointCommand t=0.196578 Tepoch=1121127195.873513
<- (gdb)
<- &"No source file named main.c.\n"
<- 205^done,bkpt= {number="1",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>" ,pending="\"main.c:3",times="0"}
# processing result t=0.202337 Tepoch=1121127195.879273
# didFinish Sequence: <PBXGDB_NewBreakpointSequence: 0x5faee10> t=0.203404 Tepoch=1121127195.880340


On the other hand, if I use gdb in the terminal, I can set the breakpoint and it gets hit properly ...
What is the problem with Xcode ?



On Jul 12, 2005, at 2:50 AM, Jim Ingham wrote:


One thing you can do is to keep the gdb/Xcode logging on. That way, when you encounter a problem, you will have the transcript there, and at least we can tell what commands caused the hang, whether it was gdb or Xcode, etc... The way to do this is:

1) Quit Xcode.
2) In Terminal, say:

$ defaults write com.apple.Xcode PBXGDBDebuggerLogToFile YES

Then for every Xcode debugging session, you will get a file in / var/tmp/folders.<PID>/TemporaryItems with a name like:

XCGDB-<Program Name>-<XCode PID>

This probably slows down Xcode marginally, but I run with it on all the time, and I don't notice it...

Another thing to do is if Xcode hangs during a debugging session, sample both Xcode, and the gdb-powerpc-apple-darwin processes. You can either use the Sample.app in /Developer/Applications/ Performance Tools, or from the command line do something like:

$ sample <PID> 20 10

These will also help us to see whether one or the other process has gone wrong, or if somebody dropped a message and both are just waiting for the other to respond, or something like that...

If you can gather this information please file a bug with it. We may not be able to figure out what's going on without a reproducible case, but sometimes this is enough information for us to see what's happening by itself.

Thanks,

Jim

On Jul 9, 2005, at 6:49 AM, João Varela wrote:




On 2005/07/08, at 16:47, email@hidden wrote:



From: Arshad Tayyeb <email@hidden>
Subject: Re: XCode 2.1 breakpoints not working for command line apps?
To: Ladd Van Tol <email@hidden>
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed


Turning off the "Load symbols lazily" option worked for me. It's
not optimal, but at least it's letting me use the debugger now. Thanks!
-Arshad


On Jul 7, 2005, at 11:17 PM, Ladd Van Tol wrote:




I had a similar problem setting breakpoints in C++ code that I was
only able to resolve by turning off the "Load symbols lazily"
option in the Xcode debugging prefs.

I am uncertain why this worked, and Xcode 2.1 debugging continues
to be slow and flaky in many other regards.

- Ladd






Today I also ran into problems with debugging my C++ tool (which had never happened before) because GDB would hang after some time if I tried to step in or step over. The hang would not happen if I just hit continue and the tool would exit normally. I then tried to find if there was a reproducible case. I activated two breakpoints in different source files and it did hang in the same place (3 times after executing a while loop). I went to the target of my C++ tool in XCode and deactivated the zero link option. Then I rebuilt my tool and the hang did not happen again. I then cleaned up my target, activated zero link, and rebuilt it and tried to debug it so that I could reproduce the hang and file a bug. However, this time the hang did not happen even with zero link activated.


So, I have to agree that debugging with XCode GUI is sometimes flaky. Sometimes it works, sometimes it doesn't, which is not very helpful for reporting a reproducible bug. I'll keep a watchful eye if I can find a reproducible situation and file a bug on this.

- João
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com


This email sent to 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:
40toppan.co.jp


This email sent to 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: XCode 2.1 breakpoints not working for command line apps?
      • From: Julien Palmas <email@hidden>
References: 
 >Re: XCode 2.1 breakpoints not working for command line apps? (From: João Varela <email@hidden>)
 >Re: XCode 2.1 breakpoints not working for command line apps? (From: Jim Ingham <email@hidden>)
 >Re: XCode 2.1 breakpoints not working for command line apps? (From: Julien Palmas <email@hidden>)

  • Prev by Date: Re: XCode 2.1 breakpoints not working for command line apps?
  • Next by Date: Re: XCode 2.1 breakpoints not working for command line apps?
  • Previous by thread: Re: XCode 2.1 breakpoints not working for command line apps?
  • Next by thread: Re: XCode 2.1 breakpoints not working for command line apps?
  • Index(es):
    • Date
    • Thread