This is the mail archive of the gdb@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: What has replaced fork to launch external commands?


On Mon, 2003-02-17 at 17:27, Daniel Jacobowitz wrote:
> <snip>
> > > Meanwhile you can probably roughly use "shell" if I'm understanding
> > > what you're doing.
> > 
> > Mmm, tried that but it ends up echoing gdb server stuff to the gdb
> > command line.
> 
> Eh?  An example, please?  I guess it depends what the fork command is
> actually _doing_.

I modified the _connectsh4 script command:

define _connectsh4
  set endian $arg0
  set architecture sh4

  if ($NoPosixConsole)
  # fork shlaunch -si $arg0 -gdbserv host=$arg1 -cid0 host=$arg1
noposixconsole
  printf "Attempting to fork gdbserver NoPosixConsole\n"
  shell /opt/STM/ST40R2.0.5/bin/shlaunch -si $arg0 -gdbserv host=$arg1
-cid0 host=$arg1 noposixconsole &
  else
  if ($KeepPosixConsole)
  #fork shlaunch -si $arg0 -gdbserv host=$arg1 -cid0 host=$arg1
keepposixopen
  shell /opt/STM/ST40R2.0.5/bin/shlaunch -si $arg0 -gdbserv host=$arg1 
-cid0 host=$arg1 keepposixopen &
  printf "Attempting to fork gdbserver KeepPosixConsole\n"
  else
  # fork shlaunch -si $arg0 -gdbserv host=$arg1 -cid0 host=$arg1
  shell /opt/STM/ST40R2.0.5/bin/shlaunch -si $arg0 -gdbserv host=$arg1
-cid0 host=$arg1 &
  printf "Attempting to fork gdbserver\n"
  end
  end

  if (!$SHLaunchErrorCode)
  $arg2
  end
end

And gdb fails with:
[alex@cambridge linux-2.4.20]$ ~/sources/gdb/gdb-5.3-sh/gdb/gdb -nw -x
loadlinux
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=sh4-gnu-linux".
`uX~a1Missing argument 1 in user function.

I'm *assuming* the `uX bit is part of the gdbserver protocol getting
echoed back. Once I've finsihed checking out the gdb source I may be
able to see what this fork command does different from the shell command
already provided. I assume something subtle otherwise why add the
feature instead of enhancing shell?

-- 
Alex, homepage: http://www.bennee.com/~alex/

Whenever I date a guy, I think, is this the man I want my children
to spend their weekends with?
		-- Rita Rudner


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