2010-04-14 Phil Muldoon <pmuldoon@redhat.com>
authorPhil Muldoon <pmuldoon@redhat.com>
Wed, 14 Apr 2010 13:18:55 +0000 (13:18 +0000)
committerPhil Muldoon <pmuldoon@redhat.com>
Wed, 14 Apr 2010 13:18:55 +0000 (13:18 +0000)
* 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.

gdb/ChangeLog
gdb/python/py-block.c
gdb/python/py-cmd.c
gdb/python/py-frame.c
gdb/python/py-lazy-string.c
gdb/python/py-objfile.c
gdb/python/py-prettyprint.c
gdb/python/py-type.c
gdb/python/py-value.c
gdb/python/python.c
gdb/testsuite/gdb.python/py-frame.exp

index a9c8f2d57ccd7e593d8f1e9beae287ea8417c77e..6eb4a09470b6b3cc2ed9b8f340e71e32dfa270d1 100644 (file)
@@ -1,3 +1,22 @@
+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
index 3523664ebfa64e4e351945496ae294c05a4fc6ba..d0170306d009b829d7331d7933f2b704382eba57 100644 (file)
@@ -248,7 +248,7 @@ blpy_block_syms_iternext (PyObject *self)
 
   if (sym == NULL)
     {
-      PyErr_SetString (PyExc_StopIteration, "Symbol is null.");
+      PyErr_SetString (PyExc_StopIteration, _("Symbol is null."));
       return NULL;
     }
 
@@ -281,7 +281,7 @@ gdbpy_block_for_pc (PyObject *self, PyObject *args)
   if (!symtab || symtab->objfile == NULL)
     {
       PyErr_SetString (PyExc_RuntimeError,
-                      "Cannot locate object file for block.");
+                      _("Cannot locate object file for block."));
       return NULL;
     }
 
index ae462d9e9de4a62ae5d18035a74ac11be75b7dbe..d187d16b0019d676c1e03c379e4f6b03ac621306 100644 (file)
@@ -279,7 +279,7 @@ parse_command_name (char *text, struct cmd_list_element ***base_list)
     ;
   if (i < 0)
     {
-      PyErr_SetString (PyExc_RuntimeError, _("no command name found"));
+      PyErr_SetString (PyExc_RuntimeError, _("No command name found."));
       return NULL;
     }
   lastchar = i;
@@ -311,7 +311,7 @@ parse_command_name (char *text, struct cmd_list_element ***base_list)
   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);
@@ -325,7 +325,7 @@ parse_command_name (char *text, struct cmd_list_element ***base_list)
       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);
