This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug cli/14977] printf dies with null string
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Wed, 14 Mar 2018 15:51:12 +0000
- Subject: [Bug cli/14977] printf dies with null string
- Auto-submitted: auto-generated
- References: <bug-14977-4717@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=14977
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3ae9ce5dd7d1119ca2c94c63a07b04921048ebe3
commit 3ae9ce5dd7d1119ca2c94c63a07b04921048ebe3
Author: Tom Tromey <tom@tromey.com>
Date: Wed Feb 14 20:11:16 2018 -0700
Special case NULL when using printf's %s format
This changes the printf command's %s and %ls formats to special-case
NULL, and print "(null)" for these. This is PR cli/14977. This
behavior seems a bit friendlier; I was undecided on whether other
invalid pointers should be handled specially somehow, so for the time
being I've left those out.
gdb/ChangeLog
2018-03-14 Tom Tromey <tom@tromey.com>
PR cli/14977:
* printcmd.c (printf_c_string, printf_wide_c_string): Special case
for NULL.
gdb/gdbserver/ChangeLog
2018-03-14 Tom Tromey <tom@tromey.com>
PR cli/14977:
* ax.c (ax_printf): Special case for NULL.
gdb/testsuite/ChangeLog
2018-03-14 Tom Tromey <tom@tromey.com>
PR cli/14977:
* gdb.base/printcmds.exp (test_printf): Add printf test of %s with
a null pointer.
* gdb.base/wchar.exp: Likewise.
--
You are receiving this mail because:
You are on the CC list for the bug.