GDB aborts on missing command args. Which way to fix?

Tom Tromey tromey@redhat.com
Fri Sep 19 21:52:00 GMT 2008


>>>>> "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



More information about the Gdb-patches mailing list