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

Collapse All | Expand All

(-)gdb-7.7.1.orig/gdb/cli/cli-cmds.c (-2 / +2 lines)
Lines 1148-1154 Link Here
1148
      return;
1148
      return;
1149
    }
1149
    }
1150
1150
1151
  pc = value_as_address (parse_to_comma_and_eval (&p));
1151
  pc = value_as_address (coerce_func_ptr(parse_to_comma_and_eval (&p)));
1152
  if (p[0] == ',')
1152
  if (p[0] == ',')
1153
    ++p;
1153
    ++p;
1154
  if (p[0] == '\0')
1154
  if (p[0] == '\0')
Lines 1177-1183 Link Here
1177
	  ++p;
1177
	  ++p;
1178
	  incl_flag = 1;
1178
	  incl_flag = 1;
1179
	}
1179
	}
1180
      high = parse_and_eval_address (p);
1180
      high = value_as_address(coerce_func_ptr(parse_and_eval(p)));
1181
      if (incl_flag)
1181
      if (incl_flag)
1182
	high += low;
1182
	high += low;
1183
    }
1183
    }
(-)gdb-7.7.1.orig/gdb/mi/mi-cmd-disas.c (-2 / +2 lines)
Lines 116-126 Link Here
116
	  num_seen = 1;
116
	  num_seen = 1;
117
	  break;
117
	  break;
118
	case START_OPT:
118
	case START_OPT:
119
	  low = parse_and_eval_address (oarg);
119
          low = value_as_address(coerce_func_ptr(parse_and_eval(oarg)));
120
	  start_seen = 1;
120
	  start_seen = 1;
121
	  break;
121
	  break;
122
	case END_OPT:
122
	case END_OPT:
123
	  high = parse_and_eval_address (oarg);
123
          high = value_as_address(coerce_func_ptr(parse_and_eval(oarg)));
124
	  end_seen = 1;
124
	  end_seen = 1;
125
	  break;
125
	  break;
126
	}
126
	}
(-)gdb-7.7.1.orig/gdb/value.c (+11 lines)
Lines 3520-3525 Link Here
3520
    }
3520
    }
3521
  return arg;
3521
  return arg;
3522
}
3522
}
3523
3524
struct value *
3525
coerce_func_ptr (struct value *arg)
3526
{
3527
  struct gdbarch *gdbarch = get_type_arch (value_type (arg));
3528
3529
  if (TYPE_CODE (value_type (arg)) != TYPE_CODE_PTR) {
3530
	  return value_cast(builtin_type(gdbarch)->builtin_func_ptr, arg);
3531
  }
3532
  return arg;
3533
}
3523
3534
3524
3535
3525
/* Return the return value convention that will be used for the
3536
/* Return the return value convention that will be used for the
(-)gdb-7.7.1.orig/gdb/value.h (+3 lines)
Lines 415-420 Link Here
415
415
416
extern struct value *coerce_array (struct value *value);
416
extern struct value *coerce_array (struct value *value);
417
417
418
/* Cast a value to a function pointer. */
419
extern struct value * coerce_func_ptr (struct value *arg);
420
418
/* Given a value, determine whether the bits starting at OFFSET and
421
/* Given a value, determine whether the bits starting at OFFSET and
419
   extending for LENGTH bits are valid.  This returns nonzero if all
422
   extending for LENGTH bits are valid.  This returns nonzero if all
420
   bits in the given range are valid, zero if any bit is invalid.  */
423
   bits in the given range are valid, zero if any bit is invalid.  */

Return to bug 13519