Re: line numbers in error messages are off wrt debuggers

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: line numbers in error messages are off wrt debuggers
Дата
Msg-id 20180620164015.mfqhj754bgymcjiz@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: line numbers in error messages are off wrt debuggers  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: line numbers in error messages are off wrt debuggers  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2018-06-20 12:12:26 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > I'm fairly frequently annoyed that when I see an error message in the
> > log, I can't just generally set a breakpoint on the included line
> > number. That's because the line number in the error message is from the
> > *end* of the message:
> 
> IME it varies depending on which compiler you use; some report the line
> where the ereport is.  So I'm doubtful that there's going to be much we
> can do about it.  Probably this behavior is bound up with macro expansion
> vs. just when __LINE__ is expanded.

Seems it can be hacked around: https://stackoverflow.com/a/13497879

But yikes, that's ugly.

There's apparenty some discussion in the standard committees trying to
unify the behaviour across compilers, but ...

Greetings,

Andres Freund


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Avoiding Tablespace path collision for primary and standby
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Avoiding Tablespace path collision for primary and standby