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][python] 3 of 5 - Frame filter CLI/misc code changes.


>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:

Phil> 2013-03-11  Phil Muldoon  <pmuldoon@redhat.com>
Phil> 	* stack.c (backtrace_command_1): Add "raw", and Python frame
Phil> 	filter logic.
Phil> 	(backtrace_command): Add "raw" option parsing.
Phil> 	(_initialize_stack): Alter help to reflect "raw" option.
Phil> 	* Makefile.in: Add py-framefiler build changes.


Phil> +  int result = 0;

This should be the enum type, as requested in the other patch.

Phil> +      result = apply_frame_filter (get_current_frame (), flags, arg_type,
Phil> +				   current_uiout, py_start, py_end);
Phil> +
Phil> +    }

Spurious empty line before the "}".

Phil> +  /* Run the inbuilt backtrace if there are no filters registered, or
Phil> +     if there was an error in the Python backtracing output.  */
Phil> +  if (no_filters || result == PY_BT_ERROR || result == PY_BT_NO_FILTERS)

I think we agreed that this shouldn't check the PY_BT_ERROR case here.

Phil> -	  if (fulltrace_arg < 0 && subset_compare (argv[i], "full"))
Phil> -	    fulltrace_arg = argc;
Phil> +	  if (no_filters < 0 && subset_compare (argv[i], "no-filters"))
Phil> +	    no_filters = argc;
Phil>  	  else
Phil>  	    {
Phil> -	      arglen += strlen (argv[i]);
Phil> -	      argc++;
Phil> +	      if (fulltrace_arg < 0 && subset_compare (argv[i], "full"))
Phil> +		fulltrace_arg = argc;
Phil> +	      else
Phil> +		{
Phil> +		  user_arg++;
Phil> +		  arglen += strlen (argv[i]);
Phil> +		}

I think it is better to use the "chained-if" style, like:

	  if (no_filters < 0 && subset_compare (argv[i], "no-filters"))
	    no_filters = argc;
	  else if (fulltrace_arg < 0 && subset_compare (argv[i], "full"))
	    fulltrace_arg = argc;
	  else
	    {
	      user_arg++;
	      arglen += strlen (argv[i]);
	    }

Tom


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