This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/4] 'catch syscall' feature -- XML support part
>>>>> "SÃrgio" == SÃrgio Durigan JÃnior <sergiodj@linux.vnet.ibm.com> writes:
Tom> This will make an entry with an empty name given the above XML
Tom> snippet. But that doesn't seem helpful... if this triggers, won't it
Tom> print as an unnamed syscall? It seems to me that it would be
Tom> preferable to skip nameless ones and just report them numerically, if
Tom> they occur.
SÃrgio> I'm sorry, but I think I didn't understand completely what you
SÃrgio> suggested. You mean that I should set the syscall name to NULL when
SÃrgio> there's no name for it in the XML file?
I think nameless syscalls should simply not be in the table at all.
SÃrgio> + if (gdb_xml_parse (parser, document) == 0)
SÃrgio> + {
SÃrgio> + /* Parsed successfully. */
SÃrgio> + discard_cleanups (result_cleanup);
SÃrgio> + do_cleanups (back_to);
SÃrgio> + return data.sysinfo;
SÃrgio> + }
SÃrgio> + else
SÃrgio> + {
SÃrgio> + warning (_("Could not load XML syscalls info; ignoring"));
SÃrgio> + do_cleanups (back_to);
SÃrgio> + return NULL;
Tom>
Tom> ... you can either just do_ or discard_ result_cleanup instead.
SÃrgio> I'm sorry, instead of what? do_cleanups? :-)
I think instead of the above you can simply:
if (...)
...
discard_cleanups (result_cleanup);
else
...
do_cleanups (result_cleanup);
Tom