Skip to content

Conversation

@ChrisJefferson
Copy link
Contributor

Previously, line/file info was added to trace methods.

This info wasn't in 'trying next' lines, or constructors. Now it is.

First I show some new output, then the old output below. Notice more lines now have file:line info.

The remaining missing lines are:

  • system getter : There is no line number :)
  • =: for infinity and cyclotomic : This is just set to ReturnFalse, which is a system call. In general, these line numbers are the actual functions, not the location of the InstallMethod, which some users might want, but we can't sensibly store anyway.

I'd like to put this patch into 4.8 as well, but I'm happy if we decide it shouldn't be.

gap> TraceAllMethods();;
gap> Union(Rationals, Integers);;
#I  Size: system getter
#I  =: for `infinity' and cyclotomic
#I  Size: system getter
#I  =: for `infinity' and cyclotomic
#I  Union2: for two times the same ring (ResClasses) at /Users/caj/reps/gap/gap/pkg/resclasses/lib/resclass.gi:1716
#I  =: for certain cyclotomic semirings at /Users/caj/reps/gap/gap/lib/cyclotom.gi:2020
#I  CollectionsFamily: for a family at /Users/caj/reps/gap/gap/lib/coll.gi:22
#I  Setter(ElementsFamily): method to inherit `Characteristic' to collections families at /Users/caj/reps/gap/gap/lib/arith.gi:604
#I Trying next: Setter(ElementsFamily): system setter
#I  Setter(CollectionsFamily): system setter
#I  PositionProperty: for dense list and function at /Users/caj/reps/gap/gap/lib/list.gi:1546
#I  PositionProperty: for dense list and function at /Users/caj/reps/gap/gap/lib/list.gi:1546
#I Trying next: Union2: for two collections at /Users/caj/reps/gap/gap/lib/coll.gi:2554
#I Trying next: Union2: for two classes/lists/collections at /Users/caj/reps/gap/gap/pkg/crisp/lib/classes.gi:695
#I  InfoLevel at /Users/caj/reps/gap/gap/lib/info.gi:281
#I  InfoLevel at /Users/caj/reps/gap/gap/lib/info.gi:281
gap> NewFloat(FLOAT_DEFAULT_REP, 1.234);;
#I  NewFloat at /Users/caj/reps/gap/gap/lib/float.gi:124
gap>
gap> TraceAllMethods();;
gap> Union(Rationals, Integers);;
#I  Size: system getter
#I  =: for `infinity' and cyclotomic
#I  Size: system getter
#I  =: for `infinity' and cyclotomic
#I  Union2: for two times the same ring (ResClasses) at /Users/caj/reps/gap/gap-clean/pkg/resclasses/lib/resclass.gi:1281
#I  =: for certain cyclotomic semirings at /Users/caj/reps/gap/gap-clean/lib/cyclotom.gi:2020
#I  CollectionsFamily: for a family at /Users/caj/reps/gap/gap-clean/lib/coll.gi:22
#I  Setter(ElementsFamily): method to inherit `Characteristic' to collections families at /Users/caj/reps/gap/gap-clean/lib/arith.gi:604
#I  trying next: Setter(ElementsFamily): system setter
#I  Setter(CollectionsFamily): system setter
#I  PositionProperty: for dense list and function at /Users/caj/reps/gap/gap-clean/lib/list.gi:1546
#I  PositionProperty: for dense list and function at /Users/caj/reps/gap/gap-clean/lib/list.gi:1546
#I  trying next: Union2: for two collections
#I  trying next: Union2: for two classes/lists/collections
#I  InfoLevel at /Users/caj/reps/gap/gap-clean/lib/info.gi:281
#I  InfoLevel at /Users/caj/reps/gap/gap-clean/lib/info.gi:281
gap> NewFloat(FLOAT_DEFAULT_REP, 1.234);;
#I  NewFloat

STARTLINE_FUNC(methods[(arity+4)*(i-1)+(arity+2)]));
fi;
Print("\n");
end;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading methods[(arity+4)*(i-1)+(arity+2)] three times in a row like this makes my eyes bleed :-P. Could you perhaps put it into a local variable? That would make the code easier to understand, too.

@fingolfin
Copy link
Member

Seems like a good idea (with one minor nitpick).

@olexandr-konovalov
Copy link
Member

I don't mind this going into stable-4.8, as stable already has many places where line numbers are reported (after introducing a variable for (arity+4)*(i-1)+(arity+2)).

@ChrisJefferson ChrisJefferson mentioned this pull request Mar 4, 2016
@ChrisJefferson
Copy link
Contributor Author

Moved to #655 (as github doesn't let me change what branch a pull request applies to)

@ChrisJefferson ChrisJefferson deleted the trace-improvements branch April 15, 2016 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants