Re: Ada compile with -fvar-tracking

Carl Love
2023-11-16T16:11:55Z

Luis, Tom:

On Thu, 2023-11-16 at 14:02 +0000, Luis Machado wrote:
> On 11/14/23 21:17, Carl Love wrote:
> > Tom:
> >
> > On Tue, 2023-11-14 at 12:40 -0700, Tom Tromey wrote:
> > > set flags {debug additional_flags=-cargs additional_flags=-fvar-
> > > tracking additional_flags=-margs}
> >
> > So I put that in as follows:
> >
> > set flags {debug additional_flags=-cargs additional_flags=-fvar-
> > tracking additional_flags=-margs}
>
> I guess one way to make the above slightly cleaner (debatable) is to
> append the additional flags on different lines:
>
> set flags {"debug"}
> lappend flags "additional_flags=-cargs"
> lappend flags "additional_flags=-fvar-tracking"
> lappend flags "additional_flags=-margs"
>
> Slightly more verbose, but may make the additional flags more
> explicit/easier to read.

Yes, I do think that is easier to read.

So I worked on the patch some more once I got it to compile to see if I
need all three options on PowerPC. On Power, I only seem to need the
-fvar-tracking option. The -cargs and -margs don't seem to have any
effect on PowerPC. It looks like the following is all that I need on
Power:

--- a/gdb/testsuite/gdb.ada/finish-large.exp
+++ b/gdb/testsuite/gdb.ada/finish-large.exp
@@ -19,7 +19,13 @@ require allow_ada_tests

standard_ada_testfile p

-if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} {
+if {[have_fvar_tracking]} {
+ set flags {debug additional_flags=-fvar-tracking}
+} else {
+ set flags {debug}
+}
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != ""} {
return -1

I think Power is the only platform that needs -fvar-tracking for this
test so I was inclined to leave off the other two options. But if not
having the other two options with -fvar-tracking causes issues on other
platforms then I should include them.

Tom, for your platform do you have to have all three options or not?

I tested the above patch on PowerPC and X86-64. It seems to work fine
on both systems.

Carl