What are the three options we see in the debug console in Xcode? Just curious to know why there are three options? What purpose each option serve?
Debugger output is stuff printed by the debugger itself, and target output is what is printed by your application (printf, NSLog, etc).
Perhaps a read through of the Xcode User's Guide would do us all a little good tonight:
The Console Pane
The console pane displays program output and lets you enter commands
to the debugger tool. You specify the type of output the console
displays with the pop-up menu in the top-left corner of the console
pane:
All Output displays target and debugger output.
Debugger Output
displays debugger output only.
Target Output displays target output
only.
Related
I've create a profiling profile in Instruments.app from the blank template, and I'd like to use it to profile a command line program. The problem is that the program exits rather quickly (in a matter of seconds), which means I can't simply select it in the Instruments process dropdown to attach to it while it's running.
Is there a way to use an existing Instruments profile while launching a command line application, and start collecting data immediately, instead of attaching to a running process?
I do not have an Xcode project, or even the source code. I simply want to attach to an existing application right after it starts up. If it is relevant I'm using Instruments 6.1 on OS X Yosemite.
If there was a way to somehow start the profiling directly from the command line, and not from the Instruments GUI, that would be even better, but I'm not sure if such thing is possible.
Build a command line executable with debug symbols enabled:
gcc -Wall -g -O3 profile_me.c -o profile_me
Launch Instruments, select Time Profiler.
At the top left corner of the window, to the right of the pause button, you should see the name of your machine - click on this and then select Choose target... from the hierarchical menu to the right.
In the Choose target dialog, navigate to your executable and select it. Also set any command line options, environment variables, and the working directory, if needed.
Click on the Choose button to save the target options and dismiss the Choose target dialog - you should now see the target name to the right of your machine name in the top left corner of the Time Profiler window:
Hit the red "record" button to launch your executable and start profiling!
I am trying to write simple program in Visual FoxPro, I am using built in Help, but cannot find an answer there. There are dozens of samples but they all work with forms, and I just need something like console.out() or printf().
While looking for some samples on internet, found this:
? 2 + 2
This line supposed to print 4, but nothing happens when the program is run from the menu or tool bar.
In the command window, type "set device to screen"
You can create a program, may be called "start.prg" including the line above in the program. This is run everytime Foxpro is started from Desktop.
Click on Tools, Options, File locations, Startup Program,then "modify"
and enter the location of the "start.prg", for example, C:\Program Files\Microsoft Visual Foxpro 9\start.prg
******to print to paper *********************************************
set device to printer
set printer to &&& turn off all open print commands
???" " &&& open printer in raw mode
p_Landscape_On =chr(27)+"&l1O"
p_Landscape_Off =chr(27)+"&l0O"
n_Row=2
#n_Row, 1 say (p_Landscape_On) +(p_Draft)+(p_14inPaper)
n_Row=n_Row+1
******end of printing*****************************
#n_Row,n_Col_fav say (p_Landscape_Off)+(p_12CharPerInch)+p_Portrait)
set printer to
set device to screen
Type this into the Command text box and press Enter. Close all opened tables (if any) in order to see 4.
? is the correct way to display on screen. It will display on the next line of the current main window.
If you are getting no results try SET CONSOLE ON before your ?2+2
Another option, depending on your needs, is to use a WAIT WINDOW, ie WAIT WINDOW 'test'
You can also try ACTIVATE SCREEN prior to printing your text.
I am using VS express 2012 to run a code that display content of many files. I found that first files content do not show and when I debug step by step I found that the content show on the console window and disappear when other results show, which means they get pushed out of the window. of course I scroll up and I find the latest files only not all. Is there any option control this feature? and how can I see all results?
To avoid this you should convert your console application to a Windows Forms one and put all the output on a TextBox. Just execute the command on the Form load and redirect all the output to the TextBox.
It's not much work IMHO.
This is the nature of a console application, no different than if you were to echo data to the Windows command prompt. If there is too much data then of course it will scroll off the visible screen.
Often in MATLAB I turn on 'automatic' debugging with dbstop if error. When an error occurs, the function enters debug mode, and I am able to query the variables in the command window and see exactly what is going on. Very useful.
However, when this occurs, the focus switches to the editor. To me this seems counter-intuitive; we are in debug mode, so I want to find out what is going on, not look at the code (which I can already see in the adjacent window). I always immediately tab back to the command window.
So my first question is: Is there any point in accessing the editor at this point? What can I usefully do, when my script has crashed, in the editor?
And secondly: If I want to, can I change MATLAB's default behaviour to keep the focus in the command window?
To your second question:
If you use MATLAB's desktop environment, just deselect "Open Files when Debugging" in the "Debug" menu.
If you use MATLAB without the graphical desktop you can change this preference by modifying your matlab.prf file. This file stores preferences set from the GUI. The menu option described above makes the same changes as the manual process described below.
NOTE: Editing this file is entirely unsupported. Do so at your own risk.
Open the file from the MATLAB command prompt,
>> edit([prefdir '/matlab.prf'])
Or use the prefdir command in MATLAB to find the directory and then open the file in whatever editor you prefer.
Search for a line that says
EditorGraphicalDebugging=Btrue
Change it to read
EditorGraphicalDebugging=Bfalse
If the line doesn't exist, add it to the file.
Restart MATLAB.
You can use the invocation stack to see how you came about to the particular error position. Sure, you can use dbup and dbdown for this in the command window, but it's much easier in the editor.
Also, seeing the variables (and their values, using mouse hover) in the context of the code that caused the crash is far better for understanding the root cause of the error than just seeing the static values.
I can answer only your first question.
Things you can do in the editor:
Mouse hover a variable, which pops up a 'quick view' window.
Any action you can do when not in debug mode, treating the function as a script - running a line (highlight + F9), running a code block, etc.
I can see the output window with logging information only when I stop/exit the application. How to make it visible while running the code from VS?
Open Output window before or while running the application (View -> Output or ALT+2).