This is the mail archive of the gdb-patches@sources.redhat.com 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: [RFA] Fix testsuite gdb.base/bang.exp to work with remote targets


On Monday 02 February 2004 13:32, Daniel Jacobowitz wrote:
> How about gdb_run_cmd?

Initially I tried that and had some problems, but I just went back and tried
the following:

  gdb_run_cmd
  gdb_expect {
    -re ".*Program exited normally\." {
        pass "run program"
    }
   timeout {
        fail "run program (timeout)"
    }
  }

which worked:

  (gdb) jump *start
  No symbol "start" in current context.
  (gdb) jump *_start
  Continuing at 0x1016.
  0
 
  *** EXIT code 0
 
  Program exited normally.
  PASS: gdb.base/bang.exp: run program

I'm not sure what happened the first time I tried gdb_run_cmd.

However, there is some precedence for just checking use_gdb_stub to
decide whether to "run" or "continue" as there are several other
places in the testsuite where this is done.  Though it could be argued
that perhaps they should be converted to use gdb_run_cmd also.

On the other hand, I'm not entirely comfortable with some of the
assumptions made in gdb_run_cmd, such as jumping to "start" or
"_start".  I've seen some load images in the past that don't
necessarily have the starting address in the image set to "start" or
"_start", but instead do things like have it set to a reset vector at
address zero that jumps to some other place in the image and
eventually ends up going through "start".

It would also be nice to know what this comment in
gdb_run_cmd is all about:

  # This doesn't work quite right yet.

-Fred



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