Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: "Newman, Sarah R" <sarah.r.newman@lmco.com>
Cc: gdb@sources.redhat.com
Subject: Re: single stepping mips remote programs built with gcc 4.0
Date: Thu, 17 Nov 2005 20:23:00 -0000	[thread overview]
Message-ID: <20051117202324.GA22122@nevyn.them.org> (raw)
In-Reply-To: <5990BE666D0436419054489CDD9D505409EE88E9@emss01m10.us.lmco.com>

On Thu, Nov 17, 2005 at 12:13:48PM -0800, Newman, Sarah R wrote:
> Hi, I have a version of gdb from CVS on 8/29/2005.  I have configured with the target as mips-elf and the host as cygwin and I am using it to connect to a remote mips system.  All of my programs I am trying to run remotely have been built with GCC 4+.  I am single stepping through code where part of it consists of something like the following in the disassembly listing:
> 
> 00003dac <initialize()>:
> 00003dac:	24040001 	li	a0,1
> 00003db0:	08000deb 	j	000037ac <setArraySize(int, int)>
> 00003db4:	24050001 	li	a1,1
> 
> 00003db8 <getCurrentBuffer2(int&)>:
> 00003db8:	3c02bd00 	lui	v0,0xbd00
> 
> When stopped at the beginning of the function, I can tell by looking
> at the remote protocol debug output that a breakpoint is being set in
> memory at the location of getCurrentBuffer2, not setArraySize.  We
> suspect that this may have to do with GCC 4+ doing straight jumps to
> other functions and not jump and link followed by jump register to
> leave the function.  Has anyone else encountered this or found a
> solution?

Could you please build a debuggable GDB binary, and trace through
mips32_next_pc?  It looks like it should handle the 'j' instruction
just fine:

        case 2:         /* J */
        case 3:         /* JAL */
          {
            unsigned long reg;
            reg = jtype_target (inst) << 2;
            /* Upper four bits get never changed... */
            pc = reg + ((pc + 4) & 0xf0000000);
          }
          break;

J and JAL share a format, so this should be correct.  It's as if the
value GDB is extracting for the instruction is incorrect.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


  reply	other threads:[~2005-11-17 20:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-17 20:13 Newman, Sarah R
2005-11-17 20:23 ` Daniel Jacobowitz [this message]
2005-11-17 22:39 Newman, Sarah R
2005-11-17 22:48 ` Daniel Jacobowitz
2005-11-22  5:26 Newman, Sarah R
2005-11-22 19:24 ` Daniel Jacobowitz
2005-11-23  0:50 ` Jim Blandy
2005-11-22 19:48 Newman, Sarah R
2005-11-22 20:00 Newman, Sarah R
2005-11-23  3:09 Newman, Sarah R

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=20051117202324.GA22122@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb@sources.redhat.com \
    --cc=sarah.r.newman@lmco.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