This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);
  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]