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] testsuite: Define and use gdb_target_symbol_prefix_flags_asm
Date: Fri, 06 Nov 2015 09:42:00 -0000	[thread overview]
Message-ID: <563C761D.9070401@redhat.com> (raw)
In-Reply-To: <20151105222822.2f41149f@pinnacle.lan>

On 11/06/2015 05:28 AM, Kevin Buettner wrote:
> +# It's possible to use this version (_asm) for C/C++ source files too,
> +# but a string is usually required in such files; providing a version
> +# (no _asm) which encloses the prefix with double quotes makes it
> +# somewhat easier to define the supporting macros in the test case.
> +
> +proc gdb_target_symbol_prefix_flags_asm {} {
> +    set prefix [gdb_target_symbol_prefix]
> +    if {$prefix ne ""} {
> +	return "additional_flags=-DSYMBOL_PREFIX=$prefix"
>      } else {
> -	return ""
> +	return "";
>      }
>  }
>  
> +# gdb_target_symbol_prefix_flags returns the same string as
> +# gdb_target_symbol_prefix_flags_asm, above, but with the prefix
> +# enclosed in double quotes if there is a prefix.
> +#
> +# See the comment for gdb_target_symbol_prefix_flags_asm for an
> +# extended discussion.
> +
> +proc gdb_target_symbol_prefix_flags {} {
> +    set flags [gdb_target_symbol_prefix_flags_asm]
> +    regsub {(DSYMBOL_PREFIX=)(.*)$} $flags {\1"\2"} flags
> +    return flags

Hmm, I think it'd end up simpler/less magic to remove the
indirection through gdb_target_symbol_prefix_flags_asm after all.
It's about the same number of worker lines, but no magic regex.
Like:

proc gdb_target_symbol_prefix_flags_asm {} {
    set prefix [gdb_target_symbol_prefix]
    if {$prefix ne ""} {
	return "additional_flags=-DSYMBOL_PREFIX=\"$prefix\""
    }
    return ""
}

WDYT?

Otherwise LGTM.

Thanks,
Pedro Alves


  reply	other threads:[~2015-11-06  9:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06  5:28 Kevin Buettner
2015-11-06  9:42 ` Pedro Alves [this message]
2015-11-06 13:25   ` Kevin Buettner
2015-11-07 18:12     ` 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=563C761D.9070401@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