Solved

User breakpoint called from code at 0x77F76148

Posted on 1998-10-19
6
299 Views
Last Modified: 2009-07-29
I recently got this message from VC++ 5.0 (w/ VS97 SP3)
running on NT4.0 (w/ SP3).

"User breakpoint called from code at 0x77F76148"

The disassembly showed "int 3" (interrupt 03h)

I think this means that the program told the CPU to
stop at a breakpoint.  I think this is cool!  Is there
a sanctioned way to code this in my programs?  I'd like
to tell the program to stop at a certian point and let me
step from there without setting the breakpoint in the IDE.
0
Comment
Question by:alfredj
  • 4
  • 2
6 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 60 total points
Comment Utility
just use the statement

_asm int 3

to place a "hard" breakpoint.
0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
a couple of tips.  I use a preprocessor macro like

#if DEBUG
#define int3 _asm int 3
#else
#define int3
#endif

to remove the interrupts from release code.  Also I define a macro used to throwing exceptions that always does an int 3 before throwing.  That is very hand because once the exception is thrown and later caught, it is hard to backtrack and figure out what went wrong.

Let me know if you have questions.
0
 

Author Comment

by:alfredj
Comment Utility
_asm int 3.  Okay.  That much I knew, but I was hoping for more
"expertise" in the "exchange".  I'll up the points if you want, but could you explain more (If there is indeed more to explain?)

Is there anything good/bad/to-watch-out-for when using int 3?

0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:alfredj
Comment Utility
Thanks!  I thought that your short answer was all you
were going to say, but I guess you just put that in there
so you could be first.

Thanks again!


0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
I'm sorry, I'm not sure what more you want.  (I can't image what more there is).

There is no problem in using it.  I do it all the time.  The only annoyance is that the debugger displays a message box when it encounters it.  You  have to clear the message box before you can continue debugging/executing.  This of course doesn't happen with regular breakpoints.  (This happens because the debugger is "surprised" to find the int 3 as it didn't put it there.  With regular breakpoints, it expects to be called when the breakpoint is reached.  The hard ones are a surprise.)

What more are you looking for?  
0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
Okay.  well let me know if there's more you need.  
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now