Results 1 to 13 of 13

Thread: Break while running code inb debug mode

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    109

    Break while running code inb debug mode

    Is there anyway to break into the vb code without setting a breakpoint so that I can get into the code while the program is running?

  2. #2
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,393

    Re: Break while running code inb debug mode

    Control+Break while running it in the IDE?

  3. #3
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,834

    Re: Break while running code inb debug mode

    Quote Originally Posted by jdc2000 View Post
    Control+Break while running it in the IDE?
    That may be key board specific...At work I have a ctrl + pause key on my laptop that stops execution. I just bought the PC I'm posting on and it doesn't have a pause key. I wonder what key replaced it?
    Please remember next time...elections matter!

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Break while running code inb debug mode

    There's a button on the VS toolbar while debugging that with the tooltip "Break All (Ctrl+Alt+Break)". You can click that or use that key combo in VS to break all threads. Not sure why you didn't see that yourself - it even uses the pause icon, to go along with the play and stop icons.

    I believe that Ctrl+Break in the application will just break the main thread, although I'm not 100% sure about that. Easy to test though. Of course, there's generally only one thread executing your code anyway, but may not always be.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Break while running code inb debug mode

    Quote Originally Posted by TysonLPrice View Post
    That may be key board specific...At work I have a ctrl + pause key on my laptop that stops execution. I just bought the PC I'm posting on and it doesn't have a pause key. I wonder what key replaced it?
    I have Pause on my keyboard too. They were probably concerned that gamers rage-quitting would press the Break key and expect their keyboard to explode.

  6. #6
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,834

    Re: Break while running code inb debug mode

    It took me a long time to find any key:
    Attached Images Attached Images  
    Please remember next time...elections matter!

  7. #7
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: Break while running code inb debug mode

    Quote Originally Posted by jmcilhinney View Post
    I have Pause on my keyboard too.
    It's spelled 'paws', and they are frequently on keyboards. Hands work better, though.
    My usual boring signature: Nothing

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Break while running code inb debug mode

    Quote Originally Posted by Shaggy Hiker View Post
    It's spelled 'paws', and they are frequently on keyboards. Hands work better, though.
    The paws are in a hammock that's suction-cupped onto the window beside my desk, specifically to keep them off my keyboard.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    109

    Re: Break while running code inb debug mode

    I tried the Control + Break and got the following results (see attached).
    The Control + Break did not work.
    Do I have to load something else to get it to work?
    Attached Images Attached Images  

  10. #10
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Break while running code inb debug mode

    Without being able to see all of the text it is hard to say exactly what is the issue. I suspect that it has in fact entered break mode but it was either executing code that wasn't compiled as debug code and can't load the symbols or possible it was inside of "other code" such as the framework, API call, or 3rd party library that doesn't have any debug symbols.

    Does the call stack window show anything useful such as the current module name or a call stack that could show what code of yours invoked this code?

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    109

    Re: Break while running code inb debug mode

    The Call Stack only shows [External Code] (not Highlighted) with nothing after it.

  12. #12
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: Break while running code inb debug mode

    So, why are you looking at this? There are a few things that might cause you to want to try to study something without a breakpoint, and that is now appearing relevant. There must be something going on where you felt that either you couldn't set a breakpoint, or that it wouldn't do, so what is happening that you are trying to investigate?
    My usual boring signature: Nothing

  13. #13
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Break while running code inb debug mode

    Was any code actually being executed at the time? If this is a WinForms application that was waiting for user input then what exactly are you expecting to happen?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width