View | Details | Raw Unified | Return to bug 13519 | Differences between
and this patch

Collapse All | Expand All

(-)gdb/cli/cli-cmds.c (-2 / +4 lines)
Lines 1169-1175 Link Here
1169
      return;
1169
      return;
1170
    }
1170
    }
1171
1171
1172
  pc = value_as_address (parse_to_comma_and_eval (&arg));
1172
  pc = value_as_address (coerce_func_ptr(parse_to_comma_and_eval (&arg)));
1173
  if (arg[0] == ',')
1173
  if (arg[0] == ',')
1174
    ++arg;
1174
    ++arg;
1175
  if (arg[0] == '\0')
1175
  if (arg[0] == '\0')
Lines 1199-1205 Link Here
1199
	  ++arg;
1199
	  ++arg;
1200
	  incl_flag = 1;
1200
	  incl_flag = 1;
1201
	}
1201
	}
1202
      high = parse_and_eval_address (arg);
1202
1203
      high = value_as_address(coerce_func_ptr(parse_and_eval(arg)));
1204
1203
      if (incl_flag)
1205
      if (incl_flag)
1204
	high += low;
1206
	high += low;
1205
    }
1207
    }
(-)gdb/mi/mi-cmd-disas.c (-2 / +2 lines)
Lines 115-125 Link Here
115
	  num_seen = 1;
115
	  num_seen = 1;
116
	  break;
116
	  break;
117
	case START_OPT:
117
	case START_OPT:
118
	  low = parse_and_eval_address (optarg);
118
	  low = value_as_address(coerce_func_ptr(parse_and_eval(optarg)));
119
	  start_seen = 1;
119
	  start_seen = 1;
120
	  break;
120
	  break;
121
	case END_OPT:
121
	case END_OPT:
122
	  high = parse_and_eval_address (optarg);
122
	  high = value_as_address(coerce_func_ptr(parse_and_eval(optarg)));
123
	  end_seen = 1;
123
	  end_seen = 1;
124
	  break;
124
	  break;
125
	}
125
	}
(-)gdb/value.c (+11 lines)
Lines 3145-3150 Link Here
3145
    }
3145
    }
3146
  return arg;
3146
  return arg;
3147
}
3147
}
3148
3149
struct value *
3150
coerce_func_ptr (struct value *arg)
3151
{
3152
  struct gdbarch *gdbarch = get_type_arch (value_type (arg));
3153
3154
  if (TYPE_CODE (value_type (arg)) != TYPE_CODE_PTR) {
3155
	  return value_cast(builtin_type(gdbarch)->builtin_func_ptr, arg);
3156
  }
3157
  return arg;
3158
}
3148
3159
3149
3160
3150
/* Return true if the function returning the specified type is using
3161
/* Return true if the function returning the specified type is using
(-)gdb/value.h (+3 lines)
Lines 362-367 Link Here
362
362
363
extern struct value *coerce_array (struct value *value);
363
extern struct value *coerce_array (struct value *value);
364
364
365
/* Cast a value to a function pointer. */
366
extern struct value * coerce_func_ptr (struct value *arg);
367
365
/* Given a value, determine whether the bits starting at OFFSET and
368
/* Given a value, determine whether the bits starting at OFFSET and
366
   extending for LENGTH bits are valid.  This returns nonzero if all
369
   extending for LENGTH bits are valid.  This returns nonzero if all
367
   bits in the given range are valid, zero if any bit is invalid.  */
370
   bits in the given range are valid, zero if any bit is invalid.  */

Return to bug 13519