public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Carl Love <cel@us.ibm.com>, Bruno Larsen <blarsen@redhat.com>,
	gdb-patches@sourceware.org,
	UlrichWeigand <Ulrich.Weigand@de.ibm.com>,
	pedro@palves.net
Cc: luis.machado@arm.com
Subject: Re: [PATCH 1/2] Fix reverse stepping multiple contiguous PC ranges over the line table.
Date: Fri, 23 Jun 2023 13:44:32 -0400	[thread overview]
Message-ID: <4ab1e3ff-eede-5573-f58f-63ff8b1e23bb@simark.ca> (raw)
In-Reply-To: <95df539fed378baea3dd679bb10d33c57260f318.camel@us.ibm.com>



On 6/22/23 12:52, Carl Love wrote:
> 
> Simon:
> 
> On Mon, 2023-06-19 at 13:11 -0400, Simon Marchi wrote:
>>> --- a/gdb/testsuite/lib/gdb.exp
>>> +++ b/gdb/testsuite/lib/gdb.exp
>>> @@ -4794,6 +4794,8 @@ proc quote_for_host { args } {
>>>   #     debug information
>>>   #   - text_segment=addr: Tell the linker to place the text
>>> segment at ADDR.
>>>   #   - build-id: Ensure the final binary includes a build-id.
>>> +#   - no-column-info: Disable generation of column table
>>> information.
>>> +#   - column-info: Enable generation of column table information.
>>>   #
>>>   # And here are some of the not too obscure options understood by
>>> DejaGnu that
>>>   # influence the compilation:
>>> @@ -5003,6 +5005,34 @@ proc gdb_compile {source dest type options}
>>> {
>>>               } else {
>>>                   error "Don't know how to handle text_segment
>>> option."
>>>               }
>>> +     } elseif { $opt == "column-info" } {
>>> +         if {[test_compiler_info {gcc-*}]} {
>>> +             if {[test_compiler_info {gcc-[1-6]-*}]} {
>>> +                 error "gdb_compile option no-column-info not
>>> supported."
>>
>> I think this path should return the equivalent of "failed to
>> compile",
>> instead of throwing an error.  Control will go back to the test,
>> which
>> will generally skip the portion of the test that requires that
>> binary.
> 
> Not entirely sure how to accomplish what you are looking for.
> 
> I change:
>   error "gdb_compile option no-column-info not supported."
> to
>   set result "option no-column-info not supported."
>   clone_output "gdb compile failed, $result"
>   return 1
> 
> When I force the if {[test_compiler_info...]} tp be true to test this,
> I get:
> 
>    get_compiler_info: gcc-12-2-1
>    gdb compile failed, option no-column-info not supported.
>    UNTESTED: gdb.reverse/func-map-to-same-line.exp:
>    with_column_info=yes: failed t\
>    o prepare
>    testcase /home/carll/GDB/build-reverse-multiple-
>    contiguous/gdb/testsuite/../../\
>    ../binutils-gdb-reverse-multiple-
>    contiguous/gdb/testsuite/gdb.reverse/func-map-\
>    to-same-line.exp completed in 0 seconds
> 
>                    === gdb Summary ===
> 
>    # of untested testcases         1
> 
> The test case doesn't have any part of the test that doesn't require
> compiling so it is not clear if that would work with this fix.  Anyway,
> wanted to run that by you to see if this is an appropriate fix?  I am
> really not sure about it.  Thanks.

I think that's the expected behavior.  The UNTESTED is emitted by
build_executable_from_specs, I think.  If the test used gdb_compile, I
think we wouldn't see an UNTESTED.  But as far as your addition is
concerned, I think it's fine.

I just thought of a simpler alternative though.  Just remove the version
check.  If we build with an older gcc, there will simply be a message
that says that the flag is not recognized, and the result should be just
the same.  I just hacked it locally and changed the flag name to be
wrong (I don't have a gcc <= 6 on hand to test).  It looks like:

    Executing on host: gcc  -fno-stack-protector  -fdiagnostics-color=never -gcolumn-info-foo -c -g  -o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.reverse/func-map-to-same-line/func-map-to-same-line0.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.reverse/func-map-to-same-line.c    (timeout = 300)
    builtin_spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -gcolumn-info-foo -c -g -o /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.reverse/func-map-to-same-line/func-map-to-same-line0.o /home/simark/src/binutils-gdb/gdb/testsuite/gdb.reverse/func-map-to-same-line.c

    gcc: error: unrecognized debug output level 'column-info-foo'

    compiler exited with status 1
    output is:
    gcc: error: unrecognized debug output level 'column-info-foo'


    gdb compile failed, gcc: error: unrecognized debug output level 'column-info-foo'
    UNTESTED: gdb.reverse/func-map-to-same-line.exp: with_column_info=yes: failed to prepare

I then thought about the "no-column-info" case.  Currently, you error
out for gccs <= 6.  However, shouldn't we just compile without any
special flag in that case, since there just wasn't any support for
column-info back then?

Simon

  reply	other threads:[~2023-06-23 17:44 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 20:59 [PATCH] " Carl Love
2023-05-02 14:15 ` Bruno Larsen
2023-05-02 15:40   ` Carl Love
2023-05-02 15:42     ` Bruno Larsen
2023-05-11 15:11   ` Simon Marchi
2023-05-03  9:53 ` Bruno Larsen
2023-05-04  2:55   ` Carl Love
2023-05-04  9:24     ` Bruno Larsen
2023-05-04 14:52       ` Carl Love
2023-05-04  2:55   ` [PATCH v2] " Carl Love
2023-05-04 15:59     ` [PATCH v3] " Carl Love
2023-05-05 14:59       ` Luis Machado
2023-05-05 16:10         ` Carl Love
2023-05-10 13:47       ` Bruno Larsen
2023-05-10 17:16         ` Carl Love
2023-05-10 17:32           ` [PATCH v4] " Carl Love
2023-05-11 16:01             ` Simon Marchi
2023-05-11 16:23               ` Bruno Larsen
2023-05-11 17:28                 ` Simon Marchi
2023-05-16 22:54                   ` [PATCH 1/2] " Carl Love
2023-06-19 17:11                     ` Simon Marchi
2023-06-22 16:52                       ` Carl Love
2023-06-23 17:44                         ` Simon Marchi [this message]
2023-06-23 19:41                           ` Carl Love
2023-06-23 20:04                           ` [PATCH 1/2 ver 2] " Carl Love
2023-07-06 15:07                             ` Carl Love
2023-05-16 22:54                   ` [PATCH 2/2 v5] " Carl Love
2023-05-25 15:08                     ` Carl Love
2023-06-08 16:36                       ` Carl Love
2023-06-19 17:58                     ` Simon Marchi
2023-06-22 20:38                       ` Carl Love
2023-06-22 20:39                         ` Carl Love
2023-06-23 17:49                         ` Simon Marchi
2023-06-23 20:04                       ` Carl Love
2023-06-23 20:04                       ` [PATCH 2/2 v6] " Carl Love
2023-05-16 22:54               ` [PATCH v4] " Carl Love
2023-05-11  7:52           ` [PATCH v3] " Bruno Larsen

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=4ab1e3ff-eede-5573-f58f-63ff8b1e23bb@simark.ca \
    --to=simark@simark.ca \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=blarsen@redhat.com \
    --cc=cel@us.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@arm.com \
    --cc=pedro@palves.net \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).