Re: line numbers in error messages are off wrt debuggers

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: line numbers in error messages are off wrt debuggers
Дата
Msg-id 21004.1529511146@sss.pgh.pa.us
обсуждение исходный текст
Ответ на line numbers in error messages are off wrt debuggers  (Andres Freund <andres@anarazel.de>)
Ответы Re: line numbers in error messages are off wrt debuggers  (Andres Freund <andres@anarazel.de>)
Re: line numbers in error messages are off wrt debuggers  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
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.

(No, I won't hold still for a coding requirement that all ereport calls
be smashed onto a single line ;-))

Personally, my habit is to set the breakpoint at errfinish, which works
independently of just where the call is.

            regards, tom lane


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: PATCH: backtraces for error messages
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: pgsql: Store 2PC GID in commit/abort WAL recs for logicaldecoding