All of lore.kernel.org
 help / color / mirror / Atom feed
* ptrace Problem
@ 2003-07-15 15:43 Kent Borg
  0 siblings, 0 replies; 6+ messages in thread
From: Kent Borg @ 2003-07-15 15:43 UTC (permalink / raw)
  To: linuxppc-embedded


I am trying to get ptrace() working correctly so I can use gdbserver
so we can debug with more power than printf()'s.

The kernel is 2.4.21-rc1 with stuff done to it to support some
hardware that is under development (the chip has a 603-style core).

I can fire up gdbserver, I can attach to it with a gdb on my host.  I
can watch the little ptrace transactions go by and (after eliminating
some false leads) they all do seem to be doing sensible things.  But
when I try an "si", everything seems OK upto the _switch at which
point the kernel SIGSTOPs on a 0x0 instruction at the first
instruction of my application (or is it the second instruction?--I am
not sure, the address complained about is first+4, maybe one worked).

Once this happens my Abatron BDI-2000 is somehow hosed and can no
longer write to memory.  My next download takes all the time I would
expect, but the results are all 0x0 unless I first powercycle the
Abatron.

The kernel seems to otherwise be working quite well.  As this is new
hardware, I cannot state that it is certainly working correctly.

Obviously I suspect that something is wrong with how some memory
management data structure is set up when the ptrace calls are being
made by gdbserver, but I am not smart enough to have a clear idea of
what to look for.  (I don't want to get lost in walking page tables
and tracing TBL faulting and whatnot for another week--not if I don't
have to.)  I have tried changing from our previous gdb and gdbserver
to the Denx versions with same results.

Suggestions?


Thanks,

-kb

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: ptrace Problem
@ 2003-07-15 16:30 Jean-Denis Boyer
  2003-07-15 21:49 ` Kent Borg
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Denis Boyer @ 2003-07-15 16:30 UTC (permalink / raw)
  To: Kent Borg; +Cc: linuxppc-embedded


Kent, here are some ideas...

> The kernel is 2.4.21-rc1 with stuff done to it to support some
> hardware that is under development (the chip has a 603-style core).

Which chip is it?  Is it correctly recognized by the kernel (arch/ppc/kernel/cputable.c)? If not, it will choose a "Generic PPC", which might not have the correct attributes (for example, if it is a 8270, I think it is currently not recognized; the kernel would boot but the MMU would behave badly).

> Once this happens my Abatron BDI-2000 is somehow hosed and can no
> longer write to memory.  My next download takes all the time I would
> expect, but the results are all 0x0 unless I first powercycle the
> Abatron.

This is a silly question, but, did you try to unplug the BDI-2000 before running gdbserver? Just in case it stops on some exceptions...

> I have tried changing from our previous gdb and gdbserver
> to the Denx versions with same results.

Do you use a somewhat recent version of glibc, and was it built against a somewhat recent version of kernel? Can you also tell us the version of binutils and gcc ? Not all the combinations are reliable ;-)

Regards,
--------------------------------------------
 Jean-Denis Boyer, Eng.
 Software Designer
 M5T Centre d'Excellence en Télécom Inc.
 4283 Garlock Street
 Sherbrooke (Québec)
 J1L 2C8  CANADA
 (819)829-3972 x241
--------------------------------------------

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: ptrace Problem
@ 2003-07-16 19:46 Jean-Denis Boyer
  0 siblings, 0 replies; 6+ messages in thread
From: Jean-Denis Boyer @ 2003-07-16 19:46 UTC (permalink / raw)
  To: Kent Borg; +Cc: linuxppc-embedded


Kent,

> It lists a series of numbers ranging from 2.0 to 2.2.2.

Actually, there are obviously many ways to know the glibc version. When running on the embedded platform, you can issue a:
  ldd --version
But my "preferred" way is by looking at the soft link "libc.so.6" and confirm it matches on both the embedded system being debugged, and the system where gdb runs.

An idea: Does running native gdb (on the embedded system) debug correctly?

I'm currently using the following setup, which runs correctly both natively and in cross-debugging:
  MPC8250 (603e core, Hip4)
  Kernel 2.4.21
  binutils 2.13.90.0.18 (from ftp://ftp.kernel.org)
  gcc 3.2.3
  glibc 2.3.2 (with pthread)
  gdb 5.3
(Note that everything here was cross-compiled)

This version of binutils is the one recommended for powerpc-linux
(see http://gcc.gnu.org/install/specific.html#powerpc-*-linux-gnu*)

Regards,
--------------------------------------------
 Jean-Denis Boyer, Eng.
 Software Designer
 M5T Centre d'Excellence en Télécom Inc.
 4283 Garlock Street
 Sherbrooke (Québec)
 J1L 2C8  CANADA
 (819)829-3972 x241
--------------------------------------------

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2003-07-16 19:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-15 15:43 ptrace Problem Kent Borg
2003-07-15 16:30 Jean-Denis Boyer
2003-07-15 21:49 ` Kent Borg
2003-07-16 10:37   ` Kenneth Johansson
2003-07-16 14:26     ` Kent Borg
2003-07-16 19:46 Jean-Denis Boyer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.