Now when I execute a command, say c1 under gdb, and then want to re-execute this, I think I can access my previous one using the up arrow key. Instead it lifts me up. In emacs x-window, this can be done with Ctrl + up arrow. but not in this case .ctrl + up arrow. but not in this case.
Try Alt-P and Alt-N to execute the cyclic commands that you already inserted. Hope this works for you :) One Alt-P should return the last command you typed. This is not only used in GDB mode, but also in many places in emacs, and it should work in most console configurations, even those in which ctrl-up does not work. For example, if you press Alt-X to write a command (for example, gdb), you can press Alt-P to re-enter the command you put the last time you used Alt-X.
The section in which the source code is displayed becomes editable, I do not want this to be so, right? I don't want this to be so, do I?
Automatically? As far as I know (but I'm not an emacs expert), very few. Emacs has hooks or lisp functions that you can define to call in some cases. For example, there is a hook for C-mode that will be called when c-mode is used (when you open the .c file if you are not familiar with the modes), and you can configure your C-programming settings there (for example, the indent type, which you want to use). Unfortunately, there are not many hooks in GDB mode (the so-called GUD), and none of the interceptors in this mode will work for you. There is a general trick to visiting a file (when it is open), but it is quite common.
Manually, the answer kindly provided by Jerome will work.
Sorry for my pretty bad english.
source share