Avoid asm__dyld__dyld_start on run when in debug window - xcode

Whenever I start my app and I have my view setup to see the code and the console in the debug view (in a all-in-one setup) my source view get switched to asm code for asm__dyld__dyld_start.

Try changing the setting in Run->Debugger Display to "Source Only" instead of "Dissasembly Only".

Related

Can I use PDSOE for "immediate" debugging?

Using ProEnv, I have configured my computer to start the standard debugger in case my Progress application shows a message (press the "Help" button and in the callstack, click on "Debug"), this is done using this ProEnv environment variable:
DLC=C:\PROGRE~1\OpenEdge
My application is started, using the -debugalert switch.
However, now I'm starting working with PDSOE (Progress Developer Studio for OpenEdge) and I would like to start up that debugger, in the mentioned case. I don't know how to do this, because PDSOE is based on Java technology (it's an Eclipse environment).
Does anybody know how to do this?
Thanks in advance
The way to launch the PDSOE variant of the debugger is from within PDSOE, using a "Debug Configuration". If you've run the application this way, the PDSOE debugger is used regardless of whether you use breakpoints or the <debug> button.
If you run the application from a "Launch Configuration", then the <debug> button will launch the standalone debugger.
They're basically functionally equivalent but TL;DR you'll need to run the application using PDSOE's "Debug Configuration".
Double click in the left margin of your source to set a break point (a small blue ball):
Then start your run configuration in debug mode:
You will be prompted to switch to debug perspective.
Add DEBUGGER:INITIATE(). DEBUGGER:SET-BREAK(). anywhere in the code and execute the application (provided you've already run prodebugenable -enable-all from the ProEnv in Admin mode).

Avoiding "Press any key to continue" when running console application from Visual Studio

When running a console application in Visual Studio via "Start without Debugging" (Ctrl+F5), the console remains open at the end of the run asking to
Press any key to continue . . .
thus requiring to activate the window and hit a key. Sometimes this is not appropriate.
Why this matters:
At the very moment I write json serialisation code, my workflow goes like this:
adapt c# code
run a console app that writes file out.json
view out.json in the browser with a json viewer
do this again and again, no need to debug anything, just trimming serialisation and check output is good.
It is workflows like this, where the "press any ..." behavior is hindering as it requires the steps
activate the console window
press key
.
No answers:
Starting the application outside VS in a separate console is not an answer.
Saying, you dont need this.
I'm pretty sure that you cannot affect or change this behavior.
As you mention, it has nothing to do with your application itself, because it doesn't do it when you double-click on the EXE. You only see this effect when you run the app from within Visual Studio without the debugger attached.
Presumably, when you invoke Ctrl+F5, Visual Studio is running your app in a particular way that causes the console window to remain open. I can think of two ways it might be doing it:
%COMSPEC% /k "C:\Path\To\YourApplication.exe"
or
%COMSPEC% /c ""C:\Path\To\YourApplication.exe" & pause"
With either of these, the pausing behavior you're seeing is baked right into the command used to launch your app and is therefore external to your application. So unless you have access to the Visual Studio sources, you're not going to change it. Calling an exit function from your app won't have any effect because your app has already quit by the time that message appears.
Of course, I can't see why it really matters, aside from an issue of curiosity. This doesn't happen when you start the app with the debugger attached, which is what you'll be doing 99% of the time when you launch the app from the IDE. And since you don't ship Visual Studio along with your app, your users are going to be starting the app outside of VS.
In response to the updates made to your question, the best solution would be to change your app so that it is not a console application. This behavior doesn't affect standard Windows applications; when they get closed, they close for good.
If you do not require any output on the console window, then this is very simple to do: just change the "Application type" in your project's properties. A Windows Forms application will work just fine. If you do not display a window (aka form), one will not be automatically created. This is the difference between regular Windows applications and console applications, which always create a console window, whether you need one or not.
If you do need to display output on the console window, you have a couple of options:
Create and use a simple form with a ListBox or ListView control. Each line that you would normally output to the console, you add as a new item to the list control. This works well if you're not using any "advanced" features of the console.
P/Invoke and call the AllocConsole function to create a console that your Windows application can use. You do not need a form for this.
I found a solution that works if you are using python (I could not test anything else).
You need to go to
Tools -> Options -> Python Tools -> Debugging
Uncheck Wait for input when process exits normally.
I hope you can apply this somehow to your problem.
2020 UPDATE : Microsoft has listened.
It also closes the console in "Start Without Debugging" mode ;)
The setting is a little buried, but works :
Well, at least in Visual Studio 2010, typing
Console.ReadKey(true);
Removes the "Press any key to continue....."
According to the VS2019 documentation:
Automatically close the console when debugging stops: Tells Visual Studio to close the console at the end of a debugging session.
It works, but only if you make sure your project starts with the debugger on. This sounds trivial, but I was trying at first with a solution with two projects, one Console one to copy files to use in my app, the other to run the actual app. I set the Console one to Start without debugging because I don't need debugging on it, but that did not close it after it ran. Only when setting it to Start (with debugging) this option worked.
In vs2017 you have to uncheck the python environment setting under the vs-options:
in german: Auf Eingabe warten, wenn der Prozess normal beendet wird

Setting the Debug version of the Direct3D runtime won't stick

When I open the DirectX control panel and open the Direct3D 9 tab and set "Use Debug Version of Direct3D 9" and hit "OK" or "Apply," there are no errors. If I open the control panel again, it is back to "Use Retail Version of Direct3D 9." When I try to debug my application, I don't get any output from Direct3D.
When I last did this a few months ago, everything worked correctly and I got debug output.
Running the control panel as Administrator doesn't seem to make a difference and the registry key mentioned here http://www.gamedev.net/topic/514529-cant-use-debug-version-of-direct3d/ is set to one.
What else can I try?
Same thing happened to me. It looks like that TrustedInstaller took ownership of some registry keys (including HKLM/SOFTWARE/Microsoft/Direct3D which dxcpl modifies).
Found a solution here. You just have to change ownership of that regkey.
I've seen this happen and sort of collected best practices to try and get this thing working online - you can try it
1.) There's a separate control panel for x86 and x64 applications in DirectX, There is the DirectX Control Panel which comes with the sdk and there you can set to use the d3d debug runtime and the verbosity level. There is also an option for shader debugging and memory check.
2.) Link against d3dx9d.lib instead of d3dx9.lib
3.) Try adding #pragma comment(lib, "d3dx9d")
4.) Use #define D3D_DEBUG_INFO, but use that before including the d3d9 headers.
5.) Check the Use Debug Version of Direct3D 9 in the properties window like so
http://i.stack.imgur.com/WoZAH.png
6.) Use a tool like DebugView
Sources:
http://www.gamedev.net/topic/514529-cant-use-debug-version-of-direct3d/
https://gamedev.stackexchange.com/questions/24541/cant-get-debug-spew-for-direct3d9
for me the solution was this:
"Looking at the permissions on the key can you not hit the "advanced" button? then click the "owner" tab put a check in the bottom box, then highlight the administrators group, then check "take ownership"."
via: http://www.tomshardware.co.uk/forum/238556-45-cannot-modify-delete-change-permissions-registry
after doing this i was able to give my user full access to HKLM/SOFTWARE/Microsoft/Direct3D and then the ctrlpanel kept its settings.

