Can I make the debugger jump to a function?

Can I make the debugger jump to a function?

Post by Bint » Thu, 26 Aug 2004 03:12:01


Hello,
I am running my app under the de *** , and it just got an access fault.
Crash. I know this is unlikely, but is there any way I can, from the
de *** , make it jump to my Emergency_Save function? (I have a function
defined to save my data in a temp file if there is a crash, but I don't
think this time it's going to call it).

Thanks
Bint
 
 
 

Can I make the debugger jump to a function?

Post by Miro Juris » Thu, 26 Aug 2004 03:49:40


Not in CW (but yes in XCode).

meeroh

--
If this message helped you, consider buying an item
from my wish list: < http://www.yqcomputer.com/ ;

 
 
 

Can I make the debugger jump to a function?

Post by Bint » Thu, 26 Aug 2004 04:42:37

On 8/24/04 1:49 PM, in article
XXXX@XXXXX.COM , "Miro Jurisic"




Is it easy to get a codewarrior project to compile in Xcode? Are there a
lot of hassles?

Bint
 
 
 

Can I make the debugger jump to a function?

Post by Miro Juris » Thu, 26 Aug 2004 05:30:28


< http://www.yqcomputer.com/
sToXcode/index.html#//apple_ref/doc/uid/20001708> has a guide for doing it. I
have never tried it, so I can't vouch for how well it works.

meeroh

--
If this message helped you, consider buying an item
from my wish list: < http://www.yqcomputer.com/ ;
 
 
 

Can I make the debugger jump to a function?

Post by Richard Al » Thu, 26 Aug 2004 05:57:56


Be aware that you have to have CodeWarrior installed on the same machine:

"The project importer in Xcode communicates with CodeWarrior through
Apple events. Once youe specified a CodeWarrior project to import, the
importer tells CodeWarrior to make a copy of the project, then sets
various settings and performs other operations to prepare the copy. The
importer tells CodeWarrior to export the copied project, then reads the
exported XML and uses that information to set up the new Xcode project.
The importer displays a status dialog while importing. On completion,
the status dialog is dismissed and the new project opens."

-- Richard
 
 
 

Can I make the debugger jump to a function?

Post by Paul » Thu, 26 Aug 2004 06:13:03


fault.
function

I've tried it a couple of times (I usually revisit XCode when new releases
come out.) I most recently tried a Cocoa 2D graphics app, in early
development, 50 or 60 files at the time, and never actually got it to build.
There are a LOT of steps in Apple's porting procedure, many of which involve
sifting through source code. I spent several hours and still had several
hundred errors when I gave up.

If I hadhad more of a reason to get it working I might have persisted
longer, but it was really only for my curiosity. I think it could have been
done in a day unless a real showstopper appeared.

I'd certainly use the new XCode 1.5, which is reputedly much more stable. It
will help a bunch if you can find someone with XCode experience. XCode
(IMHO) is a lot like Visual Studio on Windows: not very intuitive and most
operations take a few extra steps that are a pain if you don't know what
they are. And the extreme slowness tends to magnify whatever problems you
have.
 
 
 

Can I make the debugger jump to a function?

Post by Sean McBri » Thu, 26 Aug 2004 13:25:05

In article < XXXX@XXXXX.COM >,



I'm curious, I'd like to RTFM on how to do this (with XCode I guess),
can you point me there?
 
 
 

Can I make the debugger jump to a function?

Post by Miro Juris » Thu, 26 Aug 2004 14:44:46

In article < XXXX@XXXXX.COM >,



Open the gdb console (by IIRC clicking on the console tab while in debug mode)
and type "call (void)MyFunction(args)" at the gdb prompt

hth

meeroh

--
If this message helped you, consider buying an item
from my wish list: < http://www.yqcomputer.com/ ;
 
 
 

Can I make the debugger jump to a function?

Post by Sean McBri » Fri, 27 Aug 2004 03:26:31

In article < XXXX@XXXXX.COM >,



Oh that... ok thanks. (I thought you were talking about some feature
specifically designed to be called at crash time automatically. My
mistake.)
 
 
 

Can I make the debugger jump to a function?

Post by Eric VERGN » Fri, 27 Aug 2004 03:35:01

dans l'article XXXX@XXXXX.COM , Sean McBride XXXX@XXXXX.COM a rit le 25/08/04 20:26


If that's what you're looking for, use c++ exceptions:

try
{
RunMyApp();
}
catch(...)
{
My SaveDataOnFatalCrashFunction();
}

Eric
 
 
 

Can I make the debugger jump to a function?

Post by Miro Juris » Fri, 27 Aug 2004 05:44:36

In article <BD52A875.26BEF% XXXX@XXXXX.COM >,




I am not sure why you think that C++ exceptions are involved in a crash.

meeroh

--
If this message helped you, consider buying an item
from my wish list< < http://www.yqcomputer.com/ ;t>
 
 
 

Can I make the debugger jump to a function?

Post by Paul Russe » Fri, 27 Aug 2004 14:35:10


I believe that in the wonderful world of Windows and Visual C++ there is
some non-standard language extension or other that allows crashes due
to invalid memory accesses etc to throw a C++ exception.

Paul
 
 
 

Can I make the debugger jump to a function?

Post by Richard Al » Fri, 27 Aug 2004 18:02:31


No, in Windows, invalid memory accesses will be caught by the operating
system and result in a system exception (has nothing to do with a C++
exception).

In C++, however, operator new failing to allocate memory, for example,
*will* result in an exception, and uncaught exceptions will result in
exit() being called in the default exception handler.

Look at the documentation for set_new_handler() for more info on this.

Read Harb Sutter's book for more info on exceptions and how to live with
them.

-- Richard