diff options
author | Joel Brobecker <brobecker@adacore.com> | 2013-11-18 12:05:02 +0400 |
---|---|---|
committer | Joel Brobecker <brobecker@adacore.com> | 2013-11-19 06:44:40 +0400 |
commit | df7752b044d8ed316827f3887e5afe675d3d243a (patch) | |
tree | 7729c4c5ddcf59172029109661d74a48274df87d /ltoptions.m4 | |
parent | 4a0a886ab6202ef83d74063aa9fe3467f815dd4e (diff) | |
download | gdb-df7752b044d8ed316827f3887e5afe675d3d243a.zip gdb-df7752b044d8ed316827f3887e5afe675d3d243a.tar.gz gdb-df7752b044d8ed316827f3887e5afe675d3d243a.tar.bz2 |
Fix int() builtin with range type gdb.Value objects.
Consider the following variable:
type Small is range -128 .. 127;
SR : Small := 48;
Trying to get its value as an integer within Python code yields:
(gdb) python sr = gdb.parse_and_eval('sr')
(gdb) python print int(sr)
Traceback (most recent call last):
File "<string>", line 1, in <module>
gdb.error: Cannot convert value to int.
Error while executing Python code.
This is happening because our variable is a range type, and
py-value's is_intlike does not handle TYPE_CODE_RANGE. This
patch fixes this.
gdb/ChangeLog:
* python/py-value.c (is_intlike): Add TYPE_CODE_RANGE handling.
gdb/testsuite/ChangeLog:
* gdb.ada/py_range: New testcase.
Diffstat (limited to 'ltoptions.m4')
0 files changed, 0 insertions, 0 deletions