@@ -374,7 +374,7 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
       /* 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;
     }
 
@@ -389,13 +389,13 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
       && 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;
     }
 
index 3b5320c589f42bc907d92d33f85e65960cc21ee7..e930ae29a028a18f02e5ebd43e9df8c7d1eb7eb4 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
     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;
@@ -227,7 +227,7 @@ frapy_block (PyObject *self, PyObject *args)
   if (!sal.symtab || !sal.symtab->objfile)
     {
       PyErr_SetString (PyExc_RuntimeError,
-                      "Cannot locate object file for block.");
+                      _("Cannot locate object file for block."));
       return NULL;
     }
 
@@ -273,7 +273,8 @@ frame_info_to_frame_object (struct frame_info *frame)
   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;
     }
 
@@ -436,7 +437,7 @@ frapy_read_var (PyObject *self, PyObject *args)
       if (!var)
        {
          PyErr_Format (PyExc_ValueError,
-                       _("variable '%s' not found"), var_name);
+                       _("Variable '%s' not found."), var_name);
          do_cleanups (cleanup);
 
          return NULL;
@@ -447,7 +448,7 @@ frapy_read_var (PyObject *self, PyObject *args)
   else
     {
       PyErr_SetString (PyExc_TypeError,
-                      _("argument must be a symbol or string"));
+                      _("Argument must be a symbol or string."));
       return NULL;
     }
 
@@ -524,7 +525,8 @@ gdbpy_frame_stop_reason_string (PyObject *self, PyObject *args)
 
   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;
     }
 
index ebe0a99a3b02c15873368edeafc9c1976a7c5f52..d28aae2ec06a35f191c840c9aa4af26ebe25ebf7 100644 (file)
@@ -97,7 +97,7 @@ stpy_convert_to_value  (PyObject *self, PyObject *args)
   if (self_string->address == 0)
     {
       PyErr_SetString (PyExc_MemoryError,
-                      _("Cannot create a value from NULL"));
+                      _("Cannot create a value from NULL."));
       return NULL;
     }
 
@@ -129,7 +129,7 @@ gdbpy_create_lazy_string_object (CORE_ADDR address, long length,
   if (!type)
     {
       PyErr_SetString (PyExc_RuntimeError,
-                      "A lazy string's type cannot be NULL.");
+                      _("A lazy string's type cannot be NULL."));
       return NULL;
     }
 
index 1b924d58056f70a6597770651c9eeb27d143730f..23655c653a02587c760d2d7fb62a28ed508fa764 100644 (file)
@@ -93,14 +93,14 @@ objfpy_set_printers (PyObject *o, PyObject *value, void *ignore)
   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;
     }
 
index 5c3757c5fee4793343c854c78fb440fd0f17e0dd..9f9fea15274b2e8eebb011dfb9dd6c9914000e23 100644 (file)
@@ -663,7 +663,8 @@ gdbpy_default_visualizer (PyObject *self, PyObject *args)
   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;
     }
 
index ae12b5895ac54ba42f4f789f82481193e9231dfd..238b84a2aaf4a1f2afc42980a1b5c1edd148ff0f 100644 (file)
@@ -290,7 +290,7 @@ typy_range (PyObject *self, PyObject *args)
       && 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;
     }
 
@@ -362,7 +362,8 @@ typy_target (PyObject *self, PyObject *args)
 
   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;
     }
 
index a792819d5511d523d0db3ac4722d9d96752a18d9..7672b5dd818b40e832b733cfd0d649f1d51d5e8e 100644 (file)
@@ -304,7 +304,8 @@ valpy_cast (PyObject *self, PyObject *args)
   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;
     }
 
@@ -322,7 +323,7 @@ valpy_length (PyObject *self)
 {
   /* 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;
 }
 
@@ -364,7 +365,7 @@ valpy_getitem (PyObject *self, PyObject *key)
              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));
            }
@@ -728,7 +729,7 @@ valpy_richcompare (PyObject *self, PyObject *other, int op)
       default:
        /* Can't happen.  */
        PyErr_SetString (PyExc_NotImplementedError,
-                        "Invalid operation on gdb.Value.");
+                        _("Invalid operation on gdb.Value."));
        return NULL;
     }
 
@@ -765,7 +766,7 @@ valpy_richcompare (PyObject *self, PyObject *other, int op)
        default:
          /* Can't happen.  */
          PyErr_SetString (PyExc_NotImplementedError,
-                          "Invalid operation on gdb.Value.");
+                          _("Invalid operation on gdb.Value."));
          result = -1;
          break;
       }
@@ -806,7 +807,8 @@ valpy_int (PyObject *self)
   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;
     }
 
@@ -837,7 +839,8 @@ valpy_long (PyObject *self)
 
   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;
     }
 
@@ -866,7 +869,8 @@ valpy_float (PyObject *self)
   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;
     }
 
@@ -977,7 +981,7 @@ convert_value_from_python (PyObject *obj)
          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)
index 9cf4520c060b8146d69809be4a5c73fffb1c429a..41a9443bff7cf8355ba72369ee3f429e8eba0619 100644 (file)
@@ -249,7 +249,8 @@ parameter_to_python (struct cmd_list_element *cmd)
       }
     }
 
-  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
@@ -276,10 +277,11 @@ gdbpy_parameter (PyObject *self, PyObject *args)
   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);
 }
 
index 150e7375645721fb9c8e6cee8a7fbe45708d9887..baa080ddd7a5589c68aa45482c124242f90200bc 100644 (file)
@@ -100,7 +100,7 @@ gdb_test "python print 'result =', f0.pc ()" " = \[0-9\]+" "test Frame.pc"
 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"
 
This page took 0.067993 seconds and 4 git commands to generate.