proposal: better stack trace support could advantageously replace implicit __FILE__/__LINE__ parameters

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat Aug 17 01:54:32 PDT 2013


On 8/17/13, Timothee Cour <thelastmammoth at gmail.com> wrote:
> 1) impossible to have variadic arguments with an extra file/line parameters
> at the end (unless one makes those file/line as compile time parameters but
> that makes template code bloat), which would be very useful for debugging

This is a more general problem, I hope we can solve this one day.
http://d.puremagic.com/issues/show_bug.cgi?id=8687

> Furthermore, if we later want to add more information to the context (eg
> __MODULE__,__FUNCTION__, __COLUMN__ or __ARGUMENTS__), we would have to
> refactor a lot of code.

P.S. __MODULE__, __FUNCTION__ and __PRETTY_FUNCTION__ were added in 2.063.

Anywho, I agree it's a bit tedious having to explicitly use these as
parameters.

I once suggested to have a single __CONTEXT__ parameter which held
various caller information inside of a struct (e.g. a struct with a
file, line, function fields), it would at least make it easier to use
since it would be just one parameter instead of several, but I didn't
get a positive response for the feature.


More information about the Digitalmars-d mailing list