How to turn off GDB's ref command? - gdb

When using GDB, "ref" command displays source code which is quite useful. But I can't use short key like up arrow when being in this mode. Is there a way to turn off this function?

The refresh command enters TUI mode.
If you do info win, you'll see something like:
(gdb) info win
SRC (53 lines) <has focus>
CMD (26 lines)
The cursor keys scroll the window that has focus, which is why they reposition source but don't allow you to recall previous commands at the (gdb) prompt. So switch focus back to the prompt with focus cmd, and voila: you can use arrow keys as if you were outside the TUI mode.
You can also leave the TUI mode completely with C-x C-a, C-x a or C-x A keystroke. Documentation for TUI.

Related

Can gdb's tui be divided into three windows?

When I use gdb tui for debugging. I can use layout split to display the source code window and assembly window at the same time. But I also want to see the value of the register. If I use layout regs to display the register window, it will replace the source code window with the register window. Can I display source code, assembly code, and register windows at the same time?
When tui is displayed, I want to use the commands I used before. When I use the up and down arrow keys, the code window moves up and down. Is there any way to prevent me from re-entering the previously used commands?

how to switch between output tab and code writing area in visual studio without touching mouse?

just after running the code ,An output tab appears ,to again write the code I have to use mouse to click on code writing area to hide this tab and write code once again and hide this tab.Is there any keyboard shortcut for this task ?here you can see that output tab which irritates me ! after running the code
just use the keyboard shortcut shift + Esc

How to make SAS to open with maximized window?

How to make SAS to open with the main window and the editor window automatically maximized?
One way to do this is to push the command AWSMAXIMIZE at startup. You could place this statement in your autoexec.sas
dm "awsmaximize";
I was also able to do this by editing the start menu entry and adding to the end of the SAS command: -initstmt "dm 'awsmaximize';"
More here: http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#a000115355.htm#win-af-wincmds
Not sure if you can do this automatically at startup, but you can set a hotkey to do it.
Tools -> Options -> Keys
Choose a key and type this into the command:
AWSMAXIMIZE ON; WPGM; ZOOM
"AWSMAXIMIZE ON" is the SAS for Windows command to maximize itself.
"WPGM" is the command to bring focus to the Enhanced Program Manager
"ZOOM" is the command to maximize the in-focus window.

How can I scroll back in GDB's command window in the TUI mode?

Suppose that
(gdb) print *this
resulted in 20 lines of output. Yes, there would be Type <return> to continue, or q <return> to quit, but I'd like to scroll back to the top after I got to the bottom of the output.
I don't think http://sourceware.org/gdb/onlinedocs/gdb/TUI-Keys.html answers my question. It states
<PgUp>
Scroll the active window one page up.
but when the focus is on the command window, PgUp rewinds the command history, instead of scrolling back in the command window. Is it only me who suffers from this behavior?
I'm using PuTTY in order to SSH to Red Hat Linux (if this makes any difference).
One way to see the GDB output history in TUI mode is to enable logging:
set trace-commands on
set logging on
and then tail the log in another shell:
cd where/gdb/is/running
tail -f gdb.txt
This has the advantage of separating scrolling from command interaction, so you can type commands while viewing some past section of the GDB output.
None of the scrolling keys work in my CMD window, so GDB effectively consumes and destroys its own output. Switching out of TUI mode allows me to scroll up, but the output that occurred while in TUI mode is not there--the non-TUI window only shows new output generated after switching out of TUI mode. So far log and tail is the only solution I can find.
Edit: if you activate GDB logging (via set logging on) before switching to TUI mode, you may find that the logging stops upon entering TUI (this is a bug in GDB). You can toggle it back on:
set logging off
set logging on
I found an answer here: http://beej.us/guide/bggdb/
Note that when the SRC window has focus, the arrow keys will move the source code, but when the CMD window has focus, the arrow keys will select the previous and next commands in the command history. (For the record, the commands to move the SRC window single lines and single pages are +, -, <, and >.)
There's also an example session illustrating this:
(gdb) info win
SRC (36 lines) <has focus>
CMD (18 lines)
(gdb) fs next
Focus set to CMD window.
(gdb) info win
SRC (36 lines)
CMD (18 lines) <has focus>
(gdb) fs SRC
Focus set to SRC window.
(gdb)
You can try Ctrl + P for the previous command and Ctrl + N for the next command (when you have used Ctrl + P to go back to the previous commands :)
Use C-x o (usually Ctrl + X, O). Using this you can change your active window and then use normal up down arrow to see previous commands.

CPP:How to pause resume a running script in cmd line console using mouse?

I am in desperate need of help.... :). I am running a script from cmd line console. It does a sequence of operations. whats the best way to pause the script in between to check the results and resume it back using mouse????? or any key
I would appreciate for your reply back,
-Abishek
If I understand your question correctly, and if your program is writing to the standard output (the console window) and you are running on Windows:
You can turn on 'quick edit' in the console window by editing the cmd.exe window properties.
Open a command prompt (start | run | cmd.exe)
Click the upper left corner of the window and choose 'Defaults'.
Click the Options tab and then in Edit Options section make sure the QuickEdit Mode box is checked.
Click OK and you should be set.
If you click with the mouse inside the console window when quick edit is enabled, it will block the program from continuing while it is waiting to be able to write the next message to the output. If you then hit 'esc', the program will continue.
It's a useful shortcut for pausing a running console program that I use all of the time.
try cin.get()
There isn't any easy way to do that. You'd need to create a wrapper to run the program (for example, a debugger is a wrapper to a program), and this wrapper would have to have mouse functions programmed into it.
Without use of the mouse, use cin.get();. It will take an input from the keyboard before continuing.
I'm not sure about using the mouse to pause, but you can pause the execution of command line process by pressing the Pause / Break key or Ctrl + NumLock .
You can then resume the execution with Ctrl + Z