From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,efa01a8f73e07ebe X-Google-Attributes: gid111c93,public From: Michael.Weber@Post.RWTH-AAchen.DE (Michael Weber) Subject: Re: unalinged traps Date: 1999/03/13 Message-ID: <7cd6f2$p8f@dockmaster.ddns.org>#1/1 X-Deja-AN: 454856192 Organization: Private Linux site with legal M-IDs :-) User-Agent: slrn/0.9.5.4 (UNIX) Newsgroups: comp.os.linux.alpha On Fri, 12 Mar 1999 15:51:22 -0500, Jacob C Gladish > 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 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