From owner-freebsd-current Mon Sep 10 11:33: 4 2001 Delivered-To: freebsd-current@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 670E937B401; Mon, 10 Sep 2001 11:32:56 -0700 (PDT) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id UAA08960; Mon, 10 Sep 2001 20:32:42 +0200 (CEST) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Julian Elischer Cc: Marcel Moolenaar , John Baldwin , current@FreeBSD.ORG Subject: Re: Linuxulator: possible Giant pushdown victim References: <20010905172451.A526@dhcp01.pn.xcllnt.net> <20010907003859.A446@dhcp01.pn.xcllnt.net> <3B987CBA.97FC1A94@elischer.org> From: Dag-Erling Smorgrav Date: 10 Sep 2001 20:32:42 +0200 In-Reply-To: <3B987CBA.97FC1A94@elischer.org> Message-ID: Lines: 72 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Julian Elischer writes: > Marcel Moolenaar wrote: > > BTW: Do we have handy functions for use in the remote debugger, such > > as show_proc, show_vm or whatever, that dump important information > > in a readable form? > Matt has a cool set of macros as does Grog. I have a couple of macros I've used for debugging KLDs, which may serve as templates or inspiration for someone to write e.g. a "ps" macro (it shouldn't be too different from the "kldstat" macro, just walk the process table and print formatted info for every process) define kldstat set $kld = linker_files.tqh_first printf "Id Refs Address Size Name\n" while ($kld != 0) printf "%2d %4d 0x%08x %-8x %s\n", \ $kld->id, $kld->refs, $kld->address, $kld->size, $kld->filename set $kld = $kld->link.tqe_next end end document kldstat Lists the modules that were loaded when the kernel crashed. end define kldstat-v set $kld = linker_files.tqh_first printf "Id Refs Address Size Name\n" while ($kld != 0) printf "%2d %4d 0x%08x %-8x %s\n", \ $kld->id, $kld->refs, $kld->address, $kld->size, $kld->filename printf " Contains modules:\n" printf " Id Name\n" set $module = $kld->modules.tqh_first while ($module != 0) printf " %2d %s\n", $module->id, $module->name set $module = $module->link.tqe_next end set $kld = $kld->link.tqe_next end end document kldstat-v Lists modules with full information. end define kldload set $kld = linker_files.tqh_first set $done = 0 while ($kld != 0 && $done == 0) if ($kld->filename == $arg0) set $done = 1 else set $kld = $kld->link.tqe_next end end if ($done == 1) shell /usr/bin/objdump -h $arg0 | \ awk '/ .text/ { print "set \$offset = 0x" $6 }' > .kgdb.temp source .kgdb.temp add-symbol-file $arg0 $kld->address + $offset end end document kldload Loads a module. Arguments are module name and offset of text section. end DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message