public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* Re: [Bug gdb/25475] FAIL: gdb.server/solib-list.exp: non-stop 0/1: target remote (got interactive prompt)
       [not found] ` <bug-25475-7128-LsvyFwr3uH@http.sourceware.org/bugzilla/>
@ 2020-06-28 10:19   ` Tom de Vries
  2020-06-28 16:37     ` Philippe Waroquiers
  0 siblings, 1 reply; 3+ messages in thread
From: Tom de Vries @ 2020-06-28 10:19 UTC (permalink / raw)
  To: gdb-patches, Philippe Waroquiers

On 6/24/20 10:44 PM, cvs-commit at gcc dot gnu.org wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=25475
> 
> --- Comment #23 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
> The master branch has been updated by Philippe Waroquiers
> <philippe@sourceware.org>:
> 
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a8654e7d784980cb4596f685964200fcc1164c78
> 
> commit a8654e7d784980cb4596f685964200fcc1164c78
> Author: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> Date:   Sun Jun 21 21:26:25 2020 +0200
> 
>     Fixes PR 25475: ensure exec-file-mismatch "ask" always asks in case of
> mismatch.
> 
>     As explained in https://sourceware.org/bugzilla/show_bug.cgi?id=25475,
>     when the currently loaded file has no debug symbol,
>     symbol_file_add_with_addrs does not ask a confirmation to the user
>     before loading the new symbol file.  The behaviour is not consistent
>     when symbol_file_add_with_addrs is called due to exec-file-mismatch "ask"
>     setting.
> 
>     The PR discusses several solutions/approaches.
>     The preferred approach (suggested by Joel) is to ensure that GDB always
> asks
>     a confirmation when it loads a new symbol file due to exec-file-mismatch,
>     using a new SYMFILE add-flag.
> 
>     I tested this manually.  If OK, we can remove the bypass introduced by Tom
>     in 6b9374f1, in order to always answer to the 'load' question.
> 

Hi Philippe,

commit 6b9374f1 added answering the load question, if asked.  I'm not
sure I understand what change you're suggesting here.

Thanks,
- Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bug gdb/25475] FAIL: gdb.server/solib-list.exp: non-stop 0/1: target remote (got interactive prompt)
  2020-06-28 10:19   ` [Bug gdb/25475] FAIL: gdb.server/solib-list.exp: non-stop 0/1: target remote (got interactive prompt) Tom de Vries
@ 2020-06-28 16:37     ` Philippe Waroquiers
  2020-06-29  9:03       ` [committed][gdb/testsuite] Expect conformation question in gdb.server/solib-list.exp Tom de Vries
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Waroquiers @ 2020-06-28 16:37 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On Sun, 2020-06-28 at 12:19 +0200, Tom de Vries wrote:
Hello Tom,

> Hi Philippe,
> 
> commit 6b9374f1 added answering the load question, if asked.  I'm not
> sure I understand what change you're suggesting here.
Now, the question should always be asked, so the "if asked" could be removed.

Philippe



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [committed][gdb/testsuite] Expect conformation question in gdb.server/solib-list.exp
  2020-06-28 16:37     ` Philippe Waroquiers
@ 2020-06-29  9:03       ` Tom de Vries
  0 siblings, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2020-06-29  9:03 UTC (permalink / raw)
  To: Philippe Waroquiers, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 516 bytes --]

[ was:  Re: [Bug gdb/25475] FAIL: gdb.server/solib-list.exp: non-stop
0/1: target remote (got interactive prompt) ]

On 6/28/20 6:37 PM, Philippe Waroquiers wrote:
> On Sun, 2020-06-28 at 12:19 +0200, Tom de Vries wrote:
> Hello Tom,
> 
>> Hi Philippe,
>>
>> commit 6b9374f1 added answering the load question, if asked.  I'm not
>> sure I understand what change you're suggesting here.
> Now, the question should always be asked, so the "if asked" could be removed.
> 

I see, committed as attached.

Thanks,
- Tom


