mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] BUG() disassembly tweak
Date: Sat, 11 May 2002 11:34:07 +1000	[thread overview]
Message-ID: <2764.1021080847@ocs3.intra.ocs.com.au> (raw)
In-Reply-To: Your message of "Sat, 11 May 2002 02:04:02 +0100." <Pine.LNX.4.21.0205110122430.1215-100000@localhost.localdomain>

On Sat, 11 May 2002 02:04:02 +0100 (BST), 
Hugh Dickins <hugh@veritas.com> wrote:
>I thought I was the only one dissatisfied (that a disassembler cannot
>make sense of this line number and filename pointer dumped into the
>instruction stream after the ud2: laugh at the ingenious instructions
>ksymoops shows after the ud2 these days).

IMNSHO the instructions _after_ the oops are almost useless.  I would
be much happier to see all architectures display the code line like
this (from alpha):

Code: 44220001  f4200003  46520400 <a77d9c38> 6b9b4a40  a44803a8  42425401  42c10403  40603401

Showing instructions either side of the oops and marking the
instruction pointer with <>.  Even that version displays too much data
after the oops, for debugging you need more instructions leading up to
the failure and fewer instructions afterwards.

The variable length i386 instructions are a problem, finding a decent
start point is tricky.  ksymoops handles up to 64 bytes of code so
dumping EIP-56:EIP+8 would increase the chance of the disassembler
syncing to the correct instructions.  To be absolutely sure, dump two
code lines on i386.

Code: EIP-56 ... <EIP> ... EIP+8
Code: EIP ... EIP+8

The second line starts with EIP and does not have <> around any values,
it guarantees that we get a clean decode of the failing instruction.
ksymoops will print both code lines, which makes the decoded trace look
a little strange, but it is worth it to get better debugging.  For
architectures with fixed length instructions this is not a problem.

Code: c6 05 00 00 00 00 00 <eb> e7 8d 76 00 b8 00 e0 ff ff 21 e0 ff 

>>EIP; c0113f8c No symbols available   <=====

...

Code;  c0113f85 No symbols available
00000000 <_EIP>:
Code;  c0113f85 No symbols available
   0:   c6 05 00 00 00 00 00      movb   $0x0,0x0
Code;  c0113f8c No symbols available   <=====
   7:   eb e7                     jmp    fffffff0 <_EIP+0xfffffff0> c0113f75 No symbols available   <=====
Code;  c0113f8e No symbols available
   9:   8d 76 00                  lea    0x0(%esi),%esi
Code;  c0113f91 No symbols available
   c:   b8 00 e0 ff ff            mov    $0xffffe000,%eax
Code;  c0113f96 No symbols available
  11:   21 e0                     and    %esp,%eax
Code;  c0113f98 No symbols available
  13:   ff 00                     incl   (%eax)

Code: eb e7 8d 76 00 b8 00 e0 (second code line, no <>)


Code;  c0113f8c No symbols available
00000000 <_EIP>:
Code;  c0113f8c No symbols available
   0:   eb e7                     jmp    ffffffe9 <_EIP+0xffffffe9> c0113f75 No symbols available
Code;  c0113f8e No symbols available
   2:   8d 76 00                  lea    0x0(%esi),%esi
Code;  c0113f91 No symbols available
   5:   b8 00 e0 00 00            mov    $0xe000,%eax


  reply	other threads:[~2002-05-11  1:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-10 21:22 Hugh Dickins
2002-05-10 22:10 ` Linus Torvalds
2002-05-10 22:51   ` Dave Jones
2002-05-11 11:42     ` Ingo Oeser
2002-05-10 22:58   ` Andrew Morton
2002-05-11  0:00     ` Keith Owens
2002-05-11  1:58       ` Hugh Dickins
2002-05-11  2:32         ` Kai Germaschewski
2002-05-11  3:03         ` Keith Owens
2002-05-11  1:04   ` Hugh Dickins
2002-05-11  1:34     ` Keith Owens [this message]
2002-05-11  1:39       ` Keith Owens
2002-05-11  2:07       ` Hugh Dickins
2002-05-11  2:21         ` Keith Owens
2002-05-13 15:31 ` Hugh Dickins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2764.1021080847@ocs3.intra.ocs.com.au \
    --to=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®