Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Kwok Cheung Yeung <kwok_yeung@mentor.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix gdb.dwarf2/dw2-dir-file-name.exp test for MIPS architectures
Date: Fri, 17 Oct 2014 12:07:00 -0000	[thread overview]
Message-ID: <5441066B.7000402@redhat.com> (raw)
In-Reply-To: <54399A91.8000006@mentor.com>

On 10/11/2014 10:01 PM, Kwok Cheung Yeung wrote:
> This patch fixes the failures that occur with the 
> gdb.dwarf2/dw2-dir-file-name.exp test on 64-bit MIPS and compressed MIPS 
> ISAs (i.e. MIPS16 and microMIPS).
> 
> The failures on 64-bit occur because the generated DWARF address 
> information is always 32-bit, which causes the upper 32-bits of 
> addresses to be truncated and causes breakpoints to be set on the wrong 
> address if any of the upper 32-bits are non-zero. I suspect that other 
> 64-bit architectures get away with it because they place all their 
> instructions at a VMA lower than 2^32 by default. This patch causes 
> 64-bit addresses to be generated if a 64-bit target is detected.
> 
> The failures on MIPS16 and microMIPS occur because the breakpoint 
> address needs to have the LSB set to 1 (used to indicate that the code 
> is compressed). However, the function name is interpreted as a data 
> label, causing GDB to set breakpoints at even addresses. This is fixed 
> by explicitly adding a '.insn' directive (see 
> https://sourceware.org/binutils/docs/as/MIPS-insn.html) after the label 
> on MIPS only.

Looks fine to me, but I'd like to hear Maciej's OK on the MIPS  specifics too.

Please make sure x86_64 still works.

I wonder if this test could be simplified using the testsuite's dwarf
assembler (Dwarf::assemble).

> 
> Kwok
> 
> 2014-08-14  Kwok Cheung Yeung  <kcy@codesourcery.com>
> 
> 	gdb/testsuite/
> 	* gdb.dwarf2/dw2-dir-file-name.exp (addr_len): New.
> 	(out_cu): Use addr_len for the size of addresses.
> 	(out_line): Likewise.  Size DW_LNE_set_address instruction
> 	according to addr_len.
> 	* gdb.dwarf2/dw2-dir-file-name.c (START_INSNS): New.
> 	(FUNC): Add START_INSNS to definition.
> 


Thanks,
Pedro Alves


  reply	other threads:[~2014-10-17 12:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-11 21:01 Kwok Cheung Yeung
2014-10-17 12:07 ` Pedro Alves [this message]
2014-10-17 22:29   ` Kwok Cheung Yeung
2014-10-17 23:17     ` Doug Evans
2014-10-21 22:26     ` Maciej W. Rozycki

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=5441066B.7000402@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kwok_yeung@mentor.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