Discussion:
[Bug python/20126] New: valpy_int needs to respect unsignedness
dje at google dot com
2016-05-20 16:27:05 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20126

Bug ID: 20126
Summary: valpy_int needs to respect unsignedness
Product: gdb
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: dje at google dot com
Target Milestone: ---

I was trying to figure out why

(gdb) py print "%x" % (gdb.parse_and_eval("0xffffffff12345678"))

was coming out negative

-edcba988

and traced it to valpy_int not respecting unsignedness.

I see valpy_long DTRT. I guess valpy_int didn't get similarly updated.
--
You are receiving this mail because:
You are on the CC list for the bug.
tromey at sourceware dot org
2018-09-15 04:42:35 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20126

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
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.
tromey at sourceware dot org
2018-09-15 05:23:12 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20126

Tom Tromey <tromey at sourceware dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |markflorisson88 at gmail dot com

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
*** Bug 12267 has been marked as a duplicate of this bug. ***
--
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:55 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20126

--- Comment #2 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=1c1e54f6b4b6de83aa3f31e6584f5bb4d6242930

commit 1c1e54f6b4b6de83aa3f31e6584f5bb4d6242930
Author: Tom Tromey <***@tromey.com>
Date: Fri Sep 14 22:44:10 2018 -0600

Preserve sign when converting gdb.Value to Python int

PR python/20126 points out that sometimes the conversion of a
gdb.Value can result in a negative Python integer. This happens
because valpy_int does not examine the signedness of the value's type.

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

PR python/20126:
* python/py-value.c (valpy_int): Respect type sign.

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

PR python/20126:
* gdb.python/py-value.exp (test_value_numeric_ops): Add
signed-ness conversion tests.
--
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:44 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20126

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #3 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...