break points?

Ok, I'm making great progress porting my code to unix/sparc systems.So how do you create breakpoints in the code for gdb to stop on.For intel I would use: asm("int $3");What's the SPARC equivalence?Thanks.
[249 byte] By [digiboy86a] at [2007-11-26 22:49:05]
# 1
Dbx uses "trap always" instruction, "ta 1". But gdb might use another -- it's better to ask on one of gdb forums...
MaximKartasheva at 2007-7-10 12:09:21 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

If you are using SunStudio the debugger that the IDE uses is dbx, not gdb.

Dbx is unlikley to gracefully handle a breakpoint trap from

aninstruction which it didn't install itself.

If you're using such a trap as a panic or in an assert statement the

unixy thing to do is to call abort().

IvanIgorovicha at 2007-7-10 12:09:21 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3

You can also replace these by calls to a global function

called (for example) "breakpoint()" which does nothing.

You need to make sure it doesn't get optimized away.

Then in the debugger, you just say "stop in breakpoint".

You get the same effect as an inlined breakpoint.

--chris

ChrisQuenellea at 2007-7-10 12:09:22 > top of Java-index,Development Tools,Solaris and Linux Development Tools...