Message ID | 20170210210232.17439-2-simon.marchi@ericsson.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 54025 invoked by alias); 10 Feb 2017 21:03:02 -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 53871 invoked by uid 89); 10 Feb 2017 21:03:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=restricts, precisely, issuing, channels X-HELO: sessmg23.ericsson.net Received: from sessmg23.ericsson.net (HELO sessmg23.ericsson.net) (193.180.251.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Feb 2017 21:02:50 +0000 Received: from ESESSHC021.ericsson.se (Unknown_Domain [153.88.183.81]) by (Symantec Mail Security) with SMTP id A1.31.05955.87A2E985; Fri, 10 Feb 2017 22:02:48 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.81) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 10 Feb 2017 22:02:47 +0100 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=simon.marchi@ericsson.com; Received: from elxcz23q12-y4.ca.am.ericsson.se (192.75.88.130) by AM3PR07MB387.eurprd07.prod.outlook.com (2a01:111:e400:8820::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.5; Fri, 10 Feb 2017 21:02:46 +0000 From: Simon Marchi <simon.marchi@ericsson.com> To: <gdb-patches@sourceware.org> CC: Simon Marchi <simon.marchi@ericsson.com> Subject: [PATCH 2/2] Do not send queries on secondary UIs Date: Fri, 10 Feb 2017 16:02:32 -0500 Message-ID: <20170210210232.17439-2-simon.marchi@ericsson.com> In-Reply-To: <20170210210232.17439-1-simon.marchi@ericsson.com> References: <20170210210232.17439-1-simon.marchi@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: BN6PR1001CA0006.namprd10.prod.outlook.com (2603:10b6:405:28::19) To AM3PR07MB387.eurprd07.prod.outlook.com (2a01:111:e400:8820::16) X-MS-Office365-Filtering-Correlation-Id: a87a94a8-784b-4df8-07d4-08d451f82a39 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:AM3PR07MB387; X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB387; 3:cHvn7405/0D9XI0aGd1sLgk1xRfbsXfO/+o4uj/LwqoRtWBT4SY4fULsqR3wYSkDC8K0y5cf2RRFkWbsRNa537clzBc17smvupWrbBYUZONY6KXnP/8YadXdjVRIEvDIkLqy/4umV7/K3borIAY98jhOAjgxsiOtHB60ymwCvBwQrkgj5Suw0lnyWcmr+umzGt5+KEMGZs7HKOpx/t4wmmpq0oI6iKFUGqvvjcxKNPltJC8QtzVpb5W3erdJNtP9QeBoaKZnYV9iqT0ZPtVDBQ==; 25:7gtoFl5UoeSTrzIvRbO+CchYxKDOVLxyRT5oFs0WAibBkps7S7nBcOE0YeqgSUJfOyRIWecLPfhUHdLpIeApKVNXAQ0tn0AURpGhvJhDoWTlHaNpEESOTwEWrrsddelfgZ0g7eEPRxN0Ssd6kl37jGTST8HLxG7M4foplPGiXJG55paUTWoj852O5G9gKDjE7Rf4F2T24Xc4l0+H2xWkozeVePRAkdU2Fz1aKD3xo5+rgyOgKlOhdZxJtq3BDkeQVaiTANIFsCuVUwi4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-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123562025)(20161123558025)(20161123564025)(20161123560025)(6072148); SRVR:AM3PR07MB387; BCL:0; PCL:0; RULEID:; SRVR:AM3PR07MB387; X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB387; 4:ShA3Ur4Hro/QW68oN5AIGSt8qZRU1dYYwcz2NOvtbPM8Xij/GLRuE6nDt3oNd6UtX6ngsftnUF3SB/tnuW/TXgG4XTWmxwS4Ae7oO6euvRAoGeJJYF/IFs1XV6bhdPP+UvEnt1ooGxC4RfCl/aeCtfuQskZZatii2KOEPNnW9kbx7YSO5STdfgROpF1U/Fr07XB/0PKQwn6MkJBFp33oYX+sFMCfjteqYfr4FX8/kmP7sT5SfNTfhJE8OTa39OMA+xdVrmVxqK9NKkHWyZDzEvQ7h6BXtqKCsaVacMc+G+3/bXTgID4Vf1r+W8Y8gxQqLk6nxF6HllYmnWQ+rhSvJ59YejY4NNk6OI/tKqUz9132lZicDRbYSyebGkaNsRfXFaRHwRE3HqoNAgnEj9A456K9q+qjZ5HV8bAJqWIM5yLkPYKXrx/CLF9ougQ5wOFZE2OMlxcuKMGBUkOnGpum9y2JzGmOtRH/EwBQwvsGlBmbgcwUCyyql3ODjwtsGFG76B9kBENRPSLs9dMA78HRyP6oojIByaVFCS8i7KBTN0+gk6lbqf+34FoGEUvB0Ojf8YHWsMq6S8l4zR6IrGK9iwRE3iRU15OtLlXC+ukdFlc= X-Forefront-PRVS: 0214EB3F68 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(54534003)(189002)(199003)(50226002)(50986999)(2906002)(53936002)(4326007)(47776003)(6506006)(101416001)(1076002)(38730400002)(50466002)(5660300001)(76176999)(189998001)(5003940100001)(48376002)(66066001)(6116002)(2351001)(3846002)(106356001)(2950100002)(42186005)(86362001)(6486002)(105586002)(92566002)(450100001)(33646002)(68736007)(97736004)(7736002)(107886003)(6916009)(305945005)(81166006)(110136004)(81156014)(8676002)(6512007)(6306002)(6666003)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR07MB387; H:elxcz23q12-y4.ca.am.ericsson.se; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM3PR07MB387; 23:mCReilagdwjCF1jSdly9A9nyL9zN/TxDdktdN92hNL?= =?us-ascii?Q?WyiXGQhAvQZT+drMm3W6Kx83eDoMLotjkJFeAbyQCH7txVNqUowAe4XwVGXm?= =?us-ascii?Q?P6iAQ7Z3u/3now/BknMORWYevwF1Vkmr8tv7WZ7iW203N9YTOexQ4sB9iRaX?= =?us-ascii?Q?Ep1ajBGrZXgAx4SGhguojuKMKpl8Rei/7LxADQza4nk2rDPWPpSRaMFWfcpF?= =?us-ascii?Q?MVZCanSNPwCcVKM44/r0flFWEwoi6dD/6byvFuAgWT8KF5eqcbVyCL92wiMN?= =?us-ascii?Q?XqxEbKLkpCzUkjO+m7Sgq9XQ1nUHRr0UTq5oPEaY0ZTeBAxEHtvY7vXx3s6K?= =?us-ascii?Q?mgDVFxP/7fwOsT4lq6ufIXKHXT5fLKWq+uDik/OXDrNeI5F1CT+VamvUM1Ih?= =?us-ascii?Q?fYFRqrtZ2PgeOP9f5xpU+8AyxIhwQLEYIH1W0HQB0IBD8/s0iGnIEpAzaL22?= =?us-ascii?Q?WXAw8tzg2T9Qn/G0Rbgl/6Axz6ALUZbYe0RQ8F16+Q2xqUjyyYjWlSo4GFpm?= =?us-ascii?Q?e1/P7dAiYPrrT6QIvLx3rimvVmLrAS089vyj5k3tZ+INDumxgGBFcOaFyAj8?= =?us-ascii?Q?JIa5iZ1+cH8AooEIbwU1ejG9vmiI9Q+WEviJcyOpHA86D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uex0yZkwpvEyhXoFdcA4Xgu/nkABMIplMMC8Ljz6zXww0pcHadkOcYlemCvN/hvy4IUHXehzhyDALXWJR5o/OizFf+i3rlLQ==; 5:H7Uk7wL8V0jNRb2169Xgz2caWhnCTippMzPXJJLZJcmShCbq56sMtr+Xvm5bQuI9/G/YJK5Nez1vr36fubY5XIGOBn0fFCYAeutk2MpDEFjHIkbk34vCk9Rb2UNU4HrFtyms/ZQLjkbvF/Jk1NwcNg==; 24:dca5Q+issyEgRvaKwi+/KPaj3Qp8EFSUnNmCJCItBzAGtzqPkIUhJSC5+GTbg1O222u2afOdHzVDC14cWwublhsWN3c7dB+/1uYgHktgFwg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM3PR07MB387; 7:kZgVlllV0NQOeGnG4kRyXNQUwz5eRb7rwYoX2EMAmGMnRLfqc+TDW0Hp4NQvlKgekCmQ8Dq3pkdQEt/Pk4mnD8t72d3EYt3xtwkT/SEhG3ogMblhKxEa0kHIXRdKdBf2Vl3DYwhXhQHKHbmu/GySBdvSbfvXMkC3aU1B9sPyD9/OdwER+nln5oZDGGxV9nXvvdzRJBepMicDdilW0zUdmkMMhueFhzT4/p71jyhXKgVsH7EBI2uGqDyTRfDZjlDF9eVUb8JwupWcBiafRY9jrBTgr3484sOAJN8sQRqaSwuVMGXl0oNa1JUk7f+/paAgKS99HDszOoN/ySixja4kUtsGb4ZuHNUCt77xROJFC59mWrRmn0MrUJlLbKNbkVz4tVl/lCUBIzZYrj4rFpFkf1aISnKLaFMTW4MQ+r8VoNzHRF2eu/Iaq/0qoJ54qrEazw/VAFh3CWVlKwbU3fdPaXGwPRdu7V/oJ5cGPBQPNSlgzLZr2ap2zPCQrJNagOytRKFE7AiHxLhFF/elzjyKFg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2017 21:02:46.3671 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR07MB387 X-OriginatorOrg: ericsson.com X-IsSubscribed: yes |
Commit Message
Simon Marchi
Feb. 10, 2017, 9:02 p.m. UTC
This is a follow-up to https://sourceware.org/ml/gdb-patches/2017-02/msg00261.html This patch restricts queries to the main UI, which allows to avoid two different problems. The first one is that GDB is issuing queries on secondary MI channels for which a TTY is allocated. The second one is that GDB is not able to handle queries on two (CLI) UIs simultaneously. Restricting queries to the main UI allows to bypass these two problems. More details on how/why these two problems happen: 1. Queries on secondary MI UI The current criterion to decide if we should query the user is whether the input stream is a TTY. The original way to start GDB in MI mode from a front-end was to create a subprocess with pipes to its stdin/stdout. In this case, the input was considered non-interactive and queries were auto-answered. Now that front-ends can create the MI channel as a separate UI connected to a dedicated TTY, GDB now considers this input stream as interactive and sends queries to it. By restricting queries to the main UI, we make sure we never query on the secondary MI UI. 2. Simultaneous queries As Pedro stated it, when you have two queries on two different CLI UIs at the same time, you end up with the following pseudo stack: #0 gdb_readline_wrapper #1 defaulted_query // for UI #2 #2 handle_command #3 execute_command ("handle SIGTRAP" .... #4 stdin_event_handler // input on UI #2 #5 gdb_do_one_event #7 gdb_readline_wrapper #8 defaulted_query // for UI #1 #9 handle_command #10 execute_command ("handle SIGINT" .... #11 stdin_event_handler // input on UI #1 #12 gdb_do_one_event #13 gdb_readline_wrapper trying to answer the query on UI #1 will therefore answer for UI #2. By restricting the queries to the main UI, we ensure that there will never be more than one pending query, since you can't have two queries on a UI at the same time. I added a snippet to gdb.base/new-ui.exp to verify that we get a query on the main UI, but that we don't on the secondary one (or, more precisely, that it gets auto-answered). gdb/ChangeLog: * utils.c (defaulted_query): Don't query on secondary UIs. gdb/testsuite/ChangeLog: * gdb.base/new-ui.exp (do_test): Test queries behavior on main and extra UIs. --- gdb/testsuite/gdb.base/new-ui.exp | 12 ++++++++++++ gdb/utils.c | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-)
Comments
OK. Thanks, Pedro Alves On 02/10/2017 09:02 PM, Simon Marchi wrote: > This is a follow-up to > > https://sourceware.org/ml/gdb-patches/2017-02/msg00261.html > > This patch restricts queries to the main UI, which allows to avoid two > different problems. > > The first one is that GDB is issuing queries on secondary MI channels > for which a TTY is allocated. The second one is that GDB is not able to > handle queries on two (CLI) UIs simultaneously. Restricting queries to > the main UI allows to bypass these two problems. > > More details on how/why these two problems happen: > > 1. Queries on secondary MI UI > > The current criterion to decide if we should query the user is whether > the input stream is a TTY. The original way to start GDB in MI mode > from a front-end was to create a subprocess with pipes to its > stdin/stdout. In this case, the input was considered non-interactive > and queries were auto-answered. Now that front-ends can create the MI > channel as a separate UI connected to a dedicated TTY, GDB now > considers this input stream as interactive and sends queries to it. > By restricting queries to the main UI, we make sure we never query on > the secondary MI UI. > > 2. Simultaneous queries > > As Pedro stated it, when you have two queries on two different CLI UIs > at the same time, you end up with the following pseudo stack: > > #0 gdb_readline_wrapper > #1 defaulted_query // for UI #2 > #2 handle_command > #3 execute_command ("handle SIGTRAP" .... > #4 stdin_event_handler // input on UI #2 > #5 gdb_do_one_event > #7 gdb_readline_wrapper > #8 defaulted_query // for UI #1 > #9 handle_command > #10 execute_command ("handle SIGINT" .... > #11 stdin_event_handler // input on UI #1 > #12 gdb_do_one_event > #13 gdb_readline_wrapper > > trying to answer the query on UI #1 will therefore answer for UI #2. > > By restricting the queries to the main UI, we ensure that there will > never be more than one pending query, since you can't have two queries > on a UI at the same time. > > I added a snippet to gdb.base/new-ui.exp to verify that we get a query > on the main UI, but that we don't on the secondary one (or, more > precisely, that it gets auto-answered). > > gdb/ChangeLog: > > * utils.c (defaulted_query): Don't query on secondary UIs. > > gdb/testsuite/ChangeLog: > > * gdb.base/new-ui.exp (do_test): Test queries behavior on main > and extra UIs. > --- > gdb/testsuite/gdb.base/new-ui.exp | 12 ++++++++++++ > gdb/utils.c | 4 +++- > 2 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.base/new-ui.exp b/gdb/testsuite/gdb.base/new-ui.exp > index 8224b7d615..b84f4de712 100644 > --- a/gdb/testsuite/gdb.base/new-ui.exp > +++ b/gdb/testsuite/gdb.base/new-ui.exp > @@ -128,6 +128,18 @@ proc_with_prefix do_test {} { > gdb_test "print 2" "^print 2\r\n\\\$2 = 2" "print on extra console" > } > > + # Verify that we get proper queries on the main UI, but that they are > + # auto-answered on secondary UIs. > + with_spawn_id $gdb_main_spawn_id { > + gdb_test "delete" "" "delete all breakpoint on main console" \ > + "Delete all breakpoints. .y or n. $" "n" > + } > + with_spawn_id $extra_spawn_id { > + gdb_test "delete" \ > + "Delete all breakpoints. .y or n. .answered Y; input not from terminal." \ > + "delete all breakpoints on extra console" > + } > + > # Run a few execution tests with the main console as the driver > # console. > with_test_prefix "main console" { > diff --git a/gdb/utils.c b/gdb/utils.c > index 3dc2f03d61..27021a1d45 100644 > --- a/gdb/utils.c > +++ b/gdb/utils.c > @@ -1175,7 +1175,9 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args) > way, important error messages don't get lost when talking to GDB > over a pipe. */ > if (current_ui->instream != current_ui->stdin_stream > - || !input_interactive_p (current_ui)) > + || !input_interactive_p (current_ui) > + /* Restrict queries to the main UI. */ > + || current_ui != main_ui) > { > old_chain = make_cleanup_restore_target_terminal (); > >
On 17-02-10 04:06 PM, Pedro Alves wrote: > OK. > > Thanks, > Pedro Alves Thanks, both patches pushed.
diff --git a/gdb/testsuite/gdb.base/new-ui.exp b/gdb/testsuite/gdb.base/new-ui.exp index 8224b7d615..b84f4de712 100644 --- a/gdb/testsuite/gdb.base/new-ui.exp +++ b/gdb/testsuite/gdb.base/new-ui.exp @@ -128,6 +128,18 @@ proc_with_prefix do_test {} { gdb_test "print 2" "^print 2\r\n\\\$2 = 2" "print on extra console" } + # Verify that we get proper queries on the main UI, but that they are + # auto-answered on secondary UIs. + with_spawn_id $gdb_main_spawn_id { + gdb_test "delete" "" "delete all breakpoint on main console" \ + "Delete all breakpoints. .y or n. $" "n" + } + with_spawn_id $extra_spawn_id { + gdb_test "delete" \ + "Delete all breakpoints. .y or n. .answered Y; input not from terminal." \ + "delete all breakpoints on extra console" + } + # Run a few execution tests with the main console as the driver # console. with_test_prefix "main console" { diff --git a/gdb/utils.c b/gdb/utils.c index 3dc2f03d61..27021a1d45 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1175,7 +1175,9 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args) way, important error messages don't get lost when talking to GDB over a pipe. */ if (current_ui->instream != current_ui->stdin_stream - || !input_interactive_p (current_ui)) + || !input_interactive_p (current_ui) + /* Restrict queries to the main UI. */ + || current_ui != main_ui) { old_chain = make_cleanup_restore_target_terminal ();