This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[Committed] avr: correctly display NULL
- From: Tristan Gingold <gingold at adacore dot com>
- To: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Tue, 10 Nov 2009 11:05:24 +0100
- Subject: [Committed] avr: correctly display NULL
Hi,
because AVR is a true hardware architecture and because addresses in
the data space have an offset, NULL
pointers were not displayed as 0. This patch fix this issue by
special-casing 0.
Tristan.
2009-11-10 Tristan Gingold <gingold@adacore.com>
* avr-tdep.c (avr_make_saddr): Return 0 for NULL.
*** avr-tdep.c 10 Nov 2009 09:49:52 -0000 1.117
--- avr-tdep.c 10 Nov 2009 10:01:09 -0000
***************
*** 240,245 ****
--- 240,249 ----
static CORE_ADDR
avr_make_saddr (CORE_ADDR x)
{
+ /* Return 0 for NULL. */
+ if (x == 0)
+ return 0;
+
return ((x) | AVR_SMEM_START);
}