Date: Thu, 22 Oct 1998 08:50:17 -0700 From: John Polstra <jdp@polstra.com> To: grog@lemis.com Cc: current@FreeBSD.ORG Subject: Re: inetd still dying (was: cvs commit: src/sys/cam/scsi scsi_da.c src/sys/i386/i386 busdma_machdep.c vm_machdep.c src/sys/i386/ibcs2 imgact_coff.c src/sys/i386/include param.h src/sys/i386/isa isa.c wd.c src/sys/kern imgact_elf.c sys_pipe.c sysv_shm.c vfs_b Message-ID: <199810221550.IAA18935@austin.polstra.com> In-Reply-To: <19981022100727.C1219@freebie.lemis.com> References: <Pine.BSF.4.05.9810130742430.19357-100000@picnic.mat.net> <199810131154.EAA12696@implode.root.com> <19981014071356.S21983@freebie.lemis.com> <19981022100727.C1219@freebie.lemis.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In article <19981022100727.C1219@freebie.lemis.com>, Greg Lehey <grog@lemis.com> wrote: > It happened again. I put inetd into gdb, but I couldn't find a way to > resolve library addresses. It works if I start a program, but > apparently not if I attach to it. Can anybody give me some pointers > (like how to find the load address of a library)? This is a real > -current but still using a.out binaries. Hmm, you're right -- it works great for ELF but not for a.out. So you'll have to fake it. You can find out where the shared libraries are loaded by using ldd: vashon# ldd /usr/sbin/inetd /usr/sbin/inetd: -lutil.2 => /usr/lib/aout/libutil.so.2.2 (0x2001c000) -lc.3 => /usr/lib/aout/libc.so.3.1 (0x20022000) Then use add-symbol-file specifying the address in the ldd output + 0x20 (the size of the a.out header, *gag*). I don't think the +0x20 should be necessary, but it is. For serious debugging, ELF is way better. For one thing, the core dumps contain all of the writable regions of memory. That means you get the data segments of all the shared libraries, so you can look at the variables in them. If you want to debug this on an a.out system, your best bet might be to install a static version of inetd. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Nobody ever went broke underestimating the taste of the American public." -- H. L. Mencken To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810221550.IAA18935>