Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 625151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:16:43+00:00 2026-05-13T19:16:43+00:00

Years ago I had a little #define which I used in Borland C++ Builder.

  • 0

Years ago I had a little #define which I used in Borland C++ Builder. From memory, it was something approximately like

 #define BREAK_IF_DEBUGGING asm(0xA3);

or something like that. It relied on 0XA3 (or whatever it was) being the op code for the interrupt which Borland were using to trigger a breakpoint.

Can I do the same thing in Eclipse? (I’ll probably wrap it in a few #idef ECLIPSE and #ifdef TESTING)

What I hope to achieve here is that
– the code compiles away to nothing in the release version, of course.
– if I run by unit tests with Ctrl-F11 then I don’t want a breakpint to be triggered (which it won’t because of Ctrl-F11 being “Run”)
– if I “Run with Debug” using F11) then if executions hits any use of the macro then it will stop at a breakpoint.

Why? Because I want to set & forget. Just put one of these in each error leg (or embed it in my LOG_ERROR macro).

Often when I choose my initial breakpoint, it is too late, so this macro says “I think I want to run to line X, but if execution passes through one of those error branches first, I’d like to stop there & sniff around”.

Whether you like the idea or not, can you tell me how to do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:16:43+00:00Added an answer on May 13, 2026 at 7:16 pm

    what about

    #define BREAK_IF_DEBUGGING asm("int3");
    

    (the lack of space between int and 3 is intentional : int 3 being encoded differently from other interrupts, the gnu assembler mark this difference with this special syntax)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From my age old php days (years ago) I slightly remember that I had
I've had a blog since 2003. A few years ago, I moved it from
A couple of years ago, my school had a software solution from Novell. Just
I have been given a project which was released 2+ years ago, and had
Years ago I read about a visual studio shortcut which, if you had a
I had a Delphi 4 program that I developed many years ago that used
Paul Silver had this post 7 years ago to check various browsers. Has there
I remember years ago being able to download and install the forums software used
Years ago I had seen a tool that when running would allow you to
Okay, to give a little background, I learned WPF about 3 years ago and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.