Re: [PATCH 3/4] 'catch syscall' feature -- XML support part

Tom Tromey
2008-11-07T18:24:50Z

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