fixing issues in gdb(), adding functionality to detect current branch