From: Joel Brobecker Date: Fri, 19 Oct 2012 19:55:56 +0000 (+0000) Subject: Document exp_descriptor.op_name should never return NULL. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a5b1262727001de95f76936d2462e92fe183a8e7;p=binutils-gdb.git Document exp_descriptor.op_name should never return NULL. This documents a constaint that struct exp_descriptor's "op_name" method implementation should obey. This might not have been part of the initial design, but is currently true of all instantiations, and already assumed by the current users. gdb/ChangeLog: * parser-defs.h (struct exp_descriptor): Document constraint on return value for "op_name" callbacks. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b344cbacca8..96c9cfaf8d1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-10-19 Joel Brobecker + + * parser-defs.h (struct exp_descriptor): Document constraint + on return value for "op_name" callbacks. + 2012-10-18 Tom Tromey * tracepoint.c (print_one_static_tracepoint_marker): Constify. diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index 86f3bdf1063..c889d56e0b0 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -335,7 +335,10 @@ struct exp_descriptor void *data), void *data); - /* Name of this operator for dumping purposes. */ + /* Name of this operator for dumping purposes. + The returned value should never be NULL, even if EXP_OPCODE is + an unknown opcode (a string containing an image of the numeric + value of the opcode can be returned, for instance). */ char *(*op_name) (enum exp_opcode); /* Dump the rest of this (prefix) expression after the operator