Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Tracking *kernel* unaligned access
@ 1998-08-05  7:06 B. James Phillippe
  1998-08-05 15:32 ` Jim Paradis
  1998-08-08 20:25 ` Richard Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: B. James Phillippe @ 1998-08-05  7:06 UTC (permalink / raw)
  To: RedHat AXP list

Hello all,

	Thanks to help from this list, I've been happily and successfully
stomping userland unaligned accesses in programs since I got my Alpha.  But
now I've had my first kernel unaligned access (under 2.0.35 w/alpha
patches) and I'm not sure where to proceed.  Normally, I recompile with -g
and use gdb to locate the trouble area.  The problem is usually easy to
spot.
	Needless to say, the kernel is a bit different.  Can anyone point
out a safe way to track these in a running kernel?

thanks,
-bp
--
B. James Phillippe <bryan@terran.org>
Linux Software Engineer, WGT Inc.
http://earth.terran.org/~bryan


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

* Re: Tracking *kernel* unaligned access
  1998-08-05  7:06 Tracking *kernel* unaligned access B. James Phillippe
@ 1998-08-05 15:32 ` Jim Paradis
  1998-08-08 20:25 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Jim Paradis @ 1998-08-05 15:32 UTC (permalink / raw)
  To: axp-list

> 	Needless to say, the kernel is a bit different.  Can anyone point
> out a safe way to track these in a running kernel?

The old-fashioned way 8-)

Start by building a kernel.  

Generate a symbol listing for the kernel by issuing the command:

	% nm --numeric-sort vmlinux > vmlinux.map

in your top-level build tree.

Now boot your kernel.  When you get unaligned accesses, you will get
an "unaligned-access" message containing the PC of the offending
instruction.

The "vmlinux.map" file contains, among other things, the starting
addresses of every routine in the kernel.  It's thus a simple matter
to establish the routine where the offending instruction resides, and
the offset into that routine.

You can then go and disassemble the ".o" file containing that
routine to figure out exactly what in the routine is causing the
problem.

Working back from that to source code is an exercise left to the
reader 8-)

--
Jim Paradis (paradis@linux01.hlo.dec.com)     "The early bird gets the worm.
Compaq Computer Corporation		       If you want something else for
(508)841-3243				       breakfast, get up later."
http://www.tiac.net/users/jrp/index.html


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

* Re: Tracking *kernel* unaligned access
  1998-08-05  7:06 Tracking *kernel* unaligned access B. James Phillippe
  1998-08-05 15:32 ` Jim Paradis
@ 1998-08-08 20:25 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 1998-08-08 20:25 UTC (permalink / raw)
  To: axp-list

On Wed, Aug 05, 1998 at 12:06:45AM -0700, B. James Phillippe wrote:
> Normally, I recompile with -g and use gdb to locate the trouble area.

No, its just the same with the kernel.  If you've got the address the
kernel complained about, use

	$ gdb vmlinux
	(gdb) l *0xffffc00003xxxx


r~


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

end of thread, other threads:[~1998-08-08 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-08-05  7:06 Tracking *kernel* unaligned access B. James Phillippe
1998-08-05 15:32 ` Jim Paradis
1998-08-08 20:25 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox