[Fwd: Kernel debugging with gdb]

Mahesh Jethanandani (mahesh@cisco.com)
Tue, 16 Dec 1997 17:13:44 -0800


This is a multi-part message in MIME format.
--------------80B965C37FAAD1641698D4CB
Content-Type: multipart/alternative; boundary="------------701D2D4638513511063E7CA2"

--------------701D2D4638513511063E7CA2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

--
Mahesh Jethanandani

|\/\/\/| | mahesh@cisco.com | \ /| LIFE'S COMPLEX - IT HAS | Cisco Systems Inc. | (o)(o) REAL & IMAGINARY PARTS | 170 West Tasman Drive C _) | San Jose, CA 95134 | \___| | (408) 527-8230 | / All Std. Disclaimers apply. | (408) 527-8254(fax)

--------------701D2D4638513511063E7CA2 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit

 

-- 
Mahesh Jethanandani

|\/\/\/|                              |      mahesh@cisco.com
|  \  /|   LIFE'S COMPLEX - IT HAS    |      Cisco Systems Inc.
| (o)(o)   REAL & IMAGINARY PARTS     |      170 West Tasman Drive
C      _)                             |      San Jose, CA 95134
| \___|                               |      (408) 527-8230
 |   /   All Std. Disclaimers apply.  |      (408) 527-8254(fax)
 

--------------701D2D4638513511063E7CA2--

--------------80B965C37FAAD1641698D4CB Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline

Message-ID: <3495E74A.92BD1667@cisco.com> Date: Mon, 15 Dec 1997 18:28:27 -0800 From: Mahesh Jethanandani <mahesh@cisco.com> Organization: Cisco Systems, Inc. X-Mailer: Mozilla 4.02 [en] (X11; U; SunOS 5.5.1 sun4u) MIME-Version: 1.0 To: Majordomo@vger.rutgers.edu Subject: Kernel debugging with gdb Content-Type: multipart/alternative; boundary="------------E84B74B9058087A74D83194B"

--------------E84B74B9058087A74D83194B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit

I picked up the gdbstub-2.0.30 utility and patches to enable me to run gdb on a 2.0.30 kernel which I got from redhat-4.2. However, I seem to be running into an issue when I try to start gdbstub on the target machine with the following command

/usr/local/bin/gdbstub -s 38400 -t /dev/ttyS0 <<EOF

EOF

I see the following output in /var/log/messages:

Nov 30 18:17:42 capetown kernel: gdb_hook_interrupt: set_debug_traps() Nov 30 18:17:42 capetown kernel: gdb_hook_interrupt: breakpoint() Nov 30 18:17:42 capetown kernel: int3: 0000 Nov 30 18:17:42 capetown kernel: CPU: 0 Nov 30 18:17:42 capetown kernel: EIP: 0010:[sleep_on+74/124] Nov 30 18:17:42 capetown kernel: EFLAGS: 00000202 Nov 30 18:17:42 capetown kernel: eax: 00000021 ebx: 001d08a0 ecx: 001ca888 edx: 0194f018 Nov 30 18:17:42 capetown kernel: esi: 00b47000 edi: 08048698 ebp: 001d08a0 esp: 00c90f20 Nov 30 18:17:42 capetown kernel: ds: 0018 es: 0018 fs: 002b gs: 002b ss: 0018 Nov 30 18:17:42 capetown kernel: Process gdbstub (pid: 717, process nr: 60, stackpage=00c90000) Nov 30 18:17:42 capetown kernel: Stack: 0017de5a 001bcdc8 001bcda1 00000000 0017cc62 001d08a0 00000000 00000000 Nov 30 18:17:42 capetown kernel: 08048698 00b47000 0000037d 0101d098 00000001 00000000 00c03414 019886c8 Nov 30 18:17:42 capetown kernel: 00124d36 01988698 00180067 00b47000 011f9f00 0000545e 00000000 011f9f00 Nov 30 18:17:42 capetown kernel: Call Trace: [init_dev+1018/1376] [rs_init+954/996] [refile_buffer+402/804] [n_tty_receive_buf+1551/2852] [fcntl_setlk+194/372] [system_call+85/124] Nov 30 18:17:42 capetown kernel: Code: c3 90 83 ec 08 57 8d 44 24 08 89 44 24 04 50 e8 1e 00 00 00

On looking further, I notice that when I take the above trap, I fall into DO_VM86_ERROR(). I do not understand why? What am I doing wrong?

--
Mahesh Jethanandani

|\/\/\/| | mahesh@cisco.com | \ /| LIFE'S COMPLEX - IT HAS | Cisco Systems Inc. | (o)(o) REAL & IMAGINARY PARTS | 170 West Tasman Drive C _) | San Jose, CA 95134 | \___| | (408) 527-8230 | / All Std. Disclaimers apply. | (408) 527-8254(fax)

--------------E84B74B9058087A74D83194B Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit

I picked up the gdbstub-2.0.30 utility and patches to enable me to run gdb on a 2.0.30 kernel which I got from redhat-4.2. However, I seem to be running into an issue when I try to start gdbstub on the target machine with the following command

/usr/local/bin/gdbstub -s 38400 -t /dev/ttyS0 <<EOF

EOF

I see the following output in /var/log/messages:

Nov 30 18:17:42 capetown kernel: gdb_hook_interrupt: set_debug_traps()
Nov 30 18:17:42 capetown kernel: gdb_hook_interrupt: breakpoint()
Nov 30 18:17:42 capetown kernel: int3: 0000
Nov 30 18:17:42 capetown kernel: CPU:    0
Nov 30 18:17:42 capetown kernel: EIP:    0010:[sleep_on+74/124]
Nov 30 18:17:42 capetown kernel: EFLAGS: 00000202
Nov 30 18:17:42 capetown kernel: eax: 00000021   ebx: 001d08a0   ecx: 001ca888   edx: 0194f018
Nov 30 18:17:42 capetown kernel: esi: 00b47000   edi: 08048698   ebp: 001d08a0   esp: 00c90f20
Nov 30 18:17:42 capetown kernel: ds: 0018   es: 0018   fs: 002b   gs: 002b   ss: 0018
Nov 30 18:17:42 capetown kernel: Process gdbstub (pid: 717, process nr: 60, stackpage=00c90000)
Nov 30 18:17:42 capetown kernel: Stack: 0017de5a 001bcdc8 001bcda1 00000000 0017cc62 001d08a0 00000000 00000000
Nov 30 18:17:42 capetown kernel:        08048698 00b47000 0000037d 0101d098 00000001 00000000 00c03414 019886c8
Nov 30 18:17:42 capetown kernel:        00124d36 01988698 00180067 00b47000 011f9f00 0000545e 00000000 011f9f00
Nov 30 18:17:42 capetown kernel: Call Trace: [init_dev+1018/1376] [rs_init+954/996] [refile_buffer+402/804] [n_tty_receive_buf+1551/2852] [fcntl_setlk+194/372] [system_call+85/124]
Nov 30 18:17:42 capetown kernel: Code: c3 90 83 ec 08 57 8d 44 24 08 89 44 24 04 50 e8 1e 00 00 00

On looking further, I notice that when I take the above trap, I fall into DO_VM86_ERROR(). I do not understand why? What am I doing wrong?

-- 
Mahesh Jethanandani

|\/\/\/|                              |      mahesh@cisco.com
|  \  /|   LIFE'S COMPLEX - IT HAS    |      Cisco Systems Inc.
| (o)(o)   REAL & IMAGINARY PARTS     |      170 West Tasman Drive
C      _)                             |      San Jose, CA 95134
| \___|                               |      (408) 527-8230
 |   /   All Std. Disclaimers apply.  |      (408) 527-8254(fax)
 

--------------E84B74B9058087A74D83194B--

--------------80B965C37FAAD1641698D4CB--