[RFA 3/3] Special case NULL when using printf's %s format
Pedro Alves
palves@redhat.com
Fri Feb 16 12:08:00 GMT 2018
On 02/15/2018 08:50 PM, Tom Tromey wrote:
> 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.
A question here is what to do on targets that actually map things at
address zero. IIRC, some ARM chips do that. For such ports, I think you'd
want to be able to read/print that memory. I thought we had a gdbarch hook
for that, but I'm not finding it right now. Maybe I was thinking of
has_section_at_zero in dwarf2read.c.
Thanks,
Pedro Alves
More information about the Gdb-patches
mailing list