Improve Assert output

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Improve Assert output
Дата
Msg-id 6c68efe3-117a-dcc1-73d4-18ba1ec532e2@2ndquadrant.com
обсуждение исходный текст
Ответы Re: Improve Assert output  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
This kind of output is usually not helpful:

TRAP: BadArgument("((context) != ((void *)0) && (((((const
Node*)((context)))->type) == T_AllocSetContext) || ((((const
Node*)((context)))->type) == T_SlabContext) || ((((const
Node*)((context)))->type) == T_GenerationContext)))", File:
"../../../../src/include/utils/memutils.h", Line: 129)

What we probably want is something like:

TRAP: BadArgument("MemoryContextIsValid(context)", File:
"../../../../src/include/utils/memutils.h", Line: 129)

The problem is that the way the Assert macros are written they
macro-expand the arguments before stringifying them.  The attached patch
fixes that.  This requires both replacing CppAsString by plain "#" and
not redirecting Assert() to Trap().

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Improve Assert output