gdb: Support printf 'z' size modifier
[deliverable/binutils-gdb.git] / gdb / gdbsupport / format.c
index 1e803501ae67ea965812149175e357b2bb1c22f2..2e2d90a92467ecda49cff7dd92e0526fa1dc9764 100644 (file)
@@ -123,6 +123,7 @@ format_pieces::format_pieces (const char **arg, bool gdb_extensions)
        int seen_space = 0, seen_plus = 0;
        int seen_big_l = 0, seen_h = 0, seen_big_h = 0;
        int seen_big_d = 0, seen_double_big_d = 0;
+       int seen_size_t = 0;
        int bad = 0;
        int n_int_args = 0;
 
@@ -234,6 +235,12 @@ format_pieces::format_pieces (const char **arg, bool gdb_extensions)
            else
              seen_big_d = 1;
          }
+       /* For size_t or ssize_t.  */
+       else if (*f == 'z')
+         {
+           seen_size_t = 1;
+           f++;
+         }
 
        switch (*f)
          {
@@ -251,7 +258,9 @@ format_pieces::format_pieces (const char **arg, bool gdb_extensions)
 
          case 'd':
          case 'i':
-           if (lcount == 0)
+           if (seen_size_t)
+             this_argclass = size_t_arg;
+           else if (lcount == 0)
              this_argclass = int_arg;
            else if (lcount == 1)
              this_argclass = long_arg;
This page took 0.037047 seconds and 4 git commands to generate.