Debugging starts in disassembly (VS 2008)
-
lunes, 20 de febrero de 2012 22:54
Hi,
sometimes, whenever I start debugging by pressing the F8 key (single-step), the IDE automatically starts debugging the disassembly, sometimes it's debugging the source code. I wasn't able to figure out when it does the one or the other. It's a Winforms application with the "Application framework" enabled and a Form set as the startup object. No splash screen. Native debugging is disabled in the project's properties. Vshost is enabled.
If I create a new Winforms application, add the form_load event handler and press F8, it starts debugging the disassembly. However this is not always the case, that's why I'm asking here. It starts in mscorlib.dll!System.Threading.ExecutionContext.Run but I expect it to start in the source code in Form_Load, which should be the first debuggable method.
In the VS options, in the Debugging node, the option "[x] Enable address-level debugging" is enabled, but this should only enable me to do native debugging - which I do want to do sometimes, and therefore the options should stay checked. However, debugging the disassembly should not be the default when starting debugging via F8. Sure, instead of stepping in, I could set a breakpoint in Form_Load, press F5 and remove the breakpoint as soon as it's reached. Though I'm interested in which situations it starts debugging the source code and in which it goes straight to the disassembly. Probably it's me - but I don't know why.
The option "[x] Show disassembly if source is not available" is checked, too, but source+symbols are available (yes, they are). If I disable the option, I get a message when pressing F8 that there's no source code for the current line. Yes, that's right, but the current line should be in form_load, not in ExecutionContext.Run as mentioned above.
Any clue how to keep native debugging enabled and still step into the source code by pressing F8 when starting debugging?
Thx
Armin
Todas las respuestas
-
miércoles, 22 de febrero de 2012 3:13Moderador
Hi Armin,
How are you?
Based on your description, it seems that you just want to debug your own code, whatever you checked the option "[x] Show disassembly if source is not available" or not, right?
If so, do you check this option - Enable just my code:
If not, please try it.
In addition, here is more explainations about every option: http://msdn.microsoft.com/en-us/library/85yzd16c.aspx
I hope this will be helpful.
Best regards,
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Editado Mike FengMicrosoft Contingent Staff, Moderator miércoles, 22 de febrero de 2012 3:13
- Marcado como respuesta Armin Zingler jueves, 23 de febrero de 2012 11:27
-
jueves, 23 de febrero de 2012 0:06
Mike,
If I activate the option, the first thing I see after pressing F8 to start the application is still the disassembly. However, it's a bit better now because it's the disassembly of form_load. So I can quickly jump to the source code.
There are situations in which "just my code" is not sufficient. That's why I wanted it being disabled. Yet I'll observe myself it it's ok to enable it most of the time, and in case it's inappropriate I can still disable it. I only wanted to avoid dis-/enabling it again and again depending on the situation.
Anway, thx for the hint!
Armin
-
jueves, 23 de febrero de 2012 6:47Moderador
Hi Armin,
I havn't found VS can debug native code: http://msdn.microsoft.com/en-us/library/k70yt3e2.aspx
So what do you mean this:
how to keep native debugging enabled and still step into the source code by pressing F8 when starting debugging?
Best regards,
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
jueves, 23 de febrero de 2012 11:26
Hi Armin,
I havn't found VS can debug native code: http://msdn.microsoft.com/en-us/library/k70yt3e2.aspx
So what do you mean this:
how to keep native debugging enabled and still step into the source code by pressing F8 when starting debugging?
Hi Mike,
- "I havn't found VS can debug native code: http://msdn.microsoft.com/en-us/library/k70yt3e2.aspx"
I'm not sure what you mean. If "Just My Code" is active, the first window I see (in a new Winforms application that only overrides OnLoad) is this:
But it's easy to jump to the source code window from there. So it's ok.
- "how to keep native debugging enabled and still step into the source code by pressing F8 when starting debugging?"
Exactly. But never mind, your answer was already helpful. I can live with that improvement very well, because, if Just My Code is unchecked, the first thing I saw was
Thx again. I'll mark your reply as the answer as I think it's the best solution possible, though not perfect.
Armin
- "I havn't found VS can debug native code: http://msdn.microsoft.com/en-us/library/k70yt3e2.aspx"
-
viernes, 24 de febrero de 2012 3:15Moderador
Hi Armin,
You are welcome.
I have try many times to repro your scenario, but failed. I believe the easy way you found to go to the source code is this:
In addition, how about resetting all the setting to the default value?
I hope this can resolve this problem.
Best regards,
Mike Feng
MSDN Community Support | Feedback to us
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

