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: [PATCH] [PR mi/18833] Provide unlimited redirection stack for MI


On 08/17/2015 11:32 PM, Doug Evans wrote:

> I wrote this patch up before noticing that someone had already done so.
> https://sourceware.org/ml/gdb-patches/2015-08/msg00438.html
> 
> Adrian's email bounces, so not sure what to do with the attribution.

Adrian's changes were done under Freescale's copyright assignment
at the time.  We should simply use the email address he had then,
just like we don't go over older ChangeLog entries and change
email addresses when we change jobs.  (tbc, I don't know if he
changed jobs).

> 
> The problem here is that if we invoke something from python
> with to_string=True with MI as the current interpreter,
> then that'll set up one level of redirection.
> Then if processing that python requires a second redirection,
> e.g. mi_command_param_changed,
> then MI's stack size of two will discard the original entry,
> and then when the python completes MI's uiout will be left pointing
> to freed memory from the redirection.
> 
> The fix is to just copy what CLI does: use a VEC to record the stack.
> 
> Adrian never completed his testcase.
> If someone wants to complete it and add it great.
> My testcase is sufficient to trigger the crash
> and is how I ran into this bug.
> I did copy over Pedro's suggestion for skip_python_tests_prompt.

Thanks.  It looks good to me.  A couple minor comments below.

> +/* Constructor for an `mi_out_data' object.  */
> +
> +static void
> +mi_out_data_ctor (int mi_version, mi_out_data *self, struct ui_file  
> *stream)

I find it a (tiny) bit surprising the 'self' isn't the first parameter.

> diff --git a/gdb/testsuite/gdb.python/py-mi-objfile.exp  
> b/gdb/testsuite/gdb.python/py-mi-objfile.exp
> new file mode 100644
> index 0000000..2f69453
> --- /dev/null
> +++ b/gdb/testsuite/gdb.python/py-mi-objfile.exp
> @@ -0,0 +1,58 @@

> +# This file is part of the GDB testsuite.  It tests Python-based
> +# pretty-printing for MI.
> +

This comment looks stale.

Thanks,
Pedro Alves


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