This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: GDB aborts on missing command args. Which way to fix?
- From: Tom Tromey <tromey at redhat dot com>
- To: "Paul Pluzhnikov" <ppluzhnikov at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 19 Sep 2008 15:50:03 -0600
- Subject: Re: GDB aborts on missing command args. Which way to fix?
- References: <8ac60eac0809161049t6bd917bbk8127317a7d8b42cb@mail.gmail.com>
- Reply-to: tromey at redhat dot com
>>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:
Paul> There are many instances of calls to buildargv() which aren't
Paul> protected by 'if (args != NULL)', and cause gdb to abort.
[...]
Paul> I can fix this by adding the 'if (args != NULL)' checks everywhere,
Paul> or by switching to 'buildargv_not_null(args, "appropriate missing
Paul> argument error")'
Paul> Which way is preferred? (I prefer the second way).
That seems reasonable to me.
I think you might as well make it call nomem if the result is NULL,
too.
Tom