public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tdep/30019] New: [gdb/tdep, i386] frame address at first insn in main is zero
@ 2023-01-18 10:39 vries at gcc dot gnu.org
  2023-01-19 11:14 ` [Bug tdep/30019] " vries at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: vries at gcc dot gnu.org @ 2023-01-18 10:39 UTC (permalink / raw)
  To: gdb-prs

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug tdep/30019] [gdb/tdep, i386] frame address at first insn in main is zero
  2023-01-18 10:39 [Bug tdep/30019] New: [gdb/tdep, i386] frame address at first insn in main is zero vries at gcc dot gnu.org
@ 2023-01-19 11:14 ` vries at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: vries at gcc dot gnu.org @ 2023-01-19 11:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30019

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
PR mentioned here:
https://sourceware.org/pipermail/gdb-patches/2023-January/195920.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-19 11:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-18 10:39 [Bug tdep/30019] New: [gdb/tdep, i386] frame address at first insn in main is zero vries at gcc dot gnu.org
2023-01-19 11:14 ` [Bug tdep/30019] " vries at gcc dot gnu.org

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).