aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2010-05-13 23:53:32 +0000
committerMichael Snyder <msnyder@vmware.com>2010-05-13 23:53:32 +0000
commitc5504eafbce9ab0ea4d9aa7f222d7b75a6c77531 (patch)
tree296c321c47907882ffc668af19edd04ec67851c3 /gdb/c-lang.c
parentcc59ec59c88e97e6e674db776fed9b197dffce33 (diff)
downloadgdb-c5504eafbce9ab0ea4d9aa7f222d7b75a6c77531.zip
gdb-c5504eafbce9ab0ea4d9aa7f222d7b75a6c77531.tar.gz
gdb-c5504eafbce9ab0ea4d9aa7f222d7b75a6c77531.tar.bz2
2010-05-13 Michael Snyder <msnyder@vmware.com>
* charset.c: White space. * c-lang.c: White space. * cli-out.c: White space. * coffread.c: White space. * complaints.c: White space. * completer.c: White space. * corefile.c: White space. * corelow.c: White space. * cp-abi.c: White space. * cp-namespace.c: White space. * cp-support.c: White space. * cp-valprint.c: White space. * c-typeprint.c: White space. * c-valprint.c: White space.
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 305c549..63be331 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -179,6 +179,7 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig, int orig_len,
int quoter, int *need_escapep)
{
int need_escape = *need_escapep;
+
*need_escapep = 0;
if (gdb_iswprint (w) && (!need_escape || (!gdb_iswdigit (w)
&& w != LCST ('8')
@@ -223,6 +224,7 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig, int orig_len,
{
char octal[30];
ULONGEST value;
+
value = extract_unsigned_integer (&orig[i], width, byte_order);
/* If the value fits in 3 octal digits, print it that
way. Otherwise, print it as a hex escape. */
@@ -236,6 +238,7 @@ print_wchar (gdb_wint_t w, const gdb_byte *orig, int orig_len,
while (i < orig_len)
{
char octal[5];
+
sprintf (octal, "\\%.3o", orig[i] & 0xff);
append_string_as_wide (octal, output);
++i;
@@ -424,6 +427,7 @@ c_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
if (length == -1)
{
unsigned long current_char = 1;
+
for (i = 0; current_char; ++i)
{
QUIT;
@@ -504,6 +508,7 @@ c_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
/* Painful gyrations. */
int j;
char *s = xstrprintf (_(" <repeats %u times>"), reps);
+
for (j = 0; s[j]; ++j)
{
gdb_wchar_t w = gdb_btowc (s[j]);
@@ -881,6 +886,7 @@ convert_escape (struct type *type, const char *dest_charset,
case 'U':
{
int length = *p == 'u' ? 4 : 8;
+
ADVANCE;
if (!isxdigit (*p))
error (_("\\u used with no following hex digits"));
@@ -908,6 +914,7 @@ parse_one_string (struct obstack *output, char *data, int len,
while (data < limit)
{
char *p = data;
+
/* Look for next escape, or the end of the input. */
while (p < limit && *p != '\\')
++p;
@@ -1021,6 +1028,7 @@ evaluate_subexp_c (struct type *expect_type, struct expression *exp,
else
{
int i;
+
/* Write the terminating character. */
for (i = 0; i < TYPE_LENGTH (type); ++i)
obstack_1grow (&output, 0);
@@ -1107,6 +1115,7 @@ c_language_arch_info (struct gdbarch *gdbarch,
struct language_arch_info *lai)
{
const struct builtin_type *builtin = builtin_type (gdbarch);
+
lai->string_char_type = builtin->builtin_char;
lai->primitive_type_vector
= GDBARCH_OBSTACK_CALLOC (gdbarch, nr_c_primitive_types + 1,
@@ -1213,6 +1222,7 @@ cplus_language_arch_info (struct gdbarch *gdbarch,
struct language_arch_info *lai)
{
const struct builtin_type *builtin = builtin_type (gdbarch);
+
lai->string_char_type = builtin->builtin_char;
lai->primitive_type_vector
= GDBARCH_OBSTACK_CALLOC (gdbarch, nr_cplus_primitive_types + 1,