public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix calling debuginfo-less functions in Ada
Date: Wed, 19 Apr 2023 13:33:09 -0700	[thread overview]
Message-ID: <7de29fb8-f5d4-897e-026c-ad2432f466e2@redhat.com> (raw)
In-Reply-To: <20230417134149.511889-1-tromey@adacore.com>

On 4/17/23 06:41, Tom Tromey via Gdb-patches wrote:
> A co-worker at AdaCore noticed that calling a function without
> debuginfo yields:
> 
> (gdb) print plus_one(23)
> 'pck.plus_one' has unknown return type; cast the call to its declared return type
> 
> However, this also happens if you follow the directions and add the
> cast.
> 
> This patch fixes the problem and adds a regression test.

I'm no Ada expert (or even novice!), but I do have one tiny question/comment.

> diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
> index 4395f31ad94..211aa77e366 100644
> --- a/gdb/testsuite/lib/ada.exp
> +++ b/gdb/testsuite/lib/ada.exp
> @@ -66,7 +66,9 @@ proc gdb_compile_ada_1 {source dest type options} {
>       # and it avoids using a stray objfile file from a long-past
>       # run, for instance.
>       append options " ada"
> -    append options " additional_flags=-f"
> +    if {[lsearch -exact $options no-force] == -1} {
> +	append options " additional_flags=-f"
> +    }
>       append options " additional_flags=-I$srcdir"
>   
>       set result [target_compile_ada_from_dir \

This "no-force" option is new -- should it be mentioned somewhere?

I'm just thinking that if I end up hacking on this sometime, it
would save me some grief to see any/all Ada-specific options listed
or explained somewhere. [I guess this is really the first one, though.]

Otherwise, I see no issues with your patch.

Keith


  reply	other threads:[~2023-04-19 20:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17 13:41 Tom Tromey
2023-04-19 20:33 ` Keith Seitz [this message]
2023-04-24 16:39   ` Tom Tromey
2023-05-12 18:12 ` Tom Tromey

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=7de29fb8-f5d4-897e-026c-ad2432f466e2@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).