Feature request/question: breaking on specific function argument values

42 views
Skip to first unread message

Eugene Pirogov

unread,
Jul 26, 2017, 7:13:00 AM7/26/17
to elixir-lang-core
Would it be possible to implement break on a specific function clause? Right now it's possible to break on a function with a particular arity:

IEx.Pry.break(Ecto.Repo.Schema, :dump_field!, 6, 100)

But usually during debugging I'm waiting for a specific argument to be passed, so ideally I'd like to do this:

IEx.Pry.break(Ecto.Repo.Schema, :dump_field!, [_, _, _, :birth_date, ~D[1996-12-12], _])

Right now every time I get to the break point, I check if the field is :birth_date, and the date is the one I'm interested. If they are not – I move on to the next break point via continue. It is a manual process, so I wonder if it make sense (and also whether it is technically possible) to break by matching on argument values.

José Valim

unread,
Jul 26, 2017, 7:23:31 AM7/26/17
to elixir-l...@googlegroups.com
This is definitely possible in case someone is looking to implement it. What the break point system does is to recompile the module with a case clause that triggers the breakpoint. Therefore you should be able to get the behaviour above as long as you change the breakpoint system to compile a pattern match on those arguments. Please open up an issue and we may be able to add this on Elixir v1.6.



José Valim
Skype: jv.ptec
Founder and Director of R&D

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/ddc62f85-b0bf-4651-b1a0-0bae0594d787%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages