From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D1FBF3858C52; Wed, 18 Jan 2023 10:39:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D1FBF3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674038397; bh=1mch3mSM5LdbmJZxrnQuP1UbFuMNz2PXl4QC1F6w33M=; h=From:To:Subject:Date:From; b=xUexRNTBvKQ8z4ORF7nC93YW3vgGma2gdtFlJK+6T8ZY/71own9fEtRj7xtLit3YW JHLwHyyPnfbWMaawlQhHpnUL+ei2PdE0NvXQ9izr1e7H5WIY1HEEhxGPrzD/OA17tk mNIn7lwJRiDgWgiWWGV8k5W/5mCRnvnuknUVWN1Q= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tdep/30019] New: [gdb/tdep, i386] frame address at first insn in main is zero Date: Wed, 18 Jan 2023 10:39:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org 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=3D30019 Bug ID: 30019 Summary: [gdb/tdep, i386] frame address at first insn in main is zero Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: tdep Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Test-case: ... $ cat test.c void foo (const char *s) { } int main (void) { foo ("foo"); return 0; } ... Compile for x86_64/-m32: ... $ gcc test.c -m32 ... Note how we have "frame at 0x0" for the two first insns: ... $ gdb -q -batch a.out \ -ex "set trace-commands on" \ -ex "maint set dwarf unwinders off" \ -ex "b *main" \ -ex "display /i \$pc" \ -ex "display /x \$esp" \ -ex "display /x \$ebp" \ -ex run \ -ex "info frame" \ -ex stepi \ -ex "info frame" \ -ex stepi \ -ex "info frame" +maint set dwarf unwinders off +b *main Breakpoint 1 at 0x80483fc +display /i $pc +display /x $esp +display /x $ebp +run Breakpoint 1, 0x080483fc in main () 1: x/i $pc =3D> 0x80483fc
: push %ebp 2: /x $esp =3D 0xffffce0c 3: /x $ebp =3D 0x0 +info frame Stack level 0, frame at 0x0: eip =3D 0x80483fc in main; saved eip =3D Outermost frame: outermost Arglist at unknown address. Locals at unknown address, Previous frame's sp in esp +stepi 0x080483fd in main () 1: x/i $pc =3D> 0x80483fd : mov %esp,%ebp 2: /x $esp =3D 0xffffce08 3: /x $ebp =3D 0x0 +info frame Stack level 0, frame at 0x0: eip =3D 0x80483fd in main; saved eip =3D Outermost frame: outermost Arglist at unknown address. Locals at unknown address, Previous frame's sp in esp +stepi 0x080483ff in main () 1: x/i $pc =3D> 0x80483ff : push $0x80484a0 2: /x $esp =3D 0xffffce08 3: /x $ebp =3D 0xffffce08 +info frame Stack level 0, frame at 0xffffce10: eip =3D 0x80483ff in main; saved eip =3D 0xf7dceaa6 Arglist at 0xffffce08, args:=20 Locals at 0xffffce08, Previous frame's sp is 0xffffce10 Saved registers: ebp at 0xffffce08, eip at 0xffffce0c ... --=20 You are receiving this mail because: You are on the CC list for the bug.=