Now when i execute some command say c1
under gdb and then want to re-execute
it, i guess i can access my previous
command using the up-arrow key.
Instead it takes me up. In emacs
x-window mode, this can be done by
ctrl+up-arrow. but not in this case.ctrl+up-arrow. but not in this case.
Try Alt-P and Alt-N to cycle through the commands that you already inserted. Hopefully it will work for you :) One single Alt-P should return you the last command that you typed. That is not only used in GDB mode, but in lots of places in emacs and it should work in most console configurations, even in those in which ctrl-up does not work. For instance, if you press Alt-X to write a command (like gdb), you can press Alt-P to retype the command that you put the last time you used Alt-X.
The section in which source code is displayed happens to be editable, I
dont want it to be so, can I?dont want it to be so, can I?
Automatically? As far as I know (but I am not an emacs expert), very few things. In emacs there are hooks or lisp functions that you can define to be called in some circumstances. For instance, there is a hook for the C-mode, that will be called when the c-mode is used (when you open a .c file if you are not familiar with modes), and you can customize your C-programming settings there (like the type of indent that you want to use). Unfortunately, there are no many hooks in the GDB-related mode (called GUD), and none of the hooks in that mode will work for you. There is a generic hook for when a file is visited (when it is open), but it is quite generic.
Manually, the reply kindly provided by Jérôme will work.
Apologies for my rather bad english.