This is the mail archive of the gdb-patches@sourceware.org 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: RFC: add ability to "source" Python code


> > Anyway, how about a compromise, then, and require the -p switch to
> > source python scripts? The incompatibility is that
> > 
> >    (gdb) source -p foo
> > 
> > would no longer work for file "-p foo". I think that's an acceptable
> > "incompatibilty". Would you agree?
> 
> This is a misunderstanding: I didn't mind the -p switch, I mind the
> fact that it throws an error if Python is not compiled in.  Eliminate
> the error, and you have me on board.

Cool! So, just to make sure I understand what you're saying, you would
agree to the following change:

Add a -p switch to the "source" command that signifies that we're sourcing
a python script instead of a GDB script. We drop the part where we're
using the filename extension to guess the file language, thus preserving
the current behavior.

Finally, what should we do if trying to source a python script with
a debugger that does not have python linked in? Treat the -p switch
as part of the script filename? (I would find this really odd)

-- 
Joel


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