Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Michael.Weber@Post.RWTH-AAchen.DE (Michael Weber)
Subject: Re: unalinged traps
Date: 1999/03/13	[thread overview]
Message-ID: <7cd6f2$p8f@dockmaster.ddns.org> (raw)

On Fri, 12 Mar 1999 15:51:22 -0500, Jacob C Gladish <jcgst28@pop.pitt.edu>
> Well, i'd liek to fix the ones I find. Can anyone explain how you would
> go about doing this.Specifically, how would I got about finding out
> where this occured in what source file. 

"Unaligned trap-fixing [for user-space programs]" nano-HOWTO:

1.) compile your program P with "CFLAGS += -g" for debugging symbols.
    *Don't* strip it. [BTW: Using find, my Alpha says a binary is stripped,
    regardless whether it is or not...]

2.) Start P. wait for an unaligned trap in syslog. *Don't* kill the program.
    If it segfaults [uncommon], have a look at the core (gdb ./P core)

3a.) Read The Fine Manual of gdb (info gdb)

3b.) start gdb with
      # gdb ./P `pidof P`

4.) gdb will tell you that is has attached to the program, it is stopped
    then.

5.) At the gdb prompt, type:
      > list *0x<fill in the address from syslog... that big hex number
        until the first whitespace should do>
    
    You should see the offending lines in source code. If not, maybe gdb is
    complaining about pathnames of source files. IIRC, you have to start gdb
    in the same directory where you typed "make".

6.) Look at the displayed code for type casts between long and int, or type
    casts at all. They're IMHO the most common causes...

7.) Fix it. Sometimes the compiler warns about these lines, too. Having P
    compile cleanly is at least an indicator for doing The Right Thing(TM).
    

HTH,
Michael
BTW: If someone knows how to gdb the kernel for unaligned traps, I'm
     interested...
-- 
That hurts:
"Hi, I'm new at Alpha..this might sound dumb even..
 Can I install Windows 95/98 on Dec Alpha machine?"
             --  Brian Seo in comp.os.linux.alpha





             reply	other threads:[~1999-03-13  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-13  5:00 Michael Weber [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-03-12  5:00 unalinged traps Jacob C Gladish
1999-03-13  5:00 ` Anton Ertl
read-only archive

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