Bug 14620 - GDB skips user asm statements mistaken as prologue
Summary: GDB skips user asm statements mistaken as prologue
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: symtab (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-25 14:57 UTC by Jan Kratochvil
Modified: 2012-09-25 14:57 UTC (History)
0 users

See Also:
Host:
Target: x86_64-unknown-linux-gnu
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2012-09-25 14:57:01 UTC
int v;
void f (void)
{ asm volatile ("push %rbp\nmov %rsp,%rbp");

  v = 1;
  v = 2;
asm volatile ("pop %rbp");}
int
main (void)
{
  f ();
  return 0;
}
-------------------------------------------------------------------------------
gcc -g -fomit-frame-pointer
-------------------------------------------------------------------------------
  Special opcode 8: advance Address by 0 to 0x0 and Line by 3 to 4
  Copy
  Special opcode 63: advance Address by 4 to 0x4 and Line by 2 to 6
-------------------------------------------------------------------------------
There is double line marker for address 0 but GDB ignores that.

(gdb) b f
Breakpoint 1 at 0x4: file prologue.c, line 6.
(gdb) info breakpoints 
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x0000000000000004 in f at prologue.c:6

FAIL:
address 4
PASS:
address 0