Hi,

I'm working on a port of gdb 5.0 for one my company's, and I've spent
the last couple of weeks adding support for that target system to
DejaGnu. There some issues with the display.c/display.exp pair of files
in the gdb.base directory that I find somewhat peculiar:

1.) In the display.exp file, provided that gdb_stub is defined in the
target_info vector, gdb_step_for_stub is called *before* gdb_load (and
some other functions as well). gdb_step_for_stub steps out of a
breakpoint that has been compiled into the program. How could that work
if the executable hasn't been loaded into the target? Looking at the
other test cases in gdb.base, it seems as if the display test case is
the only one trying to pull off this stunt.

2.) Related to the one above; in display.c, main() looks like this:

   main()
   {
       do_loops();
       do_vars();
   }

   It seems like it's missing the usual block of:

   #ifdef usestubs
       set_debug_traps();
       breakpoint();
   #endif

   That is, even if the call to gdb_step_for_stub was to occur after the
executable was loaded into the target, there would be no breakpoint to
step out of.

3.) display.c includes stdio.h, but doesn't reference any of the
functions in it.  I don't have stdio.h on my target system, and I
suspect that this is the case elsewhere also, but since no printf or
other stdio function appears in the source code, there is nothing for
the linker to complain about when compiling the source code. Later, when
display.exp runs, it simply presupposes that printf is there, and calls
it on the target. Should the expect script rely on printf being there
solely on the basis of #include <stdio.h> in the test case source code?
Or should it test it by some other means?

Orjan

Reply via email to