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]

Re: PATCH: gdb --args


>>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:

[ reopening the --args discussion; I have a new question ]

Andrew> The system being debugged will have:

Andrew> - an interface to control the target being debugged In GDB
Andrew> that is the target.[hc] jumbo object.  GDB uses this interface
Andrew> to perform operations such as step, continue, kill and start
Andrew> the system being debugged.  It might use ptrace, procfs,
Andrew> remote or nothing (core).

Andrew> - an interface describing the systems ISA, ABI and OS In GDB
Andrew> that is the gdbarch.[hc] jumbo object.  GDB calls on the
Andrew> gdbarch object when doing things that are dependant on the
Andrew> target architecture rather than the details of the target
Andrew> interface.  For instance, shared library support, an OS
Andrew> feature, is managed by gdbarch and not the target vector.

Andrew> I think what you're doing is independant of the control interface 
Andrew> (target.[hc]) but is target operating system dependant.  Hence 
Andrew> suggesting that it live in gdbarch.

Thanks.  This is very clear and I understand what you mean now.

My question is: is it really the case that argument quoting is
independent of the control interface?

My concern here is that if quoting (the --args code) and dequoting
(the fork-an-inferior code) are handled separately, they could
conceivably become out of sync.

I don't know of examples where this could happen, but then, I don't
know gdb all that well either.  (And I especially can't predict the
future, which is where some possible problem may lie :-)


I can make up what I think is a plausible example though.  Suppose
someone invents a new way to start a Unix inferior.  Say, some server
which knows how to launch and debug ordinary Unix processes and which
talks to gdb via a socket.

Now, if whoever writes this decides to use a different quoting scheme
than the current gdb, trouble will result -- gdb will quote arguments
using the Unix convention (the ISA, ABI and OS will be identical to
the native platform), but the control interface will expect them to be
quoted using the new server's convention.

That's just one example.  There are probably other ways these things
can get out of sync.


Maybe this is an impossible scenario.  I don't know.  I just want to
make sure that separating these two things won't result in some sort
of gdbarch/target disagreement at some future date.  I'd prefer to
understand this point before I rewrite the --args patch to use
gdbarch.

Tom


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