From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21423 invoked by alias); 13 May 2004 09:50:27 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 21395 invoked from network); 13 May 2004 09:50:20 -0000 Received: from unknown (HELO r-kk.iij4u.or.jp) (210.130.0.73) by sourceware.org with SMTP; 13 May 2004 09:50:20 -0000 Received: from oreo.montavista.co.jp (sonicwall.montavista.co.jp [202.232.97.131]) by r-kk.iij4u.or.jp (8.11.6+IIJ/8.11.6) with ESMTP id i4D9oH514604 for ; Thu, 13 May 2004 18:50:18 +0900 (JST) Date: Thu, 13 May 2004 09:50:00 -0000 From: Hiroshi DOYU To: gdb@sources.redhat.com Subject: Where is the contents of target_fetch_registers () Message-Id: <20040513185017.6220543b.Hiroshi_DOYU@montavista.co.jp> Organization: MontaVista Software Japan Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2004-05/txt/msg00080.txt.bz2 Hi all, Now I am implementing gdb support on Linux kernel, Hitachi SH-Mobile3 (SH73180CP01) and found that the following function seems not to work correctly when compared with other gdb behavior which work correctly. # I can get this with "set debug target 1" option in gdb. gdb a.out GNU gdb 6.0 (MontaVista 6.0-8.0.7.0300532 2003-12-24) Copyright 2003 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "sh-hardhat-linux"... (gdb) list 2 { 3 int a, b, c; 4 5 a = b + c; 6 } 7 8 main() 9 { 10 while (1) 11 func(); (gdb) b func Breakpoint 1 at 0x400356: file a.c, line 5. (gdb) set debug target 1 (gdb) r Starting program: /root/a.out target_acknowledge_created_inferior (103) target_reported_exec_events_per_exec_call () = 1 target_wait (-1, status) = 103, status->kind = stopped, signal = SIGTRAP target_fetch_registers (pc) = a06b5529 0x29556ba0 693463968 target_terminal_init () target_terminal_inferior () target_terminal_inferior () target_resume (-1, continue, 0) target_wait (-1, status) = 103, status->kind = stopped, signal = SIGTRAP target_fetch_registers (pc) = a06b5529 0x29556ba0 693463968 target_post_startup_inferior (103) target_xfer_memory (0x4104f4, xxx, 176, read, xxx) = 176, bytes = 01 00 00 00 01 00 00 00 0c 00 00 00 e0 01 40 00 0d 00 00 00 80 04 40 00 04 00 00 00 08 01 40 00 05 00 00 00 58 01 40 00 06 00 00 00 28 01 40 00 0a 00 00 00 2d 00 00 00 0b 00 00 00 10 00 00 00 15 00 00 00 00 00 00 00 03 00 00 00 b8 05 41 00 02 00 00 00 18 00 00 00 14 00 00 00 07 00 00 00 17 00 00 00 ac 01 40 00 fe ff ff 6f 8c 01 40 00 ff ff ff 6f 01 00 00 00 f0 ff ff 6f 86 01 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 target_xfer_memory (0x400356, xxx, 2, read, xxx) = 2, bytes = e1 51 target_xfer_memory (0x400356, xxx, 2, write, xxx) = 2, bytes = c3 c3 target_insert_breakpoint (0x400356, xxx) = 0 target_xfer_memory (0x295613b0, xxx, 2, read, xxx) = 2, bytes = e6 2f target_xfer_memory (0x295613b0, xxx, 2, write, xxx) = 2, bytes = c3 c3 target_insert_breakpoint (0x295613b0, xxx) = 0 target_terminal_inferior () target_resume (-1, continue, 0) target_wait (-1, status) = 103, status->kind = stopped, signal = SIGTRAP target_fetch_registers (pc) = b0135629 0x295613b0 693506992 target_xfer_memory (0x400356, xxx, 2, write, xxx) = 2, bytes = e1 51 target_remove_breakpoint (0x400356, xxx) = 0 target_xfer_memory (0x295613b0, xxx, 2, write, xxx) = 2, bytes = e6 2f target_remove_breakpoint (0x295613b0, xxx) = 0 target_terminal_ours_for_output () target_xfer_memory (0x4104f4, xxx, 176, read, xxx) = 176, bytes = 01 00 00 00 01 00 00 00 0c 00 00 00 e0 01 40 00 0d 00 00 00 80 04 40 00 04 00 00 00 08 01 40 00 05 00 00 00 58 01 40 00 06 00 00 00 28 01 40 00 0a 00 00 00 2d 00 00 00 0b 00 00 00 10 00 00 00 15 00 00 00 3c 94 57 29 03 00 00 00 b8 05 41 00 02 00 00 00 18 00 00 00 14 00 00 00 07 00 00 00 17 00 00 00 ac 01 40 00 fe ff ff 6f 8c 01 40 00 ff ff ff 6f 01 00 00 00 f0 ff ff 6f 86 01 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 target_xfer_memory (0x29579440, xxx, 4, read, xxx) = 4, bytes = 50 94 57 29 target_xfer_memory (0x29579450, xxx, 20, read, xxx) = 20, bytes = 00 00 00 00 f8 69 56 29 f4 04 41 00 18 99 57 29 00 00 00 00 target_xfer_memory (0x29579918, xxx, 20, read, xxx) = 20, bytes = 00 a0 57 29 08 99 57 29 bc 20 6a 29 b4 90 57 29 50 94 57 29 target_xfer_memory (0x29579908, xxx, 4, read, xxx) = 4, bytes = 2f 6c 69 62 target_xfer_memory (0x2957990c, xxx, 4, read, xxx) = 4, bytes = 2f 6c 69 62 target_xfer_memory (0x29579910, xxx, 4, read, xxx) = 4, bytes = 63 2e 73 6f target_xfer_memory (0x29579914, xxx, 4, read, xxx) = 4, bytes = 2e 36 00 00 target_xfer_memory (0x295790b4, xxx, 20, read, xxx) = 20, bytes = 00 60 55 29 f4 00 40 00 d0 8e 57 29 00 00 00 00 18 99 57 29 target_xfer_memory (0x4000f4, xxx, 4, read, xxx) = 4, bytes = 2f 6c 69 62 target_xfer_memory (0x4000f8, xxx, 4, read, xxx) = 4, bytes = 2f 6c 64 2d target_xfer_memory (0x4000fc, xxx, 4, read, xxx) = 4, bytes = 6c 69 6e 75 target_xfer_memory (0x400100, xxx, 4, read, xxx) = 4, bytes = 78 2e 73 6f target_xfer_memory (0x400104, xxx, 4, read, xxx) = 4, bytes = 2e 32 00 00 I guess the following should have appeaer at this line. target_fetch_registers (r14) = 34f9ff7b 0x7bfff934 2080373044 I would like to look into the problem which it hang at the above point but I dont know much about gdb. So could anyone tell me how to find where is the contents of "target_fetch_registers ()"? In other words, in Linux, how can gdb get the registers from kernel? Any comments will be appriciated. Thanks, -doyu