public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.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 [thread overview] Message-ID: <bug-30019-4717@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=30019 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 => 0x80483fc <main>: push %ebp 2: /x $esp = 0xffffce0c 3: /x $ebp = 0x0 +info frame Stack level 0, frame at 0x0: eip = 0x80483fc in main; saved eip = <not saved> 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 => 0x80483fd <main+1>: mov %esp,%ebp 2: /x $esp = 0xffffce08 3: /x $ebp = 0x0 +info frame Stack level 0, frame at 0x0: eip = 0x80483fd in main; saved eip = <not saved> 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 => 0x80483ff <main+3>: push $0x80484a0 2: /x $esp = 0xffffce08 3: /x $ebp = 0xffffce08 +info frame Stack level 0, frame at 0xffffce10: eip = 0x80483ff in main; saved eip = 0xf7dceaa6 Arglist at 0xffffce08, args: Locals at 0xffffce08, Previous frame's sp is 0xffffce10 Saved registers: ebp at 0xffffce08, eip at 0xffffce0c ... -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2023-01-18 10:39 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-18 10:39 vries at gcc dot gnu.org [this message] 2023-01-19 11:14 ` [Bug tdep/30019] " vries at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-30019-4717@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).