Re: cleanup some tests

Daniel Jacobowitz <drow <at> false.org>
2006-07-03 15:48:59 GMT

On Fri, Jun 09, 2006 at 09:48:33PM +0100, Nathan Sidwell wrote:
> This patch cleans up a number of spurious test failures I encountered
>
> When using a remote stub to talk to a board, I found it necessary to run to
> main, in order to syncronize the debugger correctly.
This change is wrong. After the patch:
gdb_test "break main" ".*Breakpoint.* at .*" "set breakpoint at main"
gdb_run_cmd
# initial sal should be first statement in main
gdb_test "list" \
"v0 = 0;" \
"list before run"
You're no longer testing list-before-run. Probably the trouble comes
from the fact that gdb_load starts the program running on remote
targets. I bet that what you want is to replace the gdb_load with
gdb_file_cmd, and then do a gdb_load before the runto_main.
Secondly, gdb_run_cmd starts the program running. If you want to issue
another command, you've got to wait for it to stop first. Which boils
down to runto_main, already used just below.
> The remote.exp changes are obvious, when one looks at gdb's source.
No it's not I bet you made this patch against the csl branch. I
hacked download_write_size on that branch; Vlad's been looking at this
a little closer. 512 is right for mainline.

Re: cleanup some tests

Nathan Sidwell <nathan <at> codesourcery.com>
2006-07-04 09:41:32 GMT

Daniel Jacobowitz wrote:
> Want to post and commit the approved bits, and then we can look at the
> rest?
I've committed this patch for the approved bits. I'll investigate the other
points and repost once I have a solution.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
nathan <at> codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk

Here is an improved version of my previous patch. According to
suggestions I received, I've renamed target_read_whole to the hopefully
clearer target_read_object_alloc (since it reads an entire object, and
allocates memory for it). I've eliminated the extra use of
target_read; the code to use target_read_partial directly is slightly
more complicated, but more efficient and overall more sensible. And:
the _partial methods are no longer exported! Roughly no one ever wants
to use them; use target_read or target_read_object_alloc instead.
Any further comments on this patch?
--
--
Daniel Jacobowitz
CodeSourcery
2006-07-05 Daniel Jacobowitz <dan <at> codesourcery.com>
* target.c (target_read): Stop if target_read_partial returns 0
when some bytes have already been read.
(target_write): Likewise for target_write_partial.
(target_read_partial, target_write_partial): Make static.
(target_read_object_alloc): New.
* target.h: Doc fixes.
(target_read_partial, target_write_partial): Delete prototypes.
(target_read_object_alloc): New prototype.
* auxv.c (target_auxv_read): Delete.
(target_auxv_search, fprint_target_auxv): Use target_read_object_alloc.
* auxv.h (target_auxv_read): Delete prototype.
* avr-tdep.c (avr_io_reg_read_command): Use target_read_object_alloc.