src/developer/debug/zxdb/console/commands/verb_disassemble.cc
Err ReadLocation(const Command& cmd, const char* command_name, Location* location,
                 uint64_t* location_size) {
  *location_size = 0;
  if (cmd.args().size() != 1)
    return Err("%s requires exactly one argument specifying a location.", command_name);

  // We need to check the type of the parsed input location so parse and resolve in two steps.
  std::vector<InputLocation> input_locations;
  if (Err err = ParseLocalInputLocation(cmd.frame(), cmd.args()[0], &input_locations);
      err.has_error())
    return err;
  FXL_DCHECK(!input_locations.empty());

  if (Err err = ResolveUniqueInputLocation(cmd.target()->GetProcess()->GetSymbols(),
                                           input_locations, true, location);
      err.has_error())
    return err;

  // Some symbols can give us sizes. All input locations will have the same type (matching the user
  // input type).
  if (input_locations[0].type == InputLocation::Type::kName) {
    if (location->symbol()) {
      if (const CodeBlock* block = location->symbol().Get()->AsCodeBlock()) {
        *location_size = block->GetFullRange(location->symbol_context()).size();
      }
    }
  }
  return Err();
}
// Converts argument 0 (required or it will produce an error) and converts it to a unique location
// (or error). If the input indicates a thing that has an intrinsic size like a function name, the
// size will be placed in *location_size. Otherwise, *location_size will be 0.
//
// The command_name is used for writing the current command to error messages.
Converts argument 0 (required or it will produce an error) and converts it to a unique location
(or error). If the input indicates a thing that has an intrinsic size like a function name, the
size will be placed in *location_size. Otherwise, *location_size will be 0.

The command_name is used for writing the current command to error messages.
Converts argument 0 ( required or it will produce an error ) and converts it to a unique location ( or error ) . If the input indicates a thing that has an intrinsic size like a function name the size will be placed in * location_size . Otherwise * location_size will be 0 . The command_name is used for writing the current command to error messages .
Err ReadLocation(const Command& cmd, const char* command_name, Location* location,
                 uint64_t* location_size) {
  *location_size = 0;
  if (cmd.args().size() != 1)
    return Err("%s requires exactly one argument specifying a location.", command_name);
  std::vector<InputLocation> input_locations;
  if (Err err = ParseLocalInputLocation(cmd.frame(), cmd.args()[0], &input_locations);
      err.has_error())
    return err;
  FXL_DCHECK(!input_locations.empty());
  if (Err err = ResolveUniqueInputLocation(cmd.target()->GetProcess()->GetSymbols(),
                                           input_locations, true, location);
      err.has_error())
    return err;
  if (input_locations[0].type == InputLocation::Type::kName) {
    if (location->symbol()) {
      if (const CodeBlock* block = location->symbol().Get()->AsCodeBlock()) {
        *location_size = block->GetFullRange(location->symbol_context()).size();
      }
    }
  }
  return Err();
}
Err ReadLocation ( const Command & cmd , const char * command_name , Location * location , uint64_t * location_size ) { * location_size = 0 ; if ( cmd . args ( ) . size ( ) != 1 ) return Err ( " " , command_name ) ; std :: vector < InputLocation > input_locations ; if ( Err err = ParseLocalInputLocation ( cmd . frame ( ) , cmd . args ( ) [ 0 ] , & input_locations ) ; err . has_error ( ) ) return err ; FXL_DCHECK ( ! input_locations . empty ( ) ) ; if ( Err err = ResolveUniqueInputLocation ( cmd . target ( ) -> GetProcess ( ) -> GetSymbols ( ) , input_locations , true , location ) ; err . has_error ( ) ) return err ; if ( input_locations [ 0 ] . type == InputLocation :: Type :: kName ) { if ( location -> symbol ( ) ) { if ( const CodeBlock * block = location -> symbol ( ) . Get ( ) -> AsCodeBlock ( ) ) { * location_size = block -> GetFullRange ( location -> symbol_context ( ) ) . size ( ) ; } } } return Err ( ) ; }
Converts argument 0 (required or it will produce an error) and converts it to a unique location
(or error).
Converts argument 0 ( required or it will produce an error ) and converts it to a unique location ( or error ) .
// We need to check the type of the parsed input location so parse and resolve in two steps. // Some symbols can give us sizes. All input locations will have the same type (matching the user // input type).