Breakpoint on NSException?
-
Is it possible to make my project in PB break whenever a NSException
is raised? I get a NSException sometimes, but can't locate its
source. Would be nice to see where it is fired (together with a stack
trace).
Thx,
Max
--
-----------------------------------------------
Max Horn
C++/ObjC/Java Developer
email: <mailto:<max...>
phone: (+49) 6151-494890 -
at the gdb prompt type
b -[NSException raise]
On Thursday, April 19, 2001, at 12:34 PM, Max Horn wrote:
> Is it possible to make my project in PB break whenever a NSException is
> raised? I get a NSException sometimes, but can't locate its source.
> Would be nice to see where it is fired (together with a stack trace).
-
On Thursday, April 19, 2001, at 12:34 PM, Max Horn wrote:
> Is it possible to make my project in PB break whenever a NSException is
> raised? I get a NSException sometimes, but can't locate its source.
> Would be nice to see where it is fired (together with a stack trace).
>
>
>
In gdb set a breakpoint at -[NSException raise]
so do this
b -[NSException raise]
or
fb -[NSException raise]
vince -
At 9:34 PM +0200 4/19/01, Max Horn wrote:
> Is it possible to make my project in PB break whenever a NSException is raised? I get a NSException sometimes, but can't locate its source. Would be nice to see where it is fired (together with a stack trace).
It's fairly easy. At the gdb console prompt, type "break -[NSException raise]". Now if I could just figure out the right set of commands to make it happen automatically. I tried using hook-run and hook-postrun in my .gdbinit file, but to no avail. The symbols for NSException are not loaded then.
--
V. Thane Norton III
Software Engineer
LaCie, Ltd.
Tel: 503.844.4569
Fax: 503.844.4593
mailto:<tnorton...> -
On Thursday, April 19, 2001, at 03:11 PM, Mike Ferris wrote:
> In the Breakpoints tab, hit the New button and type "-[NSException
> raise]" as the value.
Whatever happened to the way we used to do this in OpenStep 4.2, where
you could type "break <methodName>" at the GDB prompt, and it would list
the classes that implemented the method in question? Did that code get
dropped from GDB, or is it just broken?
-jcr
For every complex problem there is an answer that is clear, simple, and
wrong. -- H L Mencken -
On Thursday, April 19, 2001, at 06:38 PM, Thane Norton wrote:
> The symbols for NSException are not loaded then.
If you want to break on something that is not yet loaded, use "fb"
rather than "b".
Douglas Davidson -
On Friday, April 20, 2001, at 11:36 AM, John C. Randolph wrote:
> Whatever happened to the way we used to do this in OpenStep 4.2, where
> you could type "break <methodName>" at the GDB prompt, and it would
> list the classes that implemented the method in question? Did that
> code get dropped from GDB, or is it just broken?
It works for me usually, but I have noticed a few failures to find the
desired and valid selector.
Christopher -
On Freitag, April 20, 2001, at 04:36 Uhr, John C. Randolph wrote:
> Whatever happened to the way we used to do this in OpenStep 4.2, where
> you could type "break <methodName>" at the GDB prompt, and it would
> list the classes that implemented the method in question? Did that
> code get dropped from GDB, or is it just broken?
GDB does it just fine in a Terminal. It is only broken when running
inside the new ProjectBuilder.
Marcel -
Thank you very much to all those helpful people who helped me with
this problem!
IMO there should be simple command in the Debug-Menu to enable this
("Break on NSException" or so), as many people will want to do this.
Yes, it is quite simply to do it currently once you know how (and I
definitly have no problems with it), but if don't know it yet, and
are not experienced with gdb, you will have a tought time. Consider
this a feature request ;)
Thanks again!!!
Max
--
-----------------------------------------------
Max Horn
C++/ObjC/Java Developer
email: <mailto:<max...>
phone: (+49) 6151-494890 -
There are a few other GDB/PB features I'd really like to see.
For one thing, I'd like to be able to command-click (or alt-click, or
whatever) on any symbol or expression in the source, and see a popup
with its current value if it's in scope or computable.
Maybe even a hierarchical popup if it's a pointer, so that I could click
on "myWindow", and chase through
myWindow->contentView->_bounds.size.width, for example.
I'd also like very much to have a window somewhere where I can put
anything that gdb can accept in a print command, and show it to me
whenever I hit a breakpoint.
-jcr
On Monday, April 23, 2001, at 09:06 PM, Jim Ingham wrote:
> Yeah, this bit is broken right now. We switched how gdb & PB talk to
> each other (the change in the long run MUCH for the better, BTW...)
> But that broke the old query interface between PB & gdb. So now when
> gdb asks something like "which of these 30 classes do you want to break
> on for this selector?" PB just gets confused...
>
> We need to fix this, and some other cases - like defining breakpoint
> commands - where PB & gdb need to carry on more of a dialog... We are
> working on it...
>
> Anyway, setting breakpoints by selector works in PB when there is one
> class implementing the selector, and works fine in the command line so
> far as I have pushed it (if it doesn't work for some cases, please file
> that as a separate bug...)
>
> Jim
>
> On Friday, April 20, 2001, at 11:34 PM, Marcel Weiher wrote:
>
>> On Freitag, April 20, 2001, at 04:36 Uhr, John C. Randolph wrote:
>>
>>> Whatever happened to the way we used to do this in OpenStep 4.2,
>>> where you could type "break <methodName>" at the GDB prompt, and it
>>> would list the classes that implemented the method in question? Did
>>> that code get dropped from GDB, or is it just broken?
>>
>> GDB does it just fine in a Terminal. It is only broken when running
>> inside the new ProjectBuilder.
>>
>> Marcel
> _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
> Jim Ingham
> <jingham...>
> Developer Tools - gdb
"The problem with trying to child-proof the world, is that it makes
people neglect the far more important task of world-proofing the
child." -- Hugh Daniel



