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: [RFA 14/20] Use gdbpy_enter in gdbpy_before_prompt_hook


LGTM.  A suggestion below.

On 11/10/2016 10:19 PM, Tom Tromey wrote:
>  	      if (prompt == NULL)
> -		goto fail;
> +		{
> +		  gdbpy_print_stack ();
> +		  return EXT_LANG_RC_ERROR;
> +		}
>  	    }
>  	}
>      }
> @@ -1068,13 +1072,7 @@ gdbpy_before_prompt_hook (const struct extension_language_defn *extlang,
>    if (prompt != NULL)
>      set_prompt (prompt.get ());

I haven't applied the patch locally, but I suspect this set_prompt call
could move to the tail of the nested ifs, where you could
return EXT_LANG_RC_OK unconditionally, and then the bottom
could just unconditionally return EXT_LANG_RC_NOP.

Thanks,
Pedro Alves


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