From haruo.tomita@toshiba.co.jp Mon Aug 2 05:04:04 2004 Received: with ECARTIS (v1.0.0; list kdb); Mon, 02 Aug 2004 05:04:09 -0700 (PDT) Received: from inet-tsb.toshiba.co.jp (inet-tsb.toshiba.co.jp [202.33.96.40]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i72C4399010030 for ; Mon, 2 Aug 2004 05:04:03 -0700 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb.toshiba.co.jp with ESMTP id i72C3wlr007671 for ; Mon, 2 Aug 2004 21:03:58 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id i72C3w1B014166 for ; Mon, 2 Aug 2004 21:03:58 +0900 (JST) Received: from tis2 [133.199.160.66] by tsb-wall.toshiba.co.jp with SMTP id XAA14165 ; Mon, 2 Aug 2004 21:03:58 +0900 Received: from mx2.toshiba.co.jp by tis2.tis.toshiba.co.jp id VAA04434; Mon, 2 Aug 2004 21:03:57 +0900 (JST) Received: from tsbomi.ome.toshiba.co.jp by toshiba.co.jp id VAA28065; Mon, 2 Aug 2004 21:03:57 +0900 (JST) Received: from mx.pcs.pc.ome.toshiba.co.jp by tsbomi.ome.toshiba.co.jp (8.9.3/3.7W) id VAA07939; Mon, 2 Aug 2004 21:03:56 +0900 (JST) Received: from pcssrv42.pcs.pc.ome.toshiba.co.jp by mx.pcs.pc.ome.toshiba.co.jp (8.9.3+3.2W/3.7W) id UAA18763; Mon, 2 Aug 2004 20:58:49 +0900 Received: by pcssrv42.pcs.pc.ome.toshiba.co.jp with Internet Mail Service (5.5.2653.19) id ; Mon, 2 Aug 2004 21:03:26 +0900 Message-ID: <7076215DFAA4574099E5CD59FE42226204DCD1CE@pcssrv42.pcs.pc.ome.toshiba.co.jp> From: "Tomita, Haruo" To: kdb@oss.sgi.com Cc: "Tomita, Haruo" Subject: Where is the patch of KDB for RHAS 2.1. Date: Mon, 2 Aug 2004 21:03:25 +0900 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-type: text/plain; charset=shift_jis Content-Transfer-Encoding: 8bit X-archive-position: 795 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: haruo.tomita@toshiba.co.jp Precedence: bulk X-list: kdb Dear ALL, I am using the update kernel(linux-2.4.9-e.xx) of RHAS 2.1. I want to debug a kernel. Where is the patch of KDB for these kernels? Best regards, Haruo --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From ananth@in.ibm.com Mon Aug 2 05:20:21 2004 Received: with ECARTIS (v1.0.0; list kdb); Mon, 02 Aug 2004 05:20:28 -0700 (PDT) Received: from e2.ny.us.ibm.com (e2.ny.us.ibm.com [32.97.182.102]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i72CKK0u010385 for ; Mon, 2 Aug 2004 05:20:21 -0700 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e2.ny.us.ibm.com (8.12.10/8.12.9) with ESMTP id i72CKBmi521994; Mon, 2 Aug 2004 08:20:11 -0400 Received: from jataayu.in.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i72CL8DK095176; Mon, 2 Aug 2004 08:21:11 -0400 Received: by jataayu.in.ibm.com (Postfix, from userid 500) id EB6D7B38BB; Mon, 2 Aug 2004 09:05:54 -0400 (EDT) Date: Mon, 2 Aug 2004 18:05:54 +0500 From: Ananth N Mavinakayanahalli To: kaos@sgi.com Cc: kdb@oss.sgi.com Subject: [PATCH] Add support to display memory given the physical address Message-ID: <20040802130554.GA20853@in.ibm.com> Reply-To: ananth@in.ibm.com Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Content-Transfer-Encoding: 8bit X-archive-position: 796 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: ananth@in.ibm.com Precedence: bulk X-list: kdb Hi Keith, Here is a patch against kdb-v4.4 for linux-2.6.7 that adds support to dump memory given a physical address. It adds a command "mdp" and works similar to commands "md" and the like. The changes are all in the "common" patch and should work on all archs. I have tested on x86 and ppc64. Thanks, Ananth diff -Naurp temp/linux-2.6.7/include/linux/kdbprivate.h linux-2.6.7/include/linux/kdbprivate.h --- temp/linux-2.6.7/include/linux/kdbprivate.h 2004-07-29 12:31:51.000000000 +0530 +++ linux-2.6.7/include/linux/kdbprivate.h 2004-07-29 11:39:33.000000000 +0530 @@ -109,6 +109,8 @@ extern int kdb_putarea_size(unsigned lon #define kdb_getarea(x,addr) kdb_getarea_size(&(x), addr, sizeof((x))) #define kdb_putarea(addr,x) kdb_putarea_size(addr, &(x), sizeof((x))) +extern int kdb_getphysword(unsigned long *word, + unsigned long addr, size_t size); extern int kdb_getword(unsigned long *, unsigned long, size_t); extern int kdb_putword(unsigned long, unsigned long, size_t); diff -Naurp temp/linux-2.6.7/kdb/kdbmain.c linux-2.6.7/kdb/kdbmain.c --- temp/linux-2.6.7/kdb/kdbmain.c 2004-07-29 12:31:51.000000000 +0530 +++ linux-2.6.7/kdb/kdbmain.c 2004-07-30 15:35:33.000000000 +0530 @@ -2045,7 +2045,7 @@ kdb_mdr(kdb_machreg_t addr, unsigned int static void kdb_md_line(const char *fmtstr, kdb_machreg_t addr, int symbolic, int nosect, int bytesperword, - int num, int repeat) + int num, int repeat, int phys) { /* print just one line of data */ kdb_symtab_t symtab; @@ -2055,10 +2055,16 @@ kdb_md_line(const char *fmtstr, kdb_mach unsigned long word; memset(cbuf, '\0', sizeof(cbuf)); - kdb_printf(kdb_machreg_fmt0 " ", addr); + if (phys) + kdb_printf("phys " kdb_machreg_fmt0 " ", addr); + else + kdb_printf(kdb_machreg_fmt0 " ", addr); for (i = 0; i < num && repeat--; i++) { - if (kdb_getword(&word, addr, bytesperword)) + if (phys) { + if (kdb_getphysword(&word, addr, bytesperword)) + break; + } else if (kdb_getword(&word, addr, bytesperword)) break; kdb_printf(fmtstr, word); if (symbolic) @@ -2129,6 +2135,7 @@ kdb_md(int argc, const char **argv, cons long offset = 0; int symbolic = 0; int valid = 0; + int phys = 0; kdbgetintenv("MDCOUNT", &mdcount); kdbgetintenv("RADIX", &radix); @@ -2164,6 +2171,9 @@ kdb_md(int argc, const char **argv, cons valid = 1; else if (strcmp(argv[0], "mds") == 0) valid = 1; + else if (strcmp(argv[0], "mdp") == 0) { + phys = valid = 1; + } if (!valid) return KDB_NOTFOUND; @@ -2262,11 +2272,15 @@ kdb_md(int argc, const char **argv, cons int n, z, num = (symbolic ? 1 : (16 / bytesperword)); for (a = addr, z = 0; z < repeat; a += bytesperword, ++z) { - if (kdb_getword(&word, a, bytesperword) || word) + if (phys) { + if (kdb_getphysword(&word, a, bytesperword) + || word) + break; + } else if (kdb_getword(&word, a, bytesperword) || word) break; } n = min(num, repeat); - kdb_md_line(fmtstr, addr, symbolic, nosect, bytesperword, num, repeat); + kdb_md_line(fmtstr, addr, symbolic, nosect, bytesperword, num, repeat, phys); addr += bytesperword * n; repeat -= n; z = (z + num - 1) / num; @@ -3488,7 +3502,7 @@ kdb_per_cpu(int argc, const char **argv, kdb_printf("%5d ", cpu); kdb_md_line(fmtstr, addr, bytesperword == sizeof(kdb_machreg_t), - 1, bytesperword, 1, 1); + 1, bytesperword, 1, 1, 0); } if (cpus_weight(suppress) == 0) return 0; @@ -3694,6 +3708,7 @@ kdb_inittab(void) kdb_register_repeat("md", kdb_md, "", "Display Memory Contents, also mdWcN, e.g. md8c1", 1, KDB_REPEAT_NO_ARGS); kdb_register_repeat("mdr", kdb_md, " ", "Display Raw Memory", 0, KDB_REPEAT_NO_ARGS); + kdb_register_repeat("mdp", kdb_md, " ", "Display Raw Memory", 0, KDB_REPEAT_NO_ARGS); kdb_register_repeat("mds", kdb_md, "", "Display Memory Symbolically", 0, KDB_REPEAT_NO_ARGS); kdb_register_repeat("mm", kdb_mm, " ", "Modify Memory Contents", 0, KDB_REPEAT_NO_ARGS); kdb_register_repeat("id", kdb_id, "", "Display Instructions", 1, KDB_REPEAT_NO_ARGS); @@ -3860,6 +3875,7 @@ EXPORT_SYMBOL(kdb_putarea_size); EXPORT_SYMBOL(kdb_getuserarea_size); EXPORT_SYMBOL(kdb_putuserarea_size); EXPORT_SYMBOL(kdb_getword); +EXPORT_SYMBOL(kdb_getphysword); EXPORT_SYMBOL(kdb_putword); EXPORT_SYMBOL(kdbgetularg); EXPORT_SYMBOL(kdbgetenv); diff -Naurp temp/linux-2.6.7/kdb/kdbsupport.c linux-2.6.7/kdb/kdbsupport.c --- temp/linux-2.6.7/kdb/kdbsupport.c 2004-07-29 12:31:51.000000000 +0530 +++ linux-2.6.7/kdb/kdbsupport.c 2004-07-30 15:40:30.000000000 +0530 @@ -739,6 +739,92 @@ int kdb_putarea_size(unsigned long addr, return(ret); } +/* + * kdb_getphys + * + * Read data from a physical address. Validate the address is in range, + * use kmap_atomic() to get data + * + * Similar to kdb_getarea() - but for phys addresses + * + * Inputs: + * res Pointer to the word to receive the result + * addr Physical address of the area to copy + * size Size of the area + * Outputs: + * none. + * Returns: + * 0 for success, < 0 for error. + * Locking: + * none. + */ +static int kdb_getphys(void *res, unsigned long addr, size_t size) +{ + unsigned long pfn; + void *vaddr; + struct page *page; + + pfn = (addr >> PAGE_SHIFT); + if (!pfn_valid(pfn)) + return 1; + page = pfn_to_page(pfn); + vaddr = kmap_atomic(page, KM_KDB); + memcpy(res, vaddr + (addr & (PAGE_SIZE -1)), size); + kunmap_atomic(vaddr, KM_KDB); + + return 0; +} + +/* + * kdb_getphysword + * + * Inputs: + * word Pointer to the word to receive the result. + * addr Address of the area to copy. + * size Size of the area. + * Outputs: + * none. + * Returns: + * 0 for success, < 0 for error. + * Locking: + * none. + */ +int kdb_getphysword(unsigned long *word, unsigned long addr, size_t size) +{ + int diag; + __u8 w1; + __u16 w2; + __u32 w4; + __u64 w8; + *word = 0; /* Default value if addr or size is invalid */ + + switch (size) { + case 1: + if (!(diag = kdb_getphys(&w1, addr, sizeof(w1)))) + *word = w1; + break; + case 2: + if (!(diag = kdb_getphys(&w2, addr, sizeof(w2)))) + *word = w2; + break; + case 4: + if (!(diag = kdb_getphys(&w4, addr, sizeof(w4)))) + *word = w4; + break; + case 8: + if (size <= sizeof(*word)) { + if (!(diag = kdb_getphys(&w8, addr, sizeof(w8)))) + *word = w8; + break; + } + /* drop through */ + default: + diag = KDB_BADWIDTH; + kdb_printf("kdb_getphysword: bad width %ld\n", (long) size); + } + return(diag); +} + /* * kdb_getword * --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From kaos@sgi.com Tue Aug 3 15:44:34 2004 Received: with ECARTIS (v1.0.0; list kdb); Tue, 03 Aug 2004 15:44:40 -0700 (PDT) Received: from mail.ocs.com.au (mail.ocs.com.au [202.147.117.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i73MiXwQ025303 for ; Tue, 3 Aug 2004 15:44:34 -0700 Received: from ocs3.ocs.com.au (ocs3.ocs.com.au [192.168.255.3]) by mail.ocs.com.au (Postfix) with ESMTP id BF22F180092; Wed, 4 Aug 2004 08:44:24 +1000 (EST) Received: by ocs3.ocs.com.au (Postfix, from userid 16331) id 2284FC2172; Wed, 4 Aug 2004 08:44:22 +1000 (EST) Received: from ocs3.ocs.com.au (localhost [127.0.0.1]) by ocs3.ocs.com.au (Postfix) with ESMTP id 2042A14008D; Wed, 4 Aug 2004 08:44:22 +1000 (EST) X-Mailer: exmh version 2.6.3_20040314 03/14/2004 with nmh-1.0.4 From: Keith Owens To: "Tomita, Haruo" Cc: kdb@oss.sgi.com Subject: Re: Where is the patch of KDB for RHAS 2.1. In-reply-to: Your message of "Mon, 02 Aug 2004 21:03:25 +0900." <7076215DFAA4574099E5CD59FE42226204DCD1CE@pcssrv42.pcs.pc.ome.toshiba.co.jp> Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Date: Wed, 04 Aug 2004 08:44:21 +1000 Message-ID: <16754.1091573061@ocs3.ocs.com.au> Content-Transfer-Encoding: 8bit X-archive-position: 797 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kaos@sgi.com Precedence: bulk X-list: kdb On Mon, 2 Aug 2004 21:03:25 +0900 , "Tomita, Haruo" wrote: >I am using the update kernel(linux-2.4.9-e.xx) of RHAS 2.1. >I want to debug a kernel. >Where is the patch of KDB for these kernels? Ask Redhat. I do patches against the standard kernels. Distributors add their own patches, some of which conflict with kdb, so it is up to the distributors to add kdb to their tree. RedHat do not appear to be interested, SuSE SLES9 has built in kdb. --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From kaos@sgi.com Tue Aug 3 23:14:15 2004 Received: with ECARTIS (v1.0.0; list kdb); Tue, 03 Aug 2004 23:14:20 -0700 (PDT) Received: from omx1.americas.sgi.com (omx1-ext.sgi.com [192.48.179.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i746EEsw011209 for ; Tue, 3 Aug 2004 23:14:14 -0700 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by omx1.americas.sgi.com (8.12.10/8.12.9/linux-outbound_gateway-1.1) with SMTP id i746E80f005981 for ; Wed, 4 Aug 2004 01:14:09 -0500 Received: from kao2.melbourne.sgi.com (kao2.melbourne.sgi.com [134.14.55.180]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA25271 for ; Wed, 4 Aug 2004 16:14:07 +1000 Received: by kao2.melbourne.sgi.com (Postfix, from userid 16331) id 908EDC2172; Wed, 4 Aug 2004 16:14:07 +1000 (EST) Received: from kao2.melbourne.sgi.com (localhost [127.0.0.1]) by kao2.melbourne.sgi.com (Postfix) with ESMTP id 8D40C1400B6; Wed, 4 Aug 2004 16:14:07 +1000 (EST) X-Mailer: exmh version 2.6.3_20040314 03/14/2004 with nmh-1.0.4 From: Keith Owens To: ananth@in.ibm.com Cc: kdb@oss.sgi.com Subject: Re: [PATCH] Add support to display memory given the physical address In-reply-to: Your message of "Mon, 02 Aug 2004 18:05:54 +0500." <20040802130554.GA20853@in.ibm.com> Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Date: Wed, 04 Aug 2004 16:14:06 +1000 Message-ID: <26087.1091600046@kao2.melbourne.sgi.com> Content-Transfer-Encoding: 8bit X-archive-position: 798 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kaos@sgi.com Precedence: bulk X-list: kdb On Mon, 2 Aug 2004 18:05:54 +0500, Ananth N Mavinakayanahalli wrote: >Here is a patch against kdb-v4.4 for linux-2.6.7 that adds support >to dump memory given a physical address. It adds a command "mdp" >and works similar to commands "md" and the like. > >The changes are all in the "common" patch and should work on all >archs. I have tested on x86 and ppc64. Also tested on ia64. Included in kdb-v4.4-2.6.8-rc3-common-1, with some minor changes and updated man pages. Please update Documentation/kdb when adding new commands. --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From jim.houston@comcast.net Wed Aug 4 14:25:59 2004 Received: with ECARTIS (v1.0.0; list kdb); Wed, 04 Aug 2004 14:26:04 -0700 (PDT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i74LPwTa030393 for ; Wed, 4 Aug 2004 14:25:59 -0700 Received: from [192.168.0.1] (c-24-60-234-83.ne.client2.attbi.com[24.60.234.83]) by comcast.net (sccrmhc11) with SMTP id <20040804212538011000bmthe> (Authid: houston.jim); Wed, 4 Aug 2004 21:25:38 +0000 Subject: Re: Announce: kdb v4.4 for x86-64 architecture From: Jim Houston Reply-To: jim.houston@comcast.net To: jfv@bluesong.NET Cc: kaos@sgi.com, kdb@oss.sgi.com In-Reply-To: <200406071851.22461.jfv@bluesong.net> References: <200406071851.22461.jfv@bluesong.net> Content-type: text/plain Organization: Message-Id: <1091654607.1020.90.camel@new.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 04 Aug 2004 17:23:27 -0400 Content-Transfer-Encoding: 8bit X-archive-position: 799 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: jim.houston@comcast.net Precedence: bulk X-list: kdb Hi Jack, I was very pleased to see your announcement of kdb for x86-64. I found a bug in the debug trap handling used for single step. In particular, in do_debug() when kdb has handled the single step, it needs a "return regs;" rather than "return 0;". The debug entry in entry.S sets %rsp to this returned value and uses it to restore the registers. Since %rsp is zero, you get a double fault. Jim Houston - Concurrent Computer Corp. --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From randolph@tausq.org Fri Aug 6 13:26:31 2004 Received: with ECARTIS (v1.0.0; list kdb); Fri, 06 Aug 2004 13:26:37 -0700 (PDT) Received: from pippin.tausq.org (gandalf.tausq.org [64.81.244.94]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i76KQVik001029 for ; Fri, 6 Aug 2004 13:26:31 -0700 Received: by pippin.tausq.org (Postfix, from userid 1000) id 28417CD2E1; Fri, 6 Aug 2004 13:26:32 -0700 (PDT) Date: Fri, 6 Aug 2004 13:26:32 -0700 From: Randolph Chung To: kdb@oss.sgi.com Subject: question about setting breakpoint on functions Message-ID: <20040806202632.GZ546@tausq.org> Reply-To: Randolph Chung Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.5.1+cvs20040105i Content-Transfer-Encoding: 8bit X-archive-position: 800 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: randolph@tausq.org Precedence: bulk X-list: kdb Hi, I'm trying to update the parisc kdb patch for 2.6 kernels. it's working, but i have a question about how this problem should be handled in kdb... when a breakpoint is placed on a function (e.g. "bp sys_open"), kdb currently inserts a breakpoint at the function address itself. when the breakpoint is hit, and you do a backtrace from kdb, you need to be able to unwind from the very first insn of the function, before the prologue of the function has setup a proper stack frame. is this the desired behaviour? alternatively, e.g. in gdb, when a breakpoint is placed on a function, the breakpoint logic skips the prologue of the function using a target-specific hook, so that the breakpoint is placed just after the prologue. as a result, when such a breakpoint is hit, you will be able to do regular unwinding to retrieve items from the stack frame. is this worth considering for kdb? of course, one could always put a breakpoint at a specific address that happens to be the first addrses of the function, and unwinding should still work to some extent in that case.... randolph -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/ --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From kaos@sgi.com Fri Aug 6 16:58:05 2004 Received: with ECARTIS (v1.0.0; list kdb); Fri, 06 Aug 2004 16:58:11 -0700 (PDT) Received: from mail.ocs.com.au (mail.ocs.com.au [202.147.117.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i76Nw42p008405 for ; Fri, 6 Aug 2004 16:58:05 -0700 Received: from ocs3.ocs.com.au (ocs3.ocs.com.au [192.168.255.3]) by mail.ocs.com.au (Postfix) with ESMTP id 1F1E5180092; Sat, 7 Aug 2004 09:57:55 +1000 (EST) Received: by ocs3.ocs.com.au (Postfix, from userid 16331) id 0415AC2173; Sat, 7 Aug 2004 09:57:55 +1000 (EST) Received: from ocs3.ocs.com.au (localhost [127.0.0.1]) by ocs3.ocs.com.au (Postfix) with ESMTP id 00C8014008A; Sat, 7 Aug 2004 09:57:54 +1000 (EST) X-Mailer: exmh version 2.6.3_20040314 03/14/2004 with nmh-1.0.4 From: Keith Owens To: Randolph Chung Cc: kdb@oss.sgi.com Subject: Re: question about setting breakpoint on functions In-reply-to: Your message of "Fri, 06 Aug 2004 13:26:32 MST." <20040806202632.GZ546@tausq.org> Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Date: Sat, 07 Aug 2004 09:57:53 +1000 Message-ID: <23827.1091836673@ocs3.ocs.com.au> Content-Transfer-Encoding: 8bit X-archive-position: 801 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kaos@sgi.com Precedence: bulk X-list: kdb On Fri, 6 Aug 2004 13:26:32 -0700, Randolph Chung wrote: >Hi, > >I'm trying to update the parisc kdb patch for 2.6 kernels. it's working, >but i have a question about how this problem should be handled in kdb... > >when a breakpoint is placed on a function (e.g. "bp sys_open"), kdb >currently inserts a breakpoint at the function address itself. when the >breakpoint is hit, and you do a backtrace from kdb, you need to be able >to unwind from the very first insn of the function, before the prologue >of the function has setup a proper stack frame. is this the desired >behaviour? > >alternatively, e.g. in gdb, when a breakpoint is placed on a function, >the breakpoint logic skips the prologue of the function using a >target-specific hook, so that the breakpoint is placed just after the >prologue. as a result, when such a breakpoint is hit, you will be able >to do regular unwinding to retrieve items from the stack frame. is this >worth considering for kdb? > >of course, one could always put a breakpoint at a specific address that >happens to be the first addrses of the function, and unwinding should >still work to some extent in that case.... With kdb, you get what you asked for. If you ask for a break point at offset 0 of a function, that is what kdb does. Think assembler functions, which gdb cannot handle. The i386 kdb patch has its own heuristics for working out how far into the function the breakpoint is and for working out what state the stack is at that point. --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From randolph@tausq.org Fri Aug 6 17:14:51 2004 Received: with ECARTIS (v1.0.0; list kdb); Fri, 06 Aug 2004 17:14:55 -0700 (PDT) Received: from pippin.tausq.org (gandalf.tausq.org [64.81.244.94]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i770EoGn009130 for ; Fri, 6 Aug 2004 17:14:51 -0700 Received: by pippin.tausq.org (Postfix, from userid 1000) id DB8CACD2E6; Fri, 6 Aug 2004 17:14:51 -0700 (PDT) Date: Fri, 6 Aug 2004 17:14:51 -0700 From: Randolph Chung To: Keith Owens Cc: kdb@oss.sgi.com Subject: Re: question about setting breakpoint on functions Message-ID: <20040807001451.GC546@tausq.org> Reply-To: Randolph Chung References: <20040806202632.GZ546@tausq.org> <23827.1091836673@ocs3.ocs.com.au> Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23827.1091836673@ocs3.ocs.com.au> X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.5.1+cvs20040105i Content-Transfer-Encoding: 8bit X-archive-position: 802 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: randolph@tausq.org Precedence: bulk X-list: kdb > With kdb, you get what you asked for. If you ask for a break point at > offset 0 of a function, that is what kdb does. Think assembler > functions, which gdb cannot handle. gdb can handle assembler functions..... on some architectures even assembler functions would need to follow ABI requirements for prologue/epilogue, and have unwinding info. gdb also uses code reading to do unwinding, so assembler functions can be unwound usually... > The i386 kdb patch has its own heuristics for working out how far into > the function the breakpoint is and for working out what state the stack > is at that point. ok, i will try to make kdb on parisc work under these conditions. thanks for the clarification. randolph -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/ --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From timur.tabi@ammasso.com Fri Aug 27 12:23:58 2004 Received: with ECARTIS (v1.0.0; list kdb); Fri, 27 Aug 2004 12:24:05 -0700 (PDT) Received: from emachine.austin.ammasso.com (rrcs-sw-24-227-247-8.biz.rr.com [24.227.247.8]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i7RJNvn6012343 for ; Fri, 27 Aug 2004 12:23:58 -0700 Received: from [10.10.0.38] ([10.10.0.38]) by emachine.austin.ammasso.com (8.12.8/8.12.8) with ESMTP id i7RJNhKY022751 for ; Fri, 27 Aug 2004 14:23:44 -0500 Message-ID: <412F89C9.9050606@ammasso.com> Date: Fri, 27 Aug 2004 14:21:45 -0500 From: Timur Tabi Organization: Ammasso User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 To: kdb@oss.sgi.com Subject: bt command shows wrong number of parameters Content-type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-archive-position: 803 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: timur.tabi@ammasso.com Precedence: bulk X-list: kdb I'm new to kdb, so I'm sure this is a misunderstanding on my part, but when I use the bt command to display a stack trace, I get this: [1]kdb> bt Stack traceback for pid 18117 0xf5864220 18117 18102 1 1 R 0xf58644b0 *cconfig EBP EIP Function (args) 0xec7d9f6c 0xf8afdb02 [ccil]ccilioctl+0x562 (0x0, 0xf5875b80, 0x0, 0xf5875b80, 0x0) ccil 0xf8afd5a0 0xf8afe0d0 0xec7d9ef4 0xc0173844 chrdev_open+0xd4 (0xbffff130, 0xec7d9f90, 0xf7867d1c, 0xf5875b80, 0xc01670c7) kernel 0xc0173770 0xc0173930 0xec7d9fbc 0xc017da96 sys_ioctl+0x2d6 kernel 0xc017d7c0 0xc017dc6c 0xc01091a9 sysenter_past_esp+0x52 kernel 0xc0109157 0xc01091d0 The problem is that the function ccilioctl() has only four parameters, not five: int ccilioctl(struct inode * inode, struct file *f, volatile unsigned int cmd, unsigned long arg) What does "(0x0, 0xf5875b80, 0x0, 0xf5875b80, 0x0)" mean? I seriously doubt this is the parameter list for ccilioctl, even with the extra number, because none of the four parameters are zero. -- Timur Tabi Staff Software Engineer timur.tabi@ammasso.com --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From timur.tabi@ammasso.com Fri Aug 27 12:26:58 2004 Received: with ECARTIS (v1.0.0; list kdb); Fri, 27 Aug 2004 12:27:02 -0700 (PDT) Received: from emachine.austin.ammasso.com (rrcs-sw-24-227-247-8.biz.rr.com [24.227.247.8]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i7RJQvD3012429 for ; Fri, 27 Aug 2004 12:26:58 -0700 Received: from [10.10.0.38] ([10.10.0.38]) by emachine.austin.ammasso.com (8.12.8/8.12.8) with ESMTP id i7RJQiKY022765 for ; Fri, 27 Aug 2004 14:26:45 -0500 Message-ID: <412F8A7F.9010601@ammasso.com> Date: Fri, 27 Aug 2004 14:24:47 -0500 From: Timur Tabi Reply-To: kdb@oss.sgi.com Organization: Ammasso User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 To: kdb@oss.sgi.com Subject: Displaying the contents of local variables? Content-type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-archive-position: 804 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: timur.tabi@ammasso.com Precedence: bulk X-list: kdb I'm new to kdb, so I'm sure this is a FAQ, but I haven't found the answer anywhere. Is it possible to display local variables? I'm debugging my driver on the 2.6 Linux kernel, and I've hit a breakpoint inside a function. There are a number of local variables and parameters that I'd like to display, but the md command doesn't recognize any of the variable names. When I do something like "md arg", I just get an error. Is this supposed to work, or am I going to have to manually figure out where my variables are on the stack? -- Timur Tabi Staff Software Engineer timur.tabi@ammasso.com --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From jim.houston@comcast.net Fri Aug 27 15:09:47 2004 Received: with ECARTIS (v1.0.0; list kdb); Fri, 27 Aug 2004 15:09:51 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i7RM9ktN016801 for ; Fri, 27 Aug 2004 15:09:46 -0700 Received: from [192.168.0.1] (h00e098094f32.ne.client2.attbi.com[24.60.234.83]) by comcast.net (rwcrmhc11) with SMTP id <2004082722090801300hhr8re> (Authid: houston.jim); Fri, 27 Aug 2004 22:09:13 +0000 Subject: Re: Displaying the contents of local variables? From: Jim Houston Reply-To: jim.houston@comcast.net To: kdb@oss.sgi.com Cc: Timur Tabi In-Reply-To: <412F8A7F.9010601@ammasso.com> References: <412F8A7F.9010601@ammasso.com> Content-type: text/plain Organization: Message-Id: <1093644376.1017.111.camel@new.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 27 Aug 2004 18:06:16 -0400 Content-Transfer-Encoding: 8bit X-archive-position: 805 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: jim.houston@comcast.net Precedence: bulk X-list: kdb On Fri, 2004-08-27 at 15:24, Timur Tabi wrote: > I'm new to kdb, so I'm sure this is a FAQ, but I haven't found the > answer anywhere. > > Is it possible to display local variables? I'm debugging my driver on > the 2.6 Linux kernel, and I've hit a breakpoint inside a function. > There are a number of local variables and parameters that I'd like to > display, but the md command doesn't recognize any of the variable names. > When I do something like "md arg", I just get an error. Is this > supposed to work, or am I going to have to manually figure out where my > variables are on the stack? Hi, Kdb only knows about global variables. Gdb and the appropriate kgdb stub will let you look at local variables and arguments. Andrew Morton's mm series kernels are a good place to look for the kgdb stubs (for i386 and x86_64). Other wise you need to get used to debugging at the assembly language level. Good luck. Jim Houston - Concurrent Computer --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From kaos@sgi.com Sat Aug 28 18:09:49 2004 Received: with ECARTIS (v1.0.0; list kdb); Sat, 28 Aug 2004 18:09:55 -0700 (PDT) Received: from mail.ocs.com.au (mail.ocs.com.au [202.147.117.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i7T19mUi027158 for ; Sat, 28 Aug 2004 18:09:49 -0700 Received: from ocs3.ocs.com.au (ocs3.ocs.com.au [192.168.255.3]) by mail.ocs.com.au (Postfix) with ESMTP id C2A741800AB; Sun, 29 Aug 2004 11:09:28 +1000 (EST) Received: by ocs3.ocs.com.au (Postfix, from userid 16331) id 8C4ECC2183; Sun, 29 Aug 2004 11:09:28 +1000 (EST) Received: from ocs3.ocs.com.au (localhost [127.0.0.1]) by ocs3.ocs.com.au (Postfix) with ESMTP id 88EF01406E4; Sun, 29 Aug 2004 11:09:28 +1000 (EST) X-Mailer: exmh version 2.6.3_20040314 03/14/2004 with nmh-1.0.4 From: Keith Owens To: Timur Tabi Cc: kdb@oss.sgi.com Subject: Re: bt command shows wrong number of parameters In-reply-to: Your message of "Fri, 27 Aug 2004 14:21:45 EST." <412F89C9.9050606@ammasso.com> Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Date: Sun, 29 Aug 2004 11:09:27 +1000 Message-ID: <21523.1093741767@ocs3.ocs.com.au> Content-Transfer-Encoding: 8bit X-archive-position: 806 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kaos@sgi.com Precedence: bulk X-list: kdb On Fri, 27 Aug 2004 14:21:45 -0500, Timur Tabi wrote: >I'm new to kdb, so I'm sure this is a misunderstanding on my part, but >when I use the bt command to display a stack trace, I get this: > >[1]kdb> bt >Stack traceback for pid 18117 >0xf5864220 18117 18102 1 1 R 0xf58644b0 *cconfig >EBP EIP Function (args) >0xec7d9f6c 0xf8afdb02 [ccil]ccilioctl+0x562 (0x0, 0xf5875b80, 0x0, 0xf5875b80, 0x0) > ccil 0xf8afd5a0 0xf8afe0d0 >0xec7d9ef4 0xc0173844 chrdev_open+0xd4 (0xbffff130, 0xec7d9f90, 0xf7867d1c, 0xf5875b80, 0xc01670c7) > kernel 0xc0173770 0xc0173930 >0xec7d9fbc 0xc017da96 sys_ioctl+0x2d6 > kernel 0xc017d7c0 0xc017dc6c > 0xc01091a9 sysenter_past_esp+0x52 > kernel 0xc0109157 0xc01091d0 > >The problem is that the function ccilioctl() has only four parameters, >not five: man linux/Documentation/kdb/kdb_bt.man - "The bt command may print more arguments for a function ..." >int ccilioctl(struct inode * inode, struct file *f, volatile unsigned >int cmd, unsigned long arg) > >What does "(0x0, 0xf5875b80, 0x0, 0xf5875b80, 0x0)" mean? I seriously >doubt this is the parameter list for ccilioctl, even with the extra >number, because none of the four parameters are zero. It is possible for kdb to get the backtrace and arguments wrong, especially if the kernel is compiled without frame pointers. See kdb_bt.man. --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From kaos@sgi.com Sat Aug 28 19:42:29 2004 Received: with ECARTIS (v1.0.0; list kdb); Sat, 28 Aug 2004 19:42:33 -0700 (PDT) Received: from mail.ocs.com.au (mail.ocs.com.au [202.147.117.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i7T2gSAT028434 for ; Sat, 28 Aug 2004 19:42:29 -0700 Received: from ocs3.ocs.com.au (ocs3.ocs.com.au [192.168.255.3]) by mail.ocs.com.au (Postfix) with ESMTP id CBAEC1800AB for ; Sun, 29 Aug 2004 12:42:16 +1000 (EST) Received: by ocs3.ocs.com.au (Postfix, from userid 16331) id AE176C2183; Sun, 29 Aug 2004 12:42:15 +1000 (EST) Received: from ocs3.ocs.com.au (localhost [127.0.0.1]) by ocs3.ocs.com.au (Postfix) with ESMTP id 8B9DB1406E4 for ; Sun, 29 Aug 2004 12:42:15 +1000 (EST) X-Mailer: exmh version 2.6.3_20040314 03/14/2004 with nmh-1.0.4 From: Keith Owens To: kdb@oss.sgi.com Subject: Mirror of kdb files Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Date: Sun, 29 Aug 2004 12:42:14 +1000 Message-ID: <24027.1093747334@ocs3.ocs.com.au> Content-Transfer-Encoding: 8bit X-archive-position: 807 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kaos@sgi.com Precedence: bulk X-list: kdb Some people have problems accessing oss.sgi.com so I have created a mirror of the kdb files on ftp://ftp.ocs.com.au/pub/mirrors/oss.sgi.com/projects/kdb/download/ --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From philomena@deportista.com Tue Aug 31 10:44:28 2004 Received: with ECARTIS (v1.0.0; list kdb); Tue, 31 Aug 2004 10:44:31 -0700 (PDT) Received: from rrcs-central-70-60-4-131.biz.rr.com (sgqvlwvnzrr@rrcs-central-70-60-4-131.biz.rr.com [70.60.4.131]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id i7VHiKFa030021 for ; Tue, 31 Aug 2004 10:44:26 -0700 Message-Id: <200408311744.i7VHiKFa030021@oss.sgi.com> Date: Tue, 31 Aug 2004 17:29:15 +0000 From: janel To: kdb@oss.sgi.com Subject: - MIME-Version: 1.0 Content-type: text/plain; charset=Windows-1251 Content-Transfer-Encoding: 8bit X-archive-position: 808 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: philomena@deportista.com Precedence: bulk X-list: kdb --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From vladimir@acm.org Tue Aug 31 23:07:16 2004 Received: with ECARTIS (v1.0.0; list kdb); Tue, 31 Aug 2004 23:07:22 -0700 (PDT) Received: from bach.leonora.org (dsl081-052-249.sfo1.dsl.speakeasy.net [64.81.52.249]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i8167G0L031829 for ; Tue, 31 Aug 2004 23:07:16 -0700 Received: from bach.leonora.org (localhost.localdomain [127.0.0.1]) by bach.leonora.org (8.12.11/8.12.11) with ESMTP id i81675ES010142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 31 Aug 2004 23:07:05 -0700 Received: from bach.leonora.org (vladimir@localhost) by bach.leonora.org (8.12.11/8.12.11/Submit) with ESMTP id i81674r4010138 for ; Tue, 31 Aug 2004 23:07:05 -0700 Message-Id: <200409010607.i81674r4010138@bach.leonora.org> From: "Vladimir G. Ivanovic" To: kdb@oss.sgi.com Subject: Kernel build problem X-Mailer: MH-E 7.81; nmh 1.0.4; XEmacs 21.4 (patch 15) Date: Tue, 31 Aug 2004 23:07:04 -0700 X-archive-position: 809 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: vladimir@acm.org Precedence: bulk X-list: kdb I applied the KDB v4.4-2.6.9-rc1 patches to linux-2.6.8-1.533 (*), and now I get a strange build error: /usr/src/linux-2.6.8-1.533/arch/i386/kernel/entry.S: Assembler messages: /usr/src/linux-2.6.8-1.533/arch/i386/kernel/entry.S:431: Error: symbol `int80_ret_start_marker' is already defined /usr/src/linux-2.6.8-1.533/arch/i386/kernel/entry.S:431: Error: symbol `int80_ret_end_marker' is already defined Here's the compilation line that causes the error: gcc -Wp,-MD,arch/i386/kernel/.entry.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Iinclude2 -I/usr/src/linux-2.6.8-1.533/include -D__ASSEMBLY__ -I/usr/src/linux-2.6.8-1.533/include/asm-i386/mach-default -Iinclude/asm-i386/mach-default -m32 -traditional -m32 -c -o arch/i386/kernel/entry.o /usr/src/linux-2.6.8-1.533/arch/i386/kernel/entry.S But, here's the rub: int80_ret_start_marker is not being redefined at line 431 of entry.S AFAICT. If I grep through all the sources, I find that int80_ret_start_marker is only referenced twice: # find . -name "*[chS]" -exec fgrep -Hn int80_ret_end_marker {} \; ./arch/i386/kernel/entry.S:140: cmpl $int80_ret_end_marker, %eax; \ ./arch/i386/kernel/entry.S:171:int80_ret_end_marker: \ and neither of them are at line 431. What gives? Would someone illuminate me? Thanks. --- Vladimir (*) I applied the 2.6.9 KDB patches to the Fedora 2.6.8-1.533 sources instead of the 2.6.8 KDB patches because two 2.6.9 patches were applied to the Fedora 2.6.8-1.533 sources. All patches (except one) applied with fuzz factor of 3. The one that didn't was easily fixed. -- Vladimir G. Ivanovic http://leonora.org/~vladimir Palo Alto, CA 94306 +1 650 678 8014 --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.