This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: "maint print arch" causing gdb crash
- From: Stan Shebs <stanshebs at earthlink dot net>
- To: gdb-patches at sourceware dot org
- Date: Fri, 05 Oct 2012 15:05:18 -0700
- Subject: Re: "maint print arch" causing gdb crash
- References: <506EEAEC.2010604@codesourcery.com>
On 10/5/12 7:13 AM, ali_anwar wrote:
Hi,
'gdbarch_dump' is in some cases passing a NULL pointer to 'sprintf'
when printing 'gdbarch->stap_gdb_register_suffix' etc. Printing NULL
pointers like this is undefined behavior. With glibc passing a NULL
pointer just prints "(null)". With the MSVC libc, however, GDB crashes.
Attached patch fixes this issue using the similar approach discussed
in following scenario:
http://sourceware.org/ml/gdb-patches/2011-10/msg00662.html
There are some newly added variables due to which "maint print arch"
command was causing gdb crash on whindows host. This patch takes care
of them.
OK?
Yes please, this is good!
Stan
stan@codesourcery.com