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 7980117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:58:12+00:00 2026-06-04T09:58:12+00:00

When I program C/C++ with Visual Studio I often use __asm nop; command to

  • 0

When I program C/C++ with Visual Studio I often use __asm nop; command to insert a noop code in order to have something to break on. For instance:

if (someCondition())
{
  __asm nop;
}

I have no idea what to do when the condition occurs, but I want to stop the execution and examine the current state. Sometimes someCondition() is simple enough to create a conditional breakpoint, but conditional breakpoints slow down the execution significantly, besides it is not always possible.

Now, in C# I break into the debugger directly either by calling System.Diagnostics.Debugger.Break() or System.Diagnostics.Debugger.Launch().

Now I am forced to program Java and until now I have found no better alternative than just do System.out.println("bla-bla") and set a breakpoint there. Again, please consider the case when a conditional breakpoint is not feasible.

So, I wonder – is there an __asm nop or System.Diagnostics.Debugger.Break() alternative in Java?

  • 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-06-04T09:58:14+00:00Added an answer on June 4, 2026 at 9:58 am

    In bytecode you have a nop instruction, but there’s no nop statement in the Java language.

    You can add an extra ; on a line by itself and the code will still compile, but that’s not much more meaningful than adding an empty line.

    Another “does nothing” statement could be:

    assert true;
    

    which has no side-effects what so ever, and can be turned off when executing the program.

    As it turns out, assert true does not seem to generate any bytecode instructions, which causes break-points on assert true to be skipped all together. Eclipse is however able to break on a statement such as

    assert Boolean.TRUE;
    

    which is quite similar.

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

Sidebar

Related Questions

I have written a C# program in Visual Studio 2010 . I use database
I have compilled program in Visual Studio 2011 on Windows consumer preview with v110
I have a mixed mode C++-CLI program in Visual Studio 2005 that is set
Visual Studio C++ 2008 / GCC 4.4.2 I have written a program to run
i have C# program (in Visual studio 2005) and i try to connect and
I have created a program in Visual Basic using Microsoft Visual Studio 2010 Professional.
I just wrote a simple C++ program in Visual Studio 2010 and I use
I use parallel_for from ppl.h and when I run the program from visual studio
I try to debug a program in Visual Studio 10, but I have a
I had this snippet in a program (in Visual Studio 2005): if(_eof(fp->_file)) { break;

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.