gdb read only mode ?
Is there way I can restrict gdb level to read only. So I will not be able to modify current data in gdb.
Can gdbserver or any other tool help in this case?
If you don't want to allow devs to change things, why don't you give them a coredump ?
A coredump is a dump of the memory map of the process. With this and the binary who generate the coredump, you can debug your application without running it (just need debug information).
To generate a coredump, use
There's no read-only mode for gdb, and gdb isn't the only way to debug a program anyway (it has no special permissions). Gdb uses ptrace underneath, and the ptrace permissions are all-or-nothing.
There are security frameworks that restrict the use of ptrace. For example,
Recent Ubuntu versions restrict
You seem to want to allow developers to investigate problems live on production servers, without letting them modify the way these systems behave. A solution to this problem is to run all servers in virtual machines. If a problem occurs, make a snapshot of the virtual machine, copy it out, and let the developers work from the snapshot (disconnected from the network). That even makes the developers' work easier since they can restart their debugging as many times as they like, from the saved snapshot.