• 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 debugger weirdness and custom data formatters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gdb debugger weirdness and custom data formatters


  • Subject: Re: gdb debugger weirdness and custom data formatters
  • From: Erez Anzel <email@hidden>
  • Date: Thu, 5 Feb 2004 19:15:32 -0500

I recommend that you declare your x and y variables (of type Polynomial) BEFORE the switch statement. That has solved similar problems for me in the past.

Bye...Erez

On 5-Feb-04, at 5:04 PM, Mark Lentczner wrote:

A follow up to my previous post: This seems to only occur when there are multiple auto variables in the same function, even if they don't have a scope conflict:

	Polynomial ThingWithXandY::doThing(Func f) {
		switch (f) {
			case squareX: {
				Polynomial x = getX();
				return x*x;
			}
			case squareY: {
				Polynomial y = getY();
				return y*y;
			}
			case squareDist: {
				Polynomial x = getX();
				Polynomial y = getY(); // breakpoint here
				return x*x + y*y;
			}
		}
		return 0;
	}

(I don't know that this is a minimal case yet... I just wrote this off the top of my head to illustrate what I think is the issue... My real code is quite a bit bigger and I haven't had the chance to pare it down to the minimal case.)

At the breakpoint, the debugger will think is y is in scope, and try to call the custom data formatter for Polynomial on it, sometimes causing horrible debugger crashes. In other functions, at a similar place, the debugger never thinks x is in scope.

It seems like the debugger (gdb or perhaps Xcode's UI) has picked one of the 'y' variables and is associating it's in/out of scope with all of the 'y' variables.

	- Mark

Mark Lentczner
email@hidden
http://www.wheatfarm.org/
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.

References: 
 >gdb debugger weirdness and custom data formatters (From: Mark Lentczner <email@hidden>)
 >Re: gdb debugger weirdness and custom data formatters (From: Mark Lentczner <email@hidden>)

  • Prev by Date: [ANN] New Developer Tools Technology Evangelist
  • Next by Date: Re: linking in static libraries under xcode?
  • Previous by thread: Re: gdb debugger weirdness and custom data formatters
  • Next by thread: Re: gdb debugger weirdness and custom data formatters
  • Index(es):
    • Date
    • Thread