Port-macppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Problem with gdb breakpoints



I was debugging a problem in mail/mutt on macppc and encountered a
problem with gdb.  I have zero ppc clue so I could use some help from
the audience before I file a PR.

The bug in mutt looked like classic big-endian vs. %d vs. 64-bit
value: "Reading ..." progress updates when opening a mailbox would
print percentages like 2064384% 

To catch the offender I did

  (gdb) break mutt_curses_message
  Breakpoint 2 at 0x181c30c: file curs_lib.c, line 272.

but the breakpoint was never hit.

I walked into that function with stepi's:

Dump of assembler code for function mutt_curses_message:
   0x0181c2d8 <+0>:     stwu    r1,-160(r1)
   0x0181c2dc <+4>:     mflr    r0
   0x0181c2e0 <+8>:     stw     r0,164(r1)
   0x0181c2e4 <+12>:    stw     r31,156(r1)
   0x0181c2e8 <+16>:    mr      r31,r1
   0x0181c2ec <+20>:    stw     r4,44(r31)
   0x0181c2f0 <+24>:    stw     r5,48(r31)
   0x0181c2f4 <+28>:    stw     r6,52(r31)
   0x0181c2f8 <+32>:    stw     r7,56(r31)
   0x0181c2fc <+36>:    stw     r8,60(r31)
   0x0181c300 <+40>:    stw     r9,64(r31)
   0x0181c304 <+44>:    stw     r10,68(r31)
-->0x0181c308 <+48>:    bne     cr1,0x181c32c <mutt_curses_message+84>
-->0x0181c30c <+52>:    stfd    f1,72(r31)
   0x0181c310 <+56>:    stfd    f2,80(r31)
   0x0181c314 <+60>:    stfd    f3,88(r31)
   0x0181c318 <+64>:    stfd    f4,96(r31)
   0x0181c31c <+68>:    stfd    f5,104(r31)
   0x0181c320 <+72>:    stfd    f6,112(r31)
   0x0181c324 <+76>:    stfd    f7,120(r31)
   0x0181c328 <+80>:    stfd    f8,128(r31)
=> 0x0181c32c <+84>:    stw     r3,136(r31)


The breakpoint that gdb set is at 0x0181c30c <+52>, but function jumps
around it with the preceding instruction 0x0181c308 <+48>.  So I guess
gdb should be smarter about parsing the function prologue, but as I
said I know nothing about ppc.  (My wild guess would be that it's
confused about vargargs vs. floating point args).


This is on macppc 6.1_RC1.

-uwe


Home | Main Index | Thread Index | Old Index