This is the mail archive of the 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 <> writes:

>> 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.

Andrew> As they say, someonebody elses problem.  You've met your
Andrew> contractual obligations by transforming argv into a correctly
Andrew> quoted string and then passed it to the target interface.

I looked into this some more today.  There is still a lot I don't

First, the gdbarch approach seems to require many more changes than
the target vector approach.  For instance, my understanding is that
since i386 isn't multi-arch, I must introduce a new macro into each
i386/tm-*.h file which knows how to handle arguments for that target.
(Maybe I can find something like config/tm-linux.h to edit instead,
but that means I must read and understand config/i386/*.h.)  A generic
default implementation won't work properly because argument quoting is

Second, and more importantly, I still don't see how this approach can
be the correct one.  In digging I found a real example which I think
can demonstrate the problem (or if not it at least shows yet another
thing I don't understand and which I need to understand to update this

If I'm reading the source correctly, right now with a PPC Linux gdb
the user can use `target sim'.  This changes how the quoted argument
will be decomposed -- instead of using sh-style dequoting, instead the
`buildargv()' function from libiberty will be used.  But as far as I
can tell, typing `target sim' doesn't change anything in the current
gdbarch.  All it seems to change is the current target vector.

So suppose I go ahead and put argument construction into the gdbarch.
How will this new code take effect when the user uses `target sim'?
Which gdbarch structure will I modify to handle the sim target?  As
far as I can tell remote-sim.c doesn't reference gdbarch at all right


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