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]

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


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


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