This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Python Scripting Question
>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
Daniel> On Mon, Nov 09, 2009 at 09:41:54AM -0700, Tom Tromey wrote:
>> It isn't clear to me that gdb commands are allowed to overwrite their
>> argument strings, though. Are they? disassemble_command does do this,
>> but it seems wrong to me -- won't it permanently modify the command
>> stored in a command script?
Daniel> Is it this bit?
Daniel> /* Two arguments. */
Daniel> *space_index = '\0';
Yeah.
Daniel> I don't think we should let commands modify their argument string.
Me neither. For the Python case I think we still have to be defensive,
because it seems that a command might temporarily modify its argument (I
am pretty sure this happens but I don't know how often), but even this
sort of modification could cause problems, if the command itself can
cause Python code to be called.
Tom