gdb, gdbserver: Incorporate changes for split debug.

Pick up changes from https://github.com/MentorEmbedded/meta-mentor/pull/6 and incorporate the suggestions provided by others.

JIRA Ticket: MEIBPADIT-673.