Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: Simon Marchi <simon.marchi@polymtl.ca>, Tom Tromey <tom@tromey.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [RFA 4/7] Use ui_out_emit_tuple in disasm.c
Date: Thu, 12 Oct 2017 16:06:00 -0000	[thread overview]
Message-ID: <6226d3be-17c7-aa69-bdbf-efe11ffc1b5f@ericsson.com> (raw)
In-Reply-To: <79955c67-567b-7bc9-c238-9245c9ab1911@ericsson.com>

On 2017-10-12 11:36 AM, Simon Marchi wrote:
> On 2017-09-09 02:35 PM, Simon Marchi wrote:
>> On 2017-09-09 17:35, Tom Tromey wrote:
>>> This changes one spot in disasm.c to use ui_out_emit_tuple.  This
>>> patch required a large reindentation, so I've separated it out.
>>
>> "git show -w" does wonders!  The hard part is figuring out if there's something else in this big function using cleanups (and therefore if the cleanup variable should be kept).
>>
>> Anyway, this LGTM.
>>
>> Simon
>>
> 
> I found a regression, bisect pointed to this patch (which makes sense).
> 
> 1. Run "disassemble /s" on a small enough terminal so that pagination kicks in.
> 2. Type q <return> to quit pagination.
> 
> I get:
> 
> ---Type <return> to continue, or q <return> to quit---q
> /home/emaisin/src/binutils-gdb/gdb/ui-out.c:344: internal-error: void ui_out::pop_level(ui_out_type): Assertion `current_level ()->type () == type' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Quit this debugging session? (y or n)
> 
> Simon
> 

Mixing RAII and cleanups probably changed the order in which the uiout elements
are closed.

In an outer scope (likely do_mixed_source_and_assembly), some uiout elements are
opened and cleanups are installed.  In pretty_print_insn, some other uiout elements
are opened and RAII closers are used.  When typing 'q', the cleanups are ran, just
before the quit exception would be thrown.  The RAII closers have not ran yet, because
they would be when the exception is actually thrown.  The solution would be to finish
converting the uiout cleanups to RAII (I won't have time to do that in the near future,
feel free to pick it up).

Simon


  reply	other threads:[~2017-10-12 16:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-09 15:35 [RFA 0/7] more ui-out cleanup removal Tom Tromey
2017-09-09 15:35 ` [RFA 3/7] Use ui_out_emit_tuple in more places Tom Tromey
2017-09-09 18:32   ` Simon Marchi
2017-09-09 19:32     ` Tom Tromey
2017-09-09 15:35 ` [RFA 4/7] Use ui_out_emit_tuple in disasm.c Tom Tromey
2017-09-09 18:35   ` Simon Marchi
2017-10-12 15:37     ` Simon Marchi
2017-10-12 16:06       ` Simon Marchi [this message]
2017-10-12 16:11         ` Tom Tromey
2017-10-12 21:07           ` Tom Tromey
2017-10-13 16:13             ` Tom Tromey
2017-10-16 22:37               ` Simon Marchi
2017-10-16 22:59                 ` Tom Tromey
2017-09-09 15:35 ` [RFA 1/7] Use ui_out_emit_table and ui_out_emit_list in print_thread_info_1 Tom Tromey
2017-09-09 17:47   ` Simon Marchi
2017-09-09 18:36     ` Tom Tromey
2017-09-09 19:20       ` Matt Rice
2017-09-09 15:35 ` [RFA 6/7] Remove make_cleanup_ui_out_redirect_pop Tom Tromey
2017-09-09 18:49   ` Simon Marchi
2017-09-09 15:35 ` [RFA 5/7] Use ui_out_emit_list in more places Tom Tromey
2017-09-09 18:43   ` Simon Marchi
2017-09-09 15:46 ` [RFA 2/7] Remove make_cleanup_ui_out_table_begin_end Tom Tromey
2017-09-09 16:02   ` Tom Tromey
2017-09-09 18:22     ` Simon Marchi
2017-09-09 15:46 ` [RFA 7/7] Use ui_out_emit_list and ui_out_emit_tuple with gdb::optional Tom Tromey
2017-09-09 18:51   ` Simon Marchi
2017-09-09 19:44 ` [RFA 0/7] more ui-out cleanup removal Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6226d3be-17c7-aa69-bdbf-efe11ffc1b5f@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox