This is the mail archive of the gdb-cvs@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]

src/gdb ChangeLog NEWS value.c doc/ChangeLog d ...


CVSROOT:	/cvs/src
Module name:	src
Changes by:	sergiodj@sourceware.org	2013-09-16 17:47:30

Modified files:
	gdb            : ChangeLog NEWS value.c 
	gdb/doc        : ChangeLog gdb.texinfo 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.base: gdbvars.c gdbvars.exp 

Log message:
	Based on the discussion at:
	
	<https://sourceware.org/ml/gdb-patches/2013-09/msg00301.html>
	<https://sourceware.org/ml/gdb-patches/2013-09/msg00383.html>
	
	This patch adds a new convenience function called $_isvoid, whose
	only purpose is to check whether an expression is void or not.
	This became necessary because the new convenience variable
	$_exitsignal (not yet approved) has a mutual exclusive behavior
	with $_exitcode, i.e., when one is "defined" (i.e., non-void),
	the other is cleared (i.e., becomes void).  Doug wanted a way to
	identify which variable to use, and checking for voidness is the
	obvious solution.
	
	It is worth mentioning that my first attempt, after a conversation with
	Doug, was to actually implement a new $_isdefined() convenience
	function.  I would do that (for convenience variables) by calling
	lookup_only_internalvar.  However, I found a few problems:
	
	- Whenever I called $_isdefined ($variable), $variable became defined
	(with a void value), and $_isdefined always returned true.
	
	- Then, I tried to implement $_isdefined ("variable"), and do the "$" +
	"variable" inside GDB, thus making it impossible for GDB to create the
	convenience variable.  However, it was hard to extract the string
	without having to mess with values and their idiossincrasies.
	Therefore, I decided to abandon this attempt (specially because I
	didn't want to spend too much time struggling with it).
	
	Anyway, after talking to Doug again we decided that it would be easier
	to implement $_isvoid, and this will probably help in cases like
	<http://stackoverflow.com/questions/3744554/testing-if-a-gdb-convenience-variable-is-defined>.
	
	I wrote a NEWS entry for it, and some new lines on the documentation.
	
	gdb/
	2013-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>
	
	* NEWS: Mention new convenience function $_isvoid.
	* value.c (isvoid_internal_fn): New function.
	(_initialize_values): Add new convenience function $_isvoid.
	
	gdb/doc/
	2013-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>
	
	* gdb.texinfo (Convenience Functions): Mention new convenience
	function $_isvoid.
	
	gdb/testsuite/
	2013-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>
	
	* gdb.base/gdbvars.c (foo_void): New function.
	(foo_int): Likewise.
	* gdb.base/gdbvars.exp (test_convenience_functions): New
	function.  Call it.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15998&r2=1.15999
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/NEWS.diff?cvsroot=src&r1=1.613&r2=1.614
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/value.c.diff?cvsroot=src&r1=1.182&r2=1.183
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/ChangeLog.diff?cvsroot=src&r1=1.1488&r2=1.1489
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/gdb.texinfo.diff?cvsroot=src&r1=1.1110&r2=1.1111
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3804&r2=1.3805
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/gdbvars.c.diff?cvsroot=src&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/gdbvars.exp.diff?cvsroot=src&r1=1.16&r2=1.17


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