Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Jun Sun <jsun@mvista.com>
To: linux-mips@oss.sgi.com
Subject: gdb 5.0 display arguments problem
Date: Mon, 19 Mar 2001 14:49:32 -0800	[thread overview]
Message-ID: <3AB68CFC.A2840808@mvista.com> (raw)


I am using gdb 5.0 client to debug kernel, and found a bug in gdb 5.0 when it
trys to display an function argument.

The following is the relavent code segment where breakpoint is set to the
first instruction of serial_console_write().

00000000801270ac <serial_console_write>:
    801270ac:   3c04801d        lui     $a0,0x801d
    801270b0:   8c84bc1c        lw      $a0,-17380($a0)
    801270b4:   27bdffc0        addiu   $sp,$sp,-64
    801270b8:   afb40028        sw      $s4,40($sp)
    801270bc:   00a0a021        move    $s4,$a1
    801270c0:   24050001        li      $a1,1

For whatever reason gdb client on the host side apparently thinks the second
arg is stored in register s4.  When the breakpoint is hit, gdb tries to
display the value of s4 (which is 0x4 in this case).  Since the type of this
argument is char *, gdb further tries to read the content at 0x4 which causes
kernel panic.

I believe I have seen this problem before (and in most case the symptom is
wrong argument values instead of kernel panic).  Does someone have an idea how
to fix it or work around it? 

Does this problem exist in native debugging?

I assume we can disable gdb to display char strings by default.  Does someone
know how to do it?

Thanks.

Jun

             reply	other threads:[~2001-03-19 22:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-19 22:49 Jun Sun [this message]
2001-03-20  0:18 ` gdb 5.0 display arguments problem Kevin D. Kissell
2001-03-20  0:18   ` Kevin D. Kissell
2001-03-20  9:09   ` Kevin D. Kissell
2001-03-20  9:09     ` Kevin D. Kissell
2001-03-20 19:26     ` Jun Sun
2001-03-20 22:16       ` Kevin D. Kissell
2001-03-20 22:16         ` Kevin D. Kissell

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=3AB68CFC.A2840808@mvista.com \
    --to=jsun@mvista.com \
    --cc=linux-mips@oss.sgi.com \
    /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