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: [patch] Fix `return' of long/long-long results with no debuginfo


> The issue is that it relies on parsing the output of printf, which
> doesn't work against remote targets that don't implement some kind
> of semi-hosting io, like gdbserver.

Yeah - the worse part is that I saw the use of printf, frowned on it,
but let it go because I didn't see a quick way of avoiding it. Lessons
learned for me.

> 2009-03-18  Pedro Alves  <pedro@codesourcery.com>
> 
> 	* return-nodebug.c: Don't include stdio.h.
> 	(init): Delete.
> 	(func): Delete definition and provide extern declaration.
> 	(t): New.
> 	(main): Don't call printf.  Call func and store its result in t.
> 	* return-nodebug1.c: New.
> 	* return-nodebug.exp: Don't expect stdio output.  Instead, print
> 	the global variable t.  Drop printf formatters and cast types from
> 	foreach loop.  Don't use prepare_for_testing.  Compile
> 	return-nodebug.c and return-nodebug1.c in separate steps.  Don't
> 	define FORMAT or CAST.

Looks great to me.

In the future, don't feel obliged to fix it yourself unless you want to.
I can help fix my own messes...

-- 
Joel


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