[-- Attachment #2: 0001-gdb-testsuite-Expect-conformation-question-in-gdb.server-solib-list.exp.patch --]
[-- Type: text/x-patch, Size: 3145 bytes --]

[gdb/testsuite] Expect conformation question in gdb.server/solib-list.exp

Before commit a8654e7d78 'Fixes PR 25475: ensure exec-file-mismatch "ask"
always asks in case of mismatch', there was a difference in behaviour in
test-case gdb.server/solib-list.exp.

If the executable did not contain debug info (as is usually the case), gdb
would detect a mismatch but not ask for confirmation:
...
(gdb) target remote localhost:2346^M
Remote debugging using localhost:2346^M
warning: Mismatch between current exec-file solib-list^M
and automatically determined exec-file /lib64/ld-2.26.so^M
exec-file-mismatch handling is currently "ask"^M
Reading symbols from /lib64/ld-2.26.so...^M
Reading symbols from /usr/lib/debug/lib64/ld-2.26.so.debug...^M
0x00007ffff7dd7ea0 in _start () at rtld.c:745^M
745     }^M
(gdb) PASS: gdb.server/solib-list.exp: non-stop 0: target remote
...

If the executable did contain debug info (as happens to be the case for
openSUSE), gdb would detect a mismatch and ask for confirmation:
...
(gdb) PASS: gdb.server/solib-list.exp: non-stop 0: file binfile
target remote localhost:2346^M
Remote debugging using localhost:2346^M
warning: Mismatch between current exec-file solib-list^M
and automatically determined exec-file /lib64/ld-2.26.so^M
exec-file-mismatch handling is currently "ask"^M
Load new symbol table from "/lib64/ld-2.26.so"? (y or n) y^M
Reading symbols from /lib64/ld-2.26.so...^M
Reading symbols from /usr/lib/debug/lib64/ld-2.26.so.debug...^M
0x00007ffff7dd7ea0 in _start () at rtld.c:745^M
745     }^M
(gdb) PASS: gdb.server/solib-list.exp: non-stop 0: target remote
...

After commit a8654e7d78, the confirmation is now also asked in case there's
no debug info.

Tighten the test-case by verifying that the confirmation question is asked, as
suggested in the log message of commit a8654e7d78:
...
we can remove the bypass introduced by Tom in 6b9374f1, in order to always
answer to the 'load' question.
...

gdb/testsuite/ChangeLog:

2020-06-29  Tom de Vries  <tdevries@suse.de>

	PR gdb/25475
	* gdb.server/solib-list.exp: Verify that the symbol reload
	confirmation question is asked.

---
 gdb/testsuite/gdb.server/solib-list.exp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gdb/testsuite/gdb.server/solib-list.exp b/gdb/testsuite/gdb.server/solib-list.exp
index 6f077c6a66..a326f940ad 100644
--- a/gdb/testsuite/gdb.server/solib-list.exp
+++ b/gdb/testsuite/gdb.server/solib-list.exp
@@ -93,12 +93,14 @@ foreach nonstop { 0 1 } { with_test_prefix "non-stop $nonstop" {
 
     set test "target $gdbserver_protocol"
     set ok 0
+    set new_symbol_table 0
     gdb_test_multiple "target $gdbserver_protocol $gdbserver_gdbport" $test {
 	-re "Remote debugging using" {
 	    set ok 1
 	    exp_continue
 	}
 	-re {.*Load new symbol table from ".*"\? \(y or n\) } {
+	    set new_symbol_table 1
 	    send_gdb "y\n" answer
 	    exp_continue
 	}
@@ -111,6 +113,7 @@ foreach nonstop { 0 1 } { with_test_prefix "non-stop $nonstop" {
 	    }
 	}
     }
+    gdb_assert {$new_symbol_table == 1}
 
     gdb_test "continue" "Program received signal SIGUSR1, .*"
     gdb_test "sharedlibrary" ".*"

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-29  9:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-25475-7128@http.sourceware.org/bugzilla/>
     [not found] ` <bug-25475-7128-LsvyFwr3uH@http.sourceware.org/bugzilla/>
2020-06-28 10:19   ` [Bug gdb/25475] FAIL: gdb.server/solib-list.exp: non-stop 0/1: target remote (got interactive prompt) Tom de Vries
2020-06-28 16:37     ` Philippe Waroquiers
2020-06-29  9:03       ` [committed][gdb/testsuite] Expect conformation question in gdb.server/solib-list.exp Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).