WinDBG/Exts/CodeAnalyzer/gdbplus/gdb-7.7/gdb/heap.c
/*
 * Parse user options and invoke corresponding pattern function
 */
Parse user options and invoke corresponding pattern function
Parse user options and invoke corresponding pattern function
CA_BOOL pattern_command_impl(char* args)
{
	address_t lo = 0, hi = 0;
	if (args)
	{
		char* options[MAX_NUM_OPTIONS];
		int num_options = ca_parse_options(args, options);
		if (num_options != 2)
		{
			CA_PRINT("Expect arguments: <start> <end>\n");
			return CA_FALSE;
		}
		lo = ca_eval_address (options[0]);
		hi = ca_eval_address (options[1]);
		if (hi <= lo)
		{
			CA_PRINT("Invalid memory address range (start >= end)\n");
			return CA_FALSE;
		}
	}
	else
	{
		CA_PRINT("Missing object address.");
		return CA_FALSE;
	}
	print_memory_pattern(lo, hi);
	return CA_TRUE;
}
CA_BOOL pattern_command_impl ( char * args ) { address_t lo = 0 , hi = 0 ; if ( args ) { char * options [ MAX_NUM_OPTIONS ] ; int num_options = ca_parse_options ( args , options ) ; if ( num_options != 2 ) { CA_PRINT ( " \n " ) ; return CA_FALSE ; } lo = ca_eval_address ( options [ 0 ] ) ; hi = ca_eval_address ( options [ 1 ] ) ; if ( hi <= lo ) { CA_PRINT ( " \n " ) ; return CA_FALSE ; } } else { CA_PRINT ( " " ) ; return CA_FALSE ; } print_memory_pattern ( lo , hi ) ; return CA_TRUE ; }
Parse user options and invoke corresponding pattern function
Parse user options and invoke corresponding pattern function
// Parse user input options // argument is in the form of <start> <end>