+2010-04-14 Phil Muldoon <pmuldoon@redhat.com>
+
+ * python/py-block.c (gdbpy_block_for_pc): Use i8n to encompass
+ error/warning messages. Capitalize and use complete sentences.
+ (blpy_block_syms_iternext): Likewise.
+ * python/py-cmd.c (parse_command_name, cmdpy_init): Likewise.
+ * python/py-frame.c (FRAPY_REQUIRE_VALID, frapy_block)
+ (frame_info_to_frame_object, frapy_read_var)
+ (gdbpy_frame_stop_reason_string): Likewise.
+ * python/py-lazy-string.c (stpy_convert_to_value)
+ (gdbpy_create_lazy_string_object): Likewise.
+ * python/py-objfile.c (objfpy_set_printers): Likewise.
+ * python/py-prettyprint.c (gdbpy_default_visualizer): Likewise.
+ * python/python.c (parameter_to_python): Likewise.
+ * python/py-type.c (typy_range, typy_target): Likewise.
+ * python/py-value.c (valpy_cast, valpy_length, valpy_getitem)
+ (valpy_richcompare, valpy_int, valpy_long, valpy_float): Likewise.
+
+
2010-04-14 Phil Muldoon <pmuldoon@redhat.com>
PR python/11381
if (sym == NULL)
{
- PyErr_SetString (PyExc_StopIteration, "Symbol is null.");
+ PyErr_SetString (PyExc_StopIteration, _("Symbol is null."));
return NULL;
}
if (!symtab || symtab->objfile == NULL)
{
PyErr_SetString (PyExc_RuntimeError,
- "Cannot locate object file for block.");
+ _("Cannot locate object file for block."));
return NULL;
}
;
if (i < 0)
{
- PyErr_SetString (PyExc_RuntimeError, _("no command name found"));
+ PyErr_SetString (PyExc_RuntimeError, _("No command name found."));
return NULL;
}
lastchar = i;
elt = lookup_cmd_1 (&text, cmdlist, NULL, 1);
if (!elt || elt == (struct cmd_list_element *) -1)
{
- PyErr_Format (PyExc_RuntimeError, _("could not find command prefix %s"),
+ PyErr_Format (PyExc_RuntimeError, _("Could not find command prefix %s."),
prefix_text);
xfree (prefix_text);
xfree (result);
return result;
}
- PyErr_Format (PyExc_RuntimeError, _("'%s' is not a prefix command"),
+ PyErr_Format (PyExc_RuntimeError, _("'%s' is not a prefix command."),
prefix_text);
xfree (prefix_text);
xfree (result);
/* Note: this is apparently not documented in Python. We return
0 for success, -1 for failure. */
PyErr_Format (PyExc_RuntimeError,
- _("command object already initialized"));
+ _("Command object already initialized."));
return -1;
}
&& cmdtype != class_trace && cmdtype != class_obscure
&& cmdtype != class_maintenance)
{
- PyErr_Format (PyExc_RuntimeError, _("invalid command class argument"));
+ PyErr_Format (PyExc_RuntimeError, _("Invalid command class argument."));
return -1;
}
if (completetype < -1 || completetype >= (int) N_COMPLETERS)
{
- PyErr_Format (PyExc_RuntimeError, _("invalid completion type argument"));
+ PyErr_Format (PyExc_RuntimeError, _("Invalid completion type argument."));
return -1;
}
do { \
frame = frame_object_to_frame_info (frame_obj); \
if (frame == NULL) \
- error ("Frame is invalid."); \
+ error (_("Frame is invalid.")); \
} while (0)
static PyTypeObject frame_object_type;
if (!sal.symtab || !sal.symtab->objfile)
{
PyErr_SetString (PyExc_RuntimeError,
- "Cannot locate object file for block.");
+ _("Cannot locate object file for block."));
return NULL;
}
frame_obj = PyObject_New (frame_object, &frame_object_type);
if (frame_obj == NULL)
{
- PyErr_SetString (PyExc_MemoryError, "Could not allocate frame object.");
+ PyErr_SetString (PyExc_MemoryError,
+ _("Could not allocate frame object."));
return NULL;
}
if (!var)
{
PyErr_Format (PyExc_ValueError,
- _("variable '%s' not found"), var_name);
+ _("Variable '%s' not found."), var_name);
do_cleanups (cleanup);
return NULL;
else
{
PyErr_SetString (PyExc_TypeError,
- _("argument must be a symbol or string"));
+ _("Argument must be a symbol or string."));
return NULL;
}
if (reason < 0 || reason > UNWIND_NO_SAVED_PC)
{
- PyErr_SetString (PyExc_ValueError, "Invalid frame stop reason.");
+ PyErr_SetString (PyExc_ValueError,
+ _("Invalid frame stop reason."));
return NULL;
}
if (self_string->address == 0)
{
PyErr_SetString (PyExc_MemoryError,
- _("Cannot create a value from NULL"));
+ _("Cannot create a value from NULL."));
return NULL;
}
if (!type)
{
PyErr_SetString (PyExc_RuntimeError,
- "A lazy string's type cannot be NULL.");
+ _("A lazy string's type cannot be NULL."));
return NULL;
}
if (! value)
{
PyErr_SetString (PyExc_TypeError,
- "cannot delete the pretty_printers attribute");
+ _("Cannot delete the pretty_printers attribute."));
return -1;
}
if (! PyList_Check (value))
{
PyErr_SetString (PyExc_TypeError,
- "the pretty_printers attribute must be a list");
+ _("The pretty_printers attribute must be a list."));
return -1;
}
value = value_object_to_value (val_obj);
if (! value)
{
- PyErr_SetString (PyExc_TypeError, "argument must be a gdb.Value");
+ PyErr_SetString (PyExc_TypeError,
+ _("Argument must be a gdb.Value."));
return NULL;
}
&& TYPE_CODE (type) != TYPE_CODE_RANGE)
{
PyErr_SetString (PyExc_RuntimeError,
- "This type does not have a range.");
+ _("This type does not have a range."));
return NULL;
}
if (!TYPE_TARGET_TYPE (type))
{
- PyErr_SetString (PyExc_RuntimeError, "type does not have a target");
+ PyErr_SetString (PyExc_RuntimeError,
+ _("Type does not have a target."));
return NULL;
}
type = type_object_to_type (type_obj);
if (! type)
{
- PyErr_SetString (PyExc_RuntimeError, "argument must be a Type");
+ PyErr_SetString (PyExc_RuntimeError,
+ _("Argument must be a type."));
return NULL;
}
{
/* We don't support getting the number of elements in a struct / class. */
PyErr_SetString (PyExc_NotImplementedError,
- "Invalid operation on gdb.Value.");
+ _("Invalid operation on gdb.Value."));
return -1;
}
type = check_typedef (value_type (tmp));
if (TYPE_CODE (type) != TYPE_CODE_ARRAY
&& TYPE_CODE (type) != TYPE_CODE_PTR)
- error( _("Cannot subscript requested type"));
+ error( _("Cannot subscript requested type."));
else
res_val = value_subscript (tmp, value_as_long (idx));
}
default:
/* Can't happen. */
PyErr_SetString (PyExc_NotImplementedError,
- "Invalid operation on gdb.Value.");
+ _("Invalid operation on gdb.Value."));
return NULL;
}
default:
/* Can't happen. */
PyErr_SetString (PyExc_NotImplementedError,
- "Invalid operation on gdb.Value.");
+ _("Invalid operation on gdb.Value."));
result = -1;
break;
}
CHECK_TYPEDEF (type);
if (!is_intlike (type, 0))
{
- PyErr_SetString (PyExc_RuntimeError, "cannot convert value to int");
+ PyErr_SetString (PyExc_RuntimeError,
+ _("Cannot convert value to int."));
return NULL;
}
if (!is_intlike (type, 1))
{
- PyErr_SetString (PyExc_RuntimeError, "cannot convert value to long");
+ PyErr_SetString (PyExc_RuntimeError,
+ _("Cannot convert value to long."));
return NULL;
}
CHECK_TYPEDEF (type);
if (TYPE_CODE (type) != TYPE_CODE_FLT)
{
- PyErr_SetString (PyExc_RuntimeError, "cannot convert value to float");
+ PyErr_SetString (PyExc_RuntimeError,
+ _("Cannot convert value to float."));
return NULL;
}
value = value_copy (((value_object *) result)->value);
}
else
- PyErr_Format (PyExc_TypeError, _("Could not convert Python object: %s"),
+ PyErr_Format (PyExc_TypeError, _("Could not convert Python object: %s."),
PyString_AsString (PyObject_Str (obj)));
}
if (except.reason < 0)
}
}
- return PyErr_Format (PyExc_RuntimeError, "programmer error: unhandled type");
+ return PyErr_Format (PyExc_RuntimeError,
+ _("Programmer error: unhandled type."));
}
/* A Python function which returns a gdb parameter's value as a Python
GDB_PY_HANDLE_EXCEPTION (except);
if (!found)
return PyErr_Format (PyExc_RuntimeError,
- "could not find parameter `%s'", arg);
+ _("Could not find parameter `%s'."), arg);
if (! cmd->var)
- return PyErr_Format (PyExc_RuntimeError, "`%s' is not a parameter", arg);
+ return PyErr_Format (PyExc_RuntimeError,
+ _("`%s' is not a parameter."), arg);
return parameter_to_python (cmd);
}
gdb_test "python print 'result =', f0.older () == f1" " = True" "test Frame.older"
gdb_test "python print 'result =', f1.newer () == f0" " = True" "test Frame.newer"
gdb_test "python print 'result =', f0.read_var ('variable_which_surely_doesnt_exist')" \
- "ValueError: variable 'variable_which_surely_doesnt_exist' not found.*Error while executing Python code." \
+ "ValueError: Variable 'variable_which_surely_doesnt_exist' not found.*Error while executing Python code." \
"test Frame.read_var - error"
gdb_test "python print 'result =', f0.read_var ('a')" " = 1" "test Frame.read_var - success"