gdb: Use std::min and std::max throughout