Message ID | 1499607122-11131-1-git-send-email-b7.10110111@gmail.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 109944 invoked by alias); 9 Jul 2017 13:33:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 109886 invoked by uid 89); 9 Jul 2017 13:33:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=tab, H*r:TLS1 X-HELO: mail-lf0-f67.google.com Received: from mail-lf0-f67.google.com (HELO mail-lf0-f67.google.com) (209.85.215.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 09 Jul 2017 13:33:04 +0000 Received: by mail-lf0-f67.google.com with SMTP id t72so7785746lff.0 for <gdb-patches@sourceware.org>; Sun, 09 Jul 2017 06:33:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OG8AZqexIqxjRWtW623y3DeozT8DDyuOvM9fCkHT440=; b=IlQqs3q9GITDROHg4JMSOqL4cfjuz0TDoI7pK1Z4o8AwTAVd6uy0QTNmf62xTEliPc 4GxVq0XFyd384zy3WpXA5Wz5ep/vqCIKGTX1CgnOEcwLHEUDB33C/DNsnm40sxpt+tgv h9kIZhQxS32bScMeqa+E4IE9K+tnJMc1mDYeHQfpDUalfBuzN669RWrmf5YYMRTxr5wT C7nmgKoFvkGXbbccNDB/qddtLT2xcIiL1RtWA+bSdHq1CF4fO8GTHHjm52wwDtPHmg8y odZ5vzlgc7vaER3QhDRuLh4nS5HkLUCLALFE4gvjnEUxSURHEJgTf7oYDZN4tYZZj2MW 090A== X-Gm-Message-State: AIVw113UtpzwrwxZaEKBALhtFUPngB0MOBp4/CPmdw5kd2uoayRRxUHV n0jLSGnuS+Rl3f5g X-Received: by 10.25.151.137 with SMTP id z131mr10193112lfd.24.1499607181828; Sun, 09 Jul 2017 06:33:01 -0700 (PDT) Received: from localhost.localdomain ([91.215.122.25]) by smtp.gmail.com with ESMTPSA id b123sm2059642lfb.22.2017.07.09.06.33.00 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 09 Jul 2017 06:33:00 -0700 (PDT) From: Ruslan Kabatsayev <b7.10110111@gmail.com> To: gdb-patches@sourceware.org Cc: Ruslan Kabatsayev <b7.10110111@gmail.com> Subject: [PATCH] Align natural-format register values to the same column Date: Sun, 9 Jul 2017 16:32:02 +0300 Message-Id: <1499607122-11131-1-git-send-email-b7.10110111@gmail.com> X-IsSubscribed: yes |
Commit Message
Ruslan Kabatsayev
July 9, 2017, 1:32 p.m. UTC
Currently, commands such as "info reg", "info all-reg", as well as register window in the TUI print badly aligned columns, like here: eax 0x1 1 ecx 0xffffd3e0 -11296 edx 0xffffd404 -11260 ebx 0xf7fa5ff4 -134586380 esp 0xffffd390 0xffffd390 ebp 0xffffd3c8 0xffffd3c8 esi 0x0 0 edi 0x0 0 eip 0x8048b60 0x8048b60 <main+16> eflags 0x286 [ PF SF IF ] cs 0x23 35 ss 0x2b 43 ds 0x2b 43 es 0x2b 43 fs 0x0 0 gs 0x63 99 After this patch, these commands print the third column values consistently aligned one under another, provided the second column is not too long. Originally, the third column was (attempted to be) aligned using a simple tab character. Lots of tests in the test suite check for it, so this patch retains the tab in the output after the second column. This allows these tests to continue working unchanged. What is different is that now the tab may be followed by several spaces, which complete the task of aligning the third column when the sole tab doesn't work well. gdb/ChangeLog: * infcmd.c (default_print_one_register_info): Align natural- format column value consistently one after another. --- gdb/infcmd.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)
Comments
On 09/07/17 16:32, Ruslan Kabatsayev wrote: > Currently, commands such as "info reg", "info all-reg", as well as register > window in the TUI print badly aligned columns, like here: > > eax 0x1 1 > ecx 0xffffd3e0 -11296 > edx 0xffffd404 -11260 > ebx 0xf7fa5ff4 -134586380 > esp 0xffffd390 0xffffd390 > ebp 0xffffd3c8 0xffffd3c8 > esi 0x0 0 > edi 0x0 0 > eip 0x8048b60 0x8048b60 <main+16> > eflags 0x286 [ PF SF IF ] > cs 0x23 35 > ss 0x2b 43 > ds 0x2b 43 > es 0x2b 43 > fs 0x0 0 > gs 0x63 99 > > After this patch, these commands print the third column values consistently > aligned one under another, provided the second column is not too long. > Originally, the third column was (attempted to be) aligned using a simple tab > character. Lots of tests in the test suite check for it, so this patch retains > the tab in the output after the second column. This allows these tests to > continue working unchanged. What is different is that now the tab may be > followed by several spaces, which complete the task of aligning the third > column when the sole tab doesn't work well. > > gdb/ChangeLog: > > * infcmd.c (default_print_one_register_info): Align natural- > format column value consistently one after another. > --- > gdb/infcmd.c | 27 ++++++++++++++++++--------- > 1 file changed, 18 insertions(+), 9 deletions(-) > > diff --git a/gdb/infcmd.c b/gdb/infcmd.c > index defa7b0..5de4e68 100644 > --- a/gdb/infcmd.c > +++ b/gdb/infcmd.c > @@ -2280,9 +2280,10 @@ default_print_one_register_info (struct ui_file *file, > { > struct type *regtype = value_type (val); > int print_raw_format; > + string_file format_stream; > > - fputs_filtered (name, file); > - print_spaces_filtered (15 - strlen (name), file); > + format_stream.puts (name); > + format_stream.puts (n_spaces (15 - strlen (name))); > > print_raw_format = (value_entirely_available (val) > && !value_optimized_out (val)); > @@ -2301,14 +2302,18 @@ default_print_one_register_info (struct ui_file *file, > > val_print (regtype, > value_embedded_offset (val), 0, > - file, 0, val, &opts, current_language); > + &format_stream, 0, val, &opts, current_language); > > if (print_raw_format) > { > - fprintf_filtered (file, "\t(raw "); > - print_hex_chars (file, valaddr, TYPE_LENGTH (regtype), byte_order, > + const int size_with_tab = format_stream.size () / 8 * 8 + 8; > + format_stream.putc ('\t'); > + if (size_with_tab < 32) > + format_stream.puts (n_spaces (32 - size_with_tab)); > + format_stream.puts ("(raw "); > + print_hex_chars (&format_stream, valaddr, TYPE_LENGTH (regtype), byte_order, > true); > - fprintf_filtered (file, ")"); > + format_stream.puts (")"); > } > } > else > @@ -2320,20 +2325,24 @@ default_print_one_register_info (struct ui_file *file, > opts.deref_ref = 1; > val_print (regtype, > value_embedded_offset (val), 0, > - file, 0, val, &opts, current_language); > + &format_stream, 0, val, &opts, current_language); > /* If not a vector register, print it also according to its > natural format. */ > if (print_raw_format && TYPE_VECTOR (regtype) == 0) > { > + const int size_with_tab = format_stream.size () / 8 * 8 + 8; > + format_stream.putc ('\t'); > + if (size_with_tab < 32) > + format_stream.puts (n_spaces (32 - size_with_tab)); > get_user_print_options (&opts); > opts.deref_ref = 1; > - fprintf_filtered (file, "\t"); > val_print (regtype, > value_embedded_offset (val), 0, > - file, 0, val, &opts, current_language); > + &format_stream, 0, val, &opts, current_language); > } > } > > + fputs_filtered (format_stream.c_str (), file); > fprintf_filtered (file, "\n"); > } > >
Hi Ruslan, Thanks for the patch, it does indeed look pretty bad right now. If we are going to do the alignment by hand using spaces (which seems like a good idea, as it gives more control), I'd rather not keep the tab as an historic artifact. How many tests would have to be fixed, and how difficult would it be? >> Currently, commands such as "info reg", "info all-reg", as well as >> register >> window in the TUI print badly aligned columns, like here: >> >> eax 0x1 1 >> ecx 0xffffd3e0 -11296 >> edx 0xffffd404 -11260 >> ebx 0xf7fa5ff4 -134586380 >> esp 0xffffd390 0xffffd390 >> ebp 0xffffd3c8 0xffffd3c8 >> esi 0x0 0 >> edi 0x0 0 >> eip 0x8048b60 0x8048b60 <main+16> >> eflags 0x286 [ PF SF IF ] >> cs 0x23 35 >> ss 0x2b 43 >> ds 0x2b 43 >> es 0x2b 43 >> fs 0x0 0 >> gs 0x63 99 >> >> After this patch, these commands print the third column values >> consistently >> aligned one under another, provided the second column is not too long. >> Originally, the third column was (attempted to be) aligned using a >> simple tab >> character. Lots of tests in the test suite check for it, so this patch >> retains >> the tab in the output after the second column. This allows these tests >> to >> continue working unchanged. What is different is that now the tab may >> be >> followed by several spaces, which complete the task of aligning the >> third >> column when the sole tab doesn't work well. >> >> gdb/ChangeLog: >> >> * infcmd.c (default_print_one_register_info): Align natural- >> format column value consistently one after another. >> --- >> gdb/infcmd.c | 27 ++++++++++++++++++--------- >> 1 file changed, 18 insertions(+), 9 deletions(-) >> >> diff --git a/gdb/infcmd.c b/gdb/infcmd.c >> index defa7b0..5de4e68 100644 >> --- a/gdb/infcmd.c >> +++ b/gdb/infcmd.c >> @@ -2280,9 +2280,10 @@ default_print_one_register_info (struct ui_file >> *file, >> { >> struct type *regtype = value_type (val); >> int print_raw_format; >> + string_file format_stream; >> >> - fputs_filtered (name, file); >> - print_spaces_filtered (15 - strlen (name), file); >> + format_stream.puts (name); >> + format_stream.puts (n_spaces (15 - strlen (name))); >> >> print_raw_format = (value_entirely_available (val) >> && !value_optimized_out (val)); >> @@ -2301,14 +2302,18 @@ default_print_one_register_info (struct >> ui_file *file, >> >> val_print (regtype, >> value_embedded_offset (val), 0, >> - file, 0, val, &opts, current_language); >> + &format_stream, 0, val, &opts, current_language); >> >> if (print_raw_format) >> { >> - fprintf_filtered (file, "\t(raw "); >> - print_hex_chars (file, valaddr, TYPE_LENGTH (regtype), byte_order, >> + const int size_with_tab = format_stream.size () / 8 * 8 + 8; >> + format_stream.putc ('\t'); >> + if (size_with_tab < 32) >> + format_stream.puts (n_spaces (32 - size_with_tab)); Could you extract that constant (32) to a const variable with some meaningful name? If we ever change the width, I predict that we'll forget to update the instances of the same 32 down there. The padding could also be made into a small function to avoid repeating the code. >> + format_stream.puts ("(raw "); >> + print_hex_chars (&format_stream, valaddr, TYPE_LENGTH (regtype), >> byte_order, >> true); >> - fprintf_filtered (file, ")"); >> + format_stream.puts (")"); >> } >> } >> else >> @@ -2320,20 +2325,24 @@ default_print_one_register_info (struct >> ui_file *file, >> opts.deref_ref = 1; >> val_print (regtype, >> value_embedded_offset (val), 0, >> - file, 0, val, &opts, current_language); >> + &format_stream, 0, val, &opts, current_language); >> /* If not a vector register, print it also according to its >> natural format. */ >> if (print_raw_format && TYPE_VECTOR (regtype) == 0) >> { >> + const int size_with_tab = format_stream.size () / 8 * 8 + 8; >> + format_stream.putc ('\t'); >> + if (size_with_tab < 32) >> + format_stream.puts (n_spaces (32 - size_with_tab)); >> get_user_print_options (&opts); >> opts.deref_ref = 1; >> - fprintf_filtered (file, "\t"); >> val_print (regtype, >> value_embedded_offset (val), 0, >> - file, 0, val, &opts, current_language); >> + &format_stream, 0, val, &opts, current_language); >> } >> } >> >> + fputs_filtered (format_stream.c_str (), file); >> fprintf_filtered (file, "\n"); >> } >> >> Thanks! Simon
Hi Simon, On 23/07/17 22:46, Simon Marchi wrote: > Hi Ruslan, > > Thanks for the patch, it does indeed look pretty bad right now. > > If we are going to do the alignment by hand using spaces (which seems like a good idea, as it gives more control), I'd rather not keep the tab as an historic artifact. How many tests would have to be fixed, and how difficult would it be? > I'm not sure how many, because I can't possibly run tests for all the architectures. Also, there are many tests with intermittent failures (racy), which make counting harder even for a single arch. At first I did try to fix things for i386, but after fixing several dozens of lines of expected output I realized that it'll not fix anything for ARM etc., so I instead went with keeping the tab. >>> Currently, commands such as "info reg", "info all-reg", as well as register >>> window in the TUI print badly aligned columns, like here: >>> >>> eax 0x1 1 >>> ecx 0xffffd3e0 -11296 >>> edx 0xffffd404 -11260 >>> ebx 0xf7fa5ff4 -134586380 >>> esp 0xffffd390 0xffffd390 >>> ebp 0xffffd3c8 0xffffd3c8 >>> esi 0x0 0 >>> edi 0x0 0 >>> eip 0x8048b60 0x8048b60 <main+16> >>> eflags 0x286 [ PF SF IF ] >>> cs 0x23 35 >>> ss 0x2b 43 >>> ds 0x2b 43 >>> es 0x2b 43 >>> fs 0x0 0 >>> gs 0x63 99 >>> >>> After this patch, these commands print the third column values consistently >>> aligned one under another, provided the second column is not too long. >>> Originally, the third column was (attempted to be) aligned using a simple tab >>> character. Lots of tests in the test suite check for it, so this patch retains >>> the tab in the output after the second column. This allows these tests to >>> continue working unchanged. What is different is that now the tab may be >>> followed by several spaces, which complete the task of aligning the third >>> column when the sole tab doesn't work well. >>> >>> gdb/ChangeLog: >>> >>> * infcmd.c (default_print_one_register_info): Align natural- >>> format column value consistently one after another. >>> --- >>> gdb/infcmd.c | 27 ++++++++++++++++++--------- >>> 1 file changed, 18 insertions(+), 9 deletions(-) >>> >>> diff --git a/gdb/infcmd.c b/gdb/infcmd.c >>> index defa7b0..5de4e68 100644 >>> --- a/gdb/infcmd.c >>> +++ b/gdb/infcmd.c >>> @@ -2280,9 +2280,10 @@ default_print_one_register_info (struct ui_file *file, >>> { >>> struct type *regtype = value_type (val); >>> int print_raw_format; >>> + string_file format_stream; >>> >>> - fputs_filtered (name, file); >>> - print_spaces_filtered (15 - strlen (name), file); >>> + format_stream.puts (name); >>> + format_stream.puts (n_spaces (15 - strlen (name))); >>> >>> print_raw_format = (value_entirely_available (val) >>> && !value_optimized_out (val)); >>> @@ -2301,14 +2302,18 @@ default_print_one_register_info (struct ui_file *file, >>> >>> val_print (regtype, >>> value_embedded_offset (val), 0, >>> - file, 0, val, &opts, current_language); >>> + &format_stream, 0, val, &opts, current_language); >>> >>> if (print_raw_format) >>> { >>> - fprintf_filtered (file, "\t(raw "); >>> - print_hex_chars (file, valaddr, TYPE_LENGTH (regtype), byte_order, >>> + const int size_with_tab = format_stream.size () / 8 * 8 + 8; >>> + format_stream.putc ('\t'); >>> + if (size_with_tab < 32) >>> + format_stream.puts (n_spaces (32 - size_with_tab)); > > Could you extract that constant (32) to a const variable with some meaningful name? If we ever change the width, I predict that we'll forget to update the instances of the same 32 down there. Yeah, I can do this. But should the magic 15 above be named as well (as 32 is the second "tab stop" while 15 is the first one)? > > The padding could also be made into a small function to avoid repeating the code. > >>> + format_stream.puts ("(raw "); >>> + print_hex_chars (&format_stream, valaddr, TYPE_LENGTH (regtype), byte_order, >>> true); >>> - fprintf_filtered (file, ")"); >>> + format_stream.puts (")"); >>> } >>> } >>> else >>> @@ -2320,20 +2325,24 @@ default_print_one_register_info (struct ui_file *file, >>> opts.deref_ref = 1; >>> val_print (regtype, >>> value_embedded_offset (val), 0, >>> - file, 0, val, &opts, current_language); >>> + &format_stream, 0, val, &opts, current_language); >>> /* If not a vector register, print it also according to its >>> natural format. */ >>> if (print_raw_format && TYPE_VECTOR (regtype) == 0) >>> { >>> + const int size_with_tab = format_stream.size () / 8 * 8 + 8; >>> + format_stream.putc ('\t'); >>> + if (size_with_tab < 32) >>> + format_stream.puts (n_spaces (32 - size_with_tab)); >>> get_user_print_options (&opts); >>> opts.deref_ref = 1; >>> - fprintf_filtered (file, "\t"); >>> val_print (regtype, >>> value_embedded_offset (val), 0, >>> - file, 0, val, &opts, current_language); >>> + &format_stream, 0, val, &opts, current_language); >>> } >>> } >>> >>> + fputs_filtered (format_stream.c_str (), file); >>> fprintf_filtered (file, "\n"); >>> } >>> >>> > > Thanks! > > Simon Regards, Ruslan
On 2017-07-23 21:57, Ruslan Kabatsayev wrote: >> If we are going to do the alignment by hand using spaces (which seems >> like a good idea, as it gives more control), I'd rather not keep the >> tab as an historic artifact. How many tests would have to be fixed, >> and how difficult would it be? >> > I'm not sure how many, because I can't possibly run tests for all the > architectures. Also, there are many tests with intermittent failures > (racy), which make counting harder even for a single arch. > > At first I did try to fix things for i386, but after fixing several > dozens of lines of expected output I realized that it'll not fix > anything for ARM etc., so I instead went with keeping the tab. Ok, I see. If you are willing to fix what you can for x86, we can then ask for others to contribute testing for other architectures. You can also make the changes for other architectures (grepping for "info reg" in the testsuite), and say that you weren't able to test the changes for architecture X and Y. The changes should be relatively straightforward. Otherwise, if other maintainers are fine with leaving the tab here, I'm not strongly against it. I would also be fine with a two-step process (accept this patch and remote the tab/fix the tests in another patch). >>>> Currently, commands such as "info reg", "info all-reg", as well as >>>> register >>>> window in the TUI print badly aligned columns, like here: >>>> >>>> eax 0x1 1 >>>> ecx 0xffffd3e0 -11296 >>>> edx 0xffffd404 -11260 >>>> ebx 0xf7fa5ff4 -134586380 >>>> esp 0xffffd390 0xffffd390 >>>> ebp 0xffffd3c8 0xffffd3c8 >>>> esi 0x0 0 >>>> edi 0x0 0 >>>> eip 0x8048b60 0x8048b60 <main+16> >>>> eflags 0x286 [ PF SF IF ] >>>> cs 0x23 35 >>>> ss 0x2b 43 >>>> ds 0x2b 43 >>>> es 0x2b 43 >>>> fs 0x0 0 >>>> gs 0x63 99 >>>> >>>> After this patch, these commands print the third column values >>>> consistently >>>> aligned one under another, provided the second column is not too >>>> long. >>>> Originally, the third column was (attempted to be) aligned using a >>>> simple tab >>>> character. Lots of tests in the test suite check for it, so this >>>> patch retains >>>> the tab in the output after the second column. This allows these >>>> tests to >>>> continue working unchanged. What is different is that now the tab >>>> may be >>>> followed by several spaces, which complete the task of aligning the >>>> third >>>> column when the sole tab doesn't work well. >>>> >>>> gdb/ChangeLog: >>>> >>>> * infcmd.c (default_print_one_register_info): Align natural- >>>> format column value consistently one after another. >>>> --- >>>> gdb/infcmd.c | 27 ++++++++++++++++++--------- >>>> 1 file changed, 18 insertions(+), 9 deletions(-) >>>> >>>> diff --git a/gdb/infcmd.c b/gdb/infcmd.c >>>> index defa7b0..5de4e68 100644 >>>> --- a/gdb/infcmd.c >>>> +++ b/gdb/infcmd.c >>>> @@ -2280,9 +2280,10 @@ default_print_one_register_info (struct >>>> ui_file *file, >>>> { >>>> struct type *regtype = value_type (val); >>>> int print_raw_format; >>>> + string_file format_stream; >>>> >>>> - fputs_filtered (name, file); >>>> - print_spaces_filtered (15 - strlen (name), file); >>>> + format_stream.puts (name); >>>> + format_stream.puts (n_spaces (15 - strlen (name))); >>>> >>>> print_raw_format = (value_entirely_available (val) >>>> && !value_optimized_out (val)); >>>> @@ -2301,14 +2302,18 @@ default_print_one_register_info (struct >>>> ui_file *file, >>>> >>>> val_print (regtype, >>>> value_embedded_offset (val), 0, >>>> - file, 0, val, &opts, current_language); >>>> + &format_stream, 0, val, &opts, current_language); >>>> >>>> if (print_raw_format) >>>> { >>>> - fprintf_filtered (file, "\t(raw "); >>>> - print_hex_chars (file, valaddr, TYPE_LENGTH (regtype), >>>> byte_order, >>>> + const int size_with_tab = format_stream.size () / 8 * 8 + 8; >>>> + format_stream.putc ('\t'); >>>> + if (size_with_tab < 32) >>>> + format_stream.puts (n_spaces (32 - size_with_tab)); >> >> Could you extract that constant (32) to a const variable with some >> meaningful name? If we ever change the width, I predict that we'll >> forget to update the instances of the same 32 down there. > Yeah, I can do this. But should the magic 15 above be named as well > (as 32 is the second "tab stop" while 15 is the first one)? I think it would nice too, while at it. Thanks! Simon
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index defa7b0..5de4e68 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -2280,9 +2280,10 @@ default_print_one_register_info (struct ui_file *file, { struct type *regtype = value_type (val); int print_raw_format; + string_file format_stream; - fputs_filtered (name, file); - print_spaces_filtered (15 - strlen (name), file); + format_stream.puts (name); + format_stream.puts (n_spaces (15 - strlen (name))); print_raw_format = (value_entirely_available (val) && !value_optimized_out (val)); @@ -2301,14 +2302,18 @@ default_print_one_register_info (struct ui_file *file, val_print (regtype, value_embedded_offset (val), 0, - file, 0, val, &opts, current_language); + &format_stream, 0, val, &opts, current_language); if (print_raw_format) { - fprintf_filtered (file, "\t(raw "); - print_hex_chars (file, valaddr, TYPE_LENGTH (regtype), byte_order, + const int size_with_tab = format_stream.size () / 8 * 8 + 8; + format_stream.putc ('\t'); + if (size_with_tab < 32) + format_stream.puts (n_spaces (32 - size_with_tab)); + format_stream.puts ("(raw "); + print_hex_chars (&format_stream, valaddr, TYPE_LENGTH (regtype), byte_order, true); - fprintf_filtered (file, ")"); + format_stream.puts (")"); } } else @@ -2320,20 +2325,24 @@ default_print_one_register_info (struct ui_file *file, opts.deref_ref = 1; val_print (regtype, value_embedded_offset (val), 0, - file, 0, val, &opts, current_language); + &format_stream, 0, val, &opts, current_language); /* If not a vector register, print it also according to its natural format. */ if (print_raw_format && TYPE_VECTOR (regtype) == 0) { + const int size_with_tab = format_stream.size () / 8 * 8 + 8; + format_stream.putc ('\t'); + if (size_with_tab < 32) + format_stream.puts (n_spaces (32 - size_with_tab)); get_user_print_options (&opts); opts.deref_ref = 1; - fprintf_filtered (file, "\t"); val_print (regtype, value_embedded_offset (val), 0, - file, 0, val, &opts, current_language); + &format_stream, 0, val, &opts, current_language); } } + fputs_filtered (format_stream.c_str (), file); fprintf_filtered (file, "\n"); }