I have just started using codeblocks and have set up my UI to have the watches window in the bottom right of UI. I set my break point and run my program in debug mode. I can step through the lines of code with the buttons on my menu toolbar but there are no variables showing in my watches window. I read somewhere that you can right click and add global variables, but I also don't have that functionality. All I have in my watches window is a button that when I click a message pops up reading:
"Click the button to see the value. Hold ctrl to see the raw output string returned by the debugger. Hold shift to see the debugging representation of the CBWatch object."
This button doesn't even seem to do anything either though.
How do I get varibles to display?
When you run the debug mode (the one activated by the red play button). The application will execute as usually until it finds a breakpoint. After that breakpoint you must click the 'step forward' buttons. If you want to 'watch' the behaviour of variables, then you should click on the 'Debuggin window' button (the one with a bug which is near to the 'stop debugger')
Then activate the 'watches' and a new window will appear. In this window you can even add specific variables you want to track.
I am assuming you can see the watches window already.
All you need to do is type the variable name in the grid(inside the window).Only the variable name, the rest(data type etc) is automatically detected.
Go to Debug -> Debugging windows -> Watches
Related
So, after struggling with horrible interface choices of Xcode 4, I'm finally on 5.1.1.
The tabs became almost usable. Double clicking can be configured to open a file in a new tab. Good. Double clicking another file opens it in a new tab. Good. Double clicking first file again switches to previously open tab. Good! Double clicking first file while it is open in current tab opens a second tab with that file. Ok, I can live with that, since from there on they just switch from one to another.
So far a surprisingly sane behavior.
Unless you make a single click in the navigation panel by mistake. Single click opens whatever you click in the current tab, all logic and reason be damned.
The question is, how to change single click behavior to "Use separate tab" (or however Xcode refers to that behavior)?
Is there any way to disable single clicks from doing anything at all aside from highlighting the selection?
There's no option to disable the single-click behavior. Two options that get you close to your desired behavior are:
Use a single separate window for most of your tabs. Use a "main" window that has the file navigator visible, and a separate "work" window with the file navigator hidden. If you want to add a tab to the work window, create it in the main window and then drag it's tab over to the work window. This is an extra step, but you'll never have a single click change any of the tabs that you care about (thought it'll still change the primary or focussed editor in the main window, depending on your settings).
Use separate windows for each file. There's a preference setting that lets you create windows instead of tabs when you double-click a file in the file navigator. Use Mission Control instead of the tab bar to navigate between your files.
I have a complicated mess of code (built by a team of 7 over the course of several years) that incorporates multiple libraries - jQuery and angularjs, specifically.
I know that the value of a variable changes when I click a certain radio button, but I have no idea what is running when that happens to cause the variable to change. I've tried console.log in every place I can think of, but am somehow still missing the action that's changing the variable.
I know how to debug with Firebug if I know where to place my breakpoint, but in this case, I don't. Is there any way to tell Firebug to start debugging at the line that executes immediately after the radio button is clicked? In other words, when I click the radio button, open Firebug's Script panel to the first line in order of execution, wherever that line may be.
If you have chrome you can right click on the checkbox -> inspect element -> event listeners
Is there any way to tell Firebug to start debugging at the line that
executes immediately after the radio button is clicked?
Yes, this feature is called Break On Next.
Note that Firebug has much more features to debug your scripts besides setting breakpoints within the Script panel. These features are described in the 'Script Debugging' page inside the Firebug wiki.
Furthermore the Watch side panel allows you to inspect the variable to see, at which step it is changed.
Let's say I have two classes, Unicorn and Rainbow. Unicorn.m is open in one tab in xcode, and I'm currently editing Rainbow.m, open in another tab. I have a breakpoint set in Unicorn.m. When I run my code, the Unicorn breakpoint gets hit, and my Rainbow tab, the tab I'm currently looking at, gets switched to Unicorn. So now I have Unicorn open in two tabs, and Rainbow open in none.
I would like for xcode to either:
a) look to see if there's currently a tab open which contains that breakpoint and if so, switch the current view to that tab
or:
b) open up a new tab
It's really annoying to me to have my current tab switched to another file. Is there any setting in xcode I can make to help me with this? Or should I submit a request to apple?
I can help with b):
Open preferences -> Behaviors -> Run Pauses:
Check Show Tab and enter a Name for the new Tab you'd like to spawn when a breakpoint is reached. For this example it is Breakpoint.
Then, create a new tab by double clicking the empty area beside a tab (red arrow) or +. On the new tab, double click the name of the tab (green arrow) or press cmd+opt+shift+T and name it, no wonder, Breakpoint.
When the breakpoint is hit it'll open the Breakpoint tab or switch to it if it's already open.
I'm using an old version of Visual Studio that provides only the 'interactive' method for setting tab stops. Is there anyway to clear all the tab stops before setting them? Or anyway to exclude a given control from having a tab stop?
Added 10-sept-2009
Part of my problem was confusing tab stop order and tab stops. I naively assumed setting tab stop order, set a tab stop hence much confusion. Thanks for pointing out that tab stops are set in the property box.
You are not clear about your specific VS version, but as far as I remember (back to VC6) you automatically assign the tab order if you simply click once on each control in your desired order. There is usually no need to reset them beforehand.
This hint from a VC6 tutorial might be helpful:
To adjust the tab order of your
controls, you can choose the Tab Order
command from the Layout menu and click
the controls in the order that you
want them to be tabbed. If you have a
complicated dialog box and only want
to change the tab order of a few
controls, you can take a little
shortcut by holding the Ctrl key down
and selecting the last control that
tabs properly before selecting the
controls that tab incorrectly.
Clicking an empty spot in the dialog
box, or pressing Enter, will exit the
tab order mode.
To prevent a control from being
reached using the Tab key, clear the
Tab stop checkbox on the control's
property page.
If you want to change the tab behaviour programmatically, look for the WS_TABSTOP windows style.
Open the dialog whose tab order you want to change. Press Ctrl + D. On the dialog you will see numbers next to each control which indicate the tab order for that control. Click the controls in the order you want the tab order to go.
How can I set the position for the output prompt in Visual Studio 2008 when debugging is started?
I have two screens and I want the prompt to always appear on my second screen so that I still can see the code on the primary screen, I have tried some tricks but I haven't got it right.
I'm not sure what you mean by "outputprompt". If you are creating a command line application and are talking about the command window, then
position the window where you want it (you can pause you app if it closes too fast)
click on its system menu, then click on properties
on the third tab of the appearing properties dialog, enter the values you like (be sure to uncheck automatic window positioning)
close the dialog by clicking OK
in the dialog that appears, pick the option that changes the link, instead of just changing the current window (I'm not sure either a German or English translation of the options is helpful for you)
HTH.