def update_for_gdb_if_needed(binary_path, args, timeout, should_enable_gdb):
  """Update binary_path, args, and timeout if gdb is enabled."""
  if not should_enable_gdb:
    return binary_path, args, timeout

  args = "-ex 'b __sanitizer::Die' -ex run --args %s %s" % (binary_path, args)
  return 'gdb', args, None