Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb.dwarf2: Define and use gdb_target_symbol_prefix for symbol prefixes
Date: Thu, 05 Nov 2015 10:14:00 -0000	[thread overview]
Message-ID: <563B2BF1.2050007@redhat.com> (raw)
In-Reply-To: <20151104144908.320110e1@pinnacle.lan>

On 11/04/2015 09:49 PM, Kevin Buettner wrote:
> On Fri, 30 Oct 2015 11:06:09 +0000
> Pedro Alves <palves@redhat.com> wrote:
> 
>> On 10/30/2015 04:25 AM, Kevin Buettner wrote:
>>
>>> +# gdb_target_symbol_prefix compiles a test program and uses readelf
>>> +# to determine the prefix (such as underscore) for linker symbol
>>> +# prefixes.
>>> +
>>> +proc gdb_target_symbol_prefix {} {
>>
>> Shouldn't this be gdb_caching_proc ?
> 
> Yes, it should. I've fixed this in my new patch.

Thanks Kevin.  This version generally looks good to me.  Some comments
below.

> 
>> Then T wonder whether something like:
>>
>> -                    DW_OP_addr table_2_ptr
>> +                    DW_OP_addr [gdb_symbol table_2_ptr]
>>
>> instead of prepending the $prefix variable results in clearer
>> test code.
> 
> I like this idea too. I used the name 'gdb_target_symbol' for this.
> 
> Defining the obvious proc (for gdb_target_symbol) worked out of the
> box for all cases except gdb.dwarf2/atomic-type.exp.  For that I
> needed to make a change to lib/dwarf.exp (and learned a bit more about
> tcl in the process).  If you know of a cleaner way to code it, let me
> know - I couldn't think of a way to do it without adding the if-else
> statement.

Not sure I see what makes gdb.dwarf2/atomic-type.exp different?
E.g., the gdb.dwarf2/dw2-bad-mips-linkage-name.exp hunk looks quite
similar.  What makes gdb.dwarf2/atomic-type.exp special?

> With regard to gdb_target_symbol_prefix_flags, I think I'll change
> it to call the new gdb_target_symbol_prefix.  That seems preferable
> to hardcoding a bunch of targets.  If it all works out, I'll submit a
> separate patch.

Yes, please, that's the idea.  :-)

> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index 048070b..e1c9839 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -5521,6 +5521,54 @@ proc core_find {binfile {deletefiles {}} {arg ""}} {
>      return $destcore
>  }
>  
> +# gdb_target_symbol_prefix compiles a test program and uses readelf to

s/readelf/objdump/

> +# determine the prefix (such as underscore) for linker symbol
> +# prefixes.
> +
> +gdb_caching_proc gdb_target_symbol_prefix {
> +    # Set up and compile a simple test program...

Thanks,
Pedro Alves


  reply	other threads:[~2015-11-05 10:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30 11:06 Kevin Buettner
2015-10-30 12:06 ` Kevin Buettner
2015-10-30 15:53   ` Pedro Alves
2015-11-05  6:39     ` Kevin Buettner
2015-11-05 10:46       ` Pedro Alves
2015-11-05 10:55         ` Pedro Alves
2015-11-06  5:33           ` Kevin Buettner
2015-10-30 15:51 ` Pedro Alves
2015-11-04 21:49   ` Kevin Buettner
2015-11-05 10:14     ` Pedro Alves [this message]
2015-11-05 20:01       ` Kevin Buettner
2015-11-05 21:19         ` Pedro Alves
2015-11-05 22:26           ` Kevin Buettner

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=563B2BF1.2050007@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.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