Visual Studio 2010 suddenly stops displaying Debug output

So there I am, working on a Silverlight app, and between one build & run and the next, my debug output goes away. Where before I had dozens of lines of Debug.Writeline text, I now have only the module load and thread messages.
Yes, I'm in debug mode (vs. release mode).
Yes, my Output window says "Show output from: Debug".
Yes, when I right-click on the output window, every option is checked.
No, my Tools > options > debugging > general > "Redirect all output text to the immediate window" is not checked.
All I can figure (and it's a wild guess) is that for some reason, the VS debugger isn't attaching to the Silverlight app like it should.
What's weird is this has been happening for the last couple of days, out of the blue. And just as suddenly, all my debug messages start showing up again.
This is VERY frustrating.
EDIT: Of course, after returning to the project after the weekend, all Debug messages are back. No idea what was causing the issue, so I'm sure it will happen again.
Now the question is: should I leave this question open in case the problem arises again in the near future? What happens to an unawarded bounty?
I found the same problem and just by setting options → debugging → output window → Thread Exit Messages to true the output windows was begin to send the right messages !?
I had exactly the same issue. Out of the blue, debug.print stopped working. In my case, it used to go to the Immediate Window. Nothing there. Nothing in the Output window. I followed several suggestions to no avail until I found this one at http://www.experts-exchange.com/questions/26894732/Debug-Print-and-Debug-Write-no-longer-work-in-Visual-Studio-2010.html
There is a context menu in the Output/Debug pane. The "Program Output"
menu item was accidentally cleared.
Checked the item and it started working again (even though my output was the immediate window). What a relief...
Ensure that the DEBUG conditional compilation symbol is defined. The Debug class suggests that you "add the /d:DEBUG option to the compiler command line when you compile your code using a command line, or add #define DEBUG to the top of your file".
Did you create or modify an Application config? If yes: the initial created configuration by VS does contains the necessary wiring configurations to enable the debugging at all. Not sure what and if there are counterparts in Silverlight, but in WPF environments simply replacing the app.config will have the same effect as you expierience.
Check the Immediate Window. Check the options. There is a general setting that says "send Debug output to Immediate Window"

Interactive pyDev console at breakpoint

I'm using Aptana Studio with Pydev 1.5.3 to debug my Django applications. I use PyDev's remote debugger and some code in manage.py and for most of the time this setup is working successfully- I can set breakpoints, inspect variables and step/continue through my code.
However, I'd like to execute arbitrary code at the breakpoint- the thing I really miss after switching from pdb to Eclipse debugging. There is an interactive console available in debug perspective but it is inactive for me.
So my question- is it possible to set up an interactive console in PyDev with remote debugger which could "inject" code at breakpoint?
strange, i am using pydev 1.5.6 for remote debugging and I can use the interactive console - i type the cmmand, hit enter, after a while get results back; check your firewall is not blocking anything (if you are sure, the interactive console works in local mode). there is even settings in pydev source code to set how much of stdout should be returned back to client (in chars), it should work
After some digging I discovered that I can use Expressions view to access variables properties and view results of class methods, but that still isn't a complete console at breakpoint though.
With PyDev 1.5.5 it should be possible:
In "Variables" view, you can right-click on a name, then select "change value".
The console is working as well, albeit a bit tricky.
It is only for inspection and in a very strange way: you have to input the text in the "Debug server" console, and you will get the output in the "filename" console.
Note also that you need to press enter twice, leaving an empty line.
While the "empty line" trick is documented, the issue about two different console for input and output is not, and I think it may be a bug.
On my development stack running Apache + mod_wsgi entering commands into the console had their output routed to the site's error logs. To resolve this you have set the stdoutToServer=True and sterrToServer=True to route capture all output to the PyDev remote debugger:
from pydevsrc import pydevd;pydevd.settrace('192.168.2.8', stdoutToServer=True, stderrToServer=True) #clone and put on python path: https://github.com/tenXer/PyDevSrc

Resources