public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Apparent kernel bug with GDB on ppc405
@ 2007-10-24 19:46 Matt Mackall
  2007-10-24 20:28 ` Grant Likely
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Matt Mackall @ 2007-10-24 19:46 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: gdb

I'm trying to debug a trivial statically-linked hello world program on
a Xilinx PPC 405 and I'm seeing the following behavior:

With direct gdb on target, I can set a breakpoint at main, run, and
the breakpoint is triggered.

With gdbserver and gdb with "target remote localhost:1234", the above
still works.

With gdb on target redirected to a PC and tunneled back
to the target, everything still works.

With gdb on a PC, execution continues past the breakpoint. Comparing
the gdb protocol streams here and and on the previous (working) case
are identical up to the point of hitting the breakpoint (which never
happens in the latter case).

Raising the load on the PC to 4 and running gdb under nice -n 19 makes
things work again. So this begins to look like a kernel cache or
timing bug rather than a problem with the PC tool. It appears that the
breakpoint written to the executable at continue time is not visible
to the CPU at execute time.

My first suspicion was a dcache/icache coherency issue in
copy_to_user_page, so I added flush_dcache_icache_page(page) here to
no avail. On closer inspection, it looks like both icache and dcache
are already being flushed by flush_icache_user_range().

Adding printk(".") (or any printk) in this function here fixes things
(serial console at 115k), while printk("") and udelay(100) do not.
Which still suggests an icache bug..?

Any suggestions?

-- 
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.." 

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

end of thread, other threads:[~2007-10-29 21:19 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-24 19:46 Apparent kernel bug with GDB on ppc405 Matt Mackall
2007-10-24 20:28 ` Grant Likely
2007-10-24 20:42   ` Matt Mackall
2007-10-24 20:46     ` Grant Likely
2007-10-24 21:54     ` Matt Mackall
2007-10-24 22:28       ` Grant Likely
2007-10-24 22:33         ` Matt Mackall
2007-10-24 22:39           ` Grant Likely
2007-10-24 22:40             ` Grant Likely
2007-10-26  1:51               ` Benjamin Herrenschmidt
2007-10-24 22:41           ` Daniel Jacobowitz
2007-10-26  1:51             ` Benjamin Herrenschmidt
2007-10-26 20:41               ` Josh Boyer
2007-10-27  1:36                 ` Benjamin Herrenschmidt
2007-10-27  1:40                   ` Josh Boyer
2007-10-24 20:34 ` David Daney
2007-10-26  1:52   ` Benjamin Herrenschmidt
2007-10-26  1:47 ` Benjamin Herrenschmidt
2007-10-26  2:45   ` Grant Likely
2007-10-26  3:23     ` Benjamin Herrenschmidt
2007-10-26 14:42       ` Matt Mackall
2007-10-27  1:31         ` Benjamin Herrenschmidt
     [not found]           ` <1193470322.18243.63.camel@pasglop>
     [not found]             ` <20071029070824.72854629@weaponx.rchland.ibm.com>
     [not found]               ` <20071029151546.5af0e843@weaponx.rchland.ibm.com>
     [not found]                 ` <1193690106.9928.32.camel@pasglop>
2007-10-29 21:19                   ` [PATCH/RFC] powerpc: Pass PID argument to _tlbie (WAS: Apparent kernel bug with GDB on ppc405) Matt Mackall

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