From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81972 invoked by alias); 28 Aug 2015 21:49:56 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 81941 invoked by uid 48); 28 Aug 2015 21:49:56 -0000 From: "msebor at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/18888] New: unable to evaluate NULL Date: Fri, 28 Aug 2015 21:49:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: 7.8 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q3/txt/msg00232.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18888 Bug ID: 18888 Summary: unable to evaluate NULL Product: gdb Version: 7.8 Status: NEW Severity: normal Priority: P2 Component: c++ Assignee: unassigned at sourceware dot org Reporter: msebor at redhat dot com Target Milestone: --- GNU gdb (GDB) Fedora 7.8.2-38.fc21 doesn't seem to know about GCC's __null extension used to implement the NULL macro. When the NULL macro is used in the definition of a function like macro as happens to be the case with some of the GCC tree checking macros such as DECL_ASSEMBLER_NAME_SET_P, GDB issues the cryptic error 'No symbol "__null" in current context.' when an attempt is to evaluate an invocation of the macro. This makes GCC debugging harder than it would be otherwise. (gdb) p DECL_ASSEMBLER_NAME_SET_P(expr) No symbol "__null" in current context. Test case: $ cat t.c && g++ -g3 t.c && gdb -batch -ex 'b main' -ex 'r' -ex 'macro expand FOO(p, 1, 2)' -ex 'p FOO(p, 1, 2)' a.out #include #define FOO(a, b, c) a == NULL ? b : c int main () { void *p = NULL; int n; n = FOO (p, 1, 2); return n; } Breakpoint 1 at 0x4005ba: file t.c, line 7. Breakpoint 1, main () at t.c:7 7 void *p = NULL; expands to: p == __null ? 1 : 2 No symbol "__null" in current context. -- You are receiving this mail because: You are on the CC list for the bug.