Discussion:
[Bug python/18352] New: can't convert integer Value to float
tromey at sourceware dot org
2015-04-29 03:01:52 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=18352

Bug ID: 18352
Summary: can't convert integer Value to float
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: tromey at sourceware dot org
Target Milestone: ---

python print int(gdb.Value(0)) works, and
python print float(gdb.Value(0.0)) works, but
python print float(gdb.Value(0)) does not work.
It seems like it should.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-14 22:51:41 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=18352

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at sourceware dot org |tromey at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
cvs-commit at gcc dot gnu.org
2018-09-24 05:16:51 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=18352

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <***@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fb4fa9469c5f5d87a956d45ed3b36fecc1fc31b9

commit fb4fa9469c5f5d87a956d45ed3b36fecc1fc31b9
Author: Tom Tromey <***@tromey.com>
Date: Fri Sep 14 22:31:12 2018 -0600

Allow more Python scalar conversions

PR python/18352 points out that the gdb Python code can't convert an
integer-valued gdb.Value to a Python float. While writing the test I
noticed that, similarly, converting integer gdb.Values to float does
not work. However, all of these cases seem reasonable.

gdb/ChangeLog
2018-09-23 Tom Tromey <***@tromey.com>

PR python/18352;
* python/py-value.c (valpy_float): Allow conversions from int or
char.
(valpy_int, valpy_long): Allow conversions from float.

gdb/testsuite/ChangeLog
2018-09-23 Tom Tromey <***@tromey.com>

PR python/18352;
* gdb.python/py-value.exp (test_float_conversion): New proc.
Use it.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-23 23:47:30 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=18352

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |8.3

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...