Current GDB has a flexible mechanism adding standard register aliases by backends, and register/alias name is used as a key to find the corresponding register number. However, this mechanism can't handle the case if different registers have the same alias name. It sounds a little bit unreasonable, but 'fp' on ARM/Thumb is this case. alias 'fp' is assumed to be r11, both in ARM mode and Thumb mode in current GDB. However, the expected (or correct) behavior is that 'fp' is r11 on ARM mode, and 'fp' is r7 on Thumb mode, when user types 'p/x $fp' in GDB. Existing GDB can't meet such needs, so this patch is to refactor GDB a little bit. In this patch, a new gdbarch hook user_register_name is added, and its default implementation is to look for register aliases in user_regs_data, which is same as before in logic. This patch should not affect any functions of GDB. Regression tested on x86_64-unknown-linux. Comments? Once this patch is applied, we leave more flexibility to backend to determine what is the correct register number given a register alias. -- Yao (齐尧)