From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4342F3858D39; Wed, 17 May 2023 14:49:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4342F3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684334989; bh=bO5M+bvQbCM58BR40UIDttTZZY68T8yupXniPGFGpDY=; h=From:To:Subject:Date:From; b=Jt8FkfLLFoorDoc9iUa2eVYj3C2SXk2sP3PFY7MLEgRu1R0ONGn021HvsB7hEjruG xBQcxRsHujTuDyI5wEm9VP7esiiZ0GEQoDCHaqQDhW4ke+1zoqKmiAvHOgAXvUFAdj bdiBCg3518279yBQT8NR675OpmDewt3jnF21if5o= From: "tuliom at ascii dot art.br" To: gdb-prs@sourceware.org Subject: [Bug gdb/30457] New: Unexpected sign extension during conversions Date: Wed, 17 May 2023 14:49:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tuliom at ascii dot art.br X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30457 Bug ID: 30457 Summary: Unexpected sign extension during conversions Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: tuliom at ascii dot art.br Target Milestone: --- Reproducer: $ cat test-gdb-print.c=20 #include int main() { unsigned long foo =3D 0x00007fffffffe8f8; unsigned long * bar =3D &foo; printf("*bar =3D 0x%lx\n", *bar); return 0; } $ gcc -g test-gdb-print.c $ gdb a.out >>> b test-gdb-print.c:9 Breakpoint 1 at 0x401144: file test-gdb-print.c, line 9. >>> r >>> p /x *bar $1 =3D 0x7fffffffe8f8 <--- OK, this is what we expect. >>> p /x bar $2 =3D 0x7fffffffda40 >>> p /x (unsigned long) *0x7fffffffda40 $3 =3D 0xffffffffffffe8f8 <--- The value got sign extended. --=20 You are receiving this mail because: You are on the CC list for the bug.=