public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFC/PATCH] Extend gdb_core_cmd to allow "Cannot access memory..." messages
@ 2015-03-25  0:06 Sergio Durigan Junior
  2015-03-27 10:06 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Sergio Durigan Junior @ 2015-03-25  0:06 UTC (permalink / raw)
  To: GDB Patches; +Cc: Pedro Alves

Hi,

While hacking the coredump_filter patch, I noticed that, when you load a
corefile on GDB and receive a "Cannot access memory at address..."
message, gdb_core_cmd will fail and return -1, which means that some
fatal error happened.

Unfortunately, this kind of message does not mean that the user cannot
continue debugging with the corefile; it meant that some memory region
(sometimes not important) was inaccessible.  Given that
gcore_create_callback, nowadays, will dump memory regions if they don't
have the 'read' permission set (but have any other permission set), this
kind of error can be expected sometimes.

I would like to propose this patch to be applied, which will allow the
test to continue even if this message is triggered.  I was not sure
wether I should use a "pass" or "xfail" there, so I chose the second
(which makes more sense to me).

WDYT?

-- 
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

gdb/testsuite/ChangeLog:
2015-03-24  Sergio Durigan Junior  <sergiodj@redhat.com>

	* lib/gdb.exp (gdb_core_cmd): Handle "Cannot access memory at
	address..." message.

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index f274b64..48b50b5 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3573,7 +3573,7 @@ proc gdb_gcore_cmd {core test} {
 # -1 - core file failed to load
 
 proc gdb_core_cmd { core test } {
-    global gdb_prompt
+    global gdb_prompt hex
 
     gdb_test_multiple "core $core" "$test" {
 	-re "\\\[Thread debugging using \[^ \r\n\]* enabled\\\]\r\n" {
@@ -3591,6 +3591,10 @@ proc gdb_core_cmd { core test } {
 	    fail "$test (incomplete note section)"
 	    return 0
 	}
+	-re "Cannot access memory at address $hex\r\n$gdb_prompt $" {
+	    pass "$test (could not access some memory regions)"
+	    return 0
+	}
 	-re "Core was generated by .*\r\n$gdb_prompt $" {
 	    pass "$test"
 	    return 1

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

end of thread, other threads:[~2015-03-31 23:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25  0:06 [RFC/PATCH] Extend gdb_core_cmd to allow "Cannot access memory..." messages Sergio Durigan Junior
2015-03-27 10:06 ` Pedro Alves
2015-03-27 22:34   ` [PATCH] Catch exception on solib_svr4_r_ldsomap (was: Re: [RFC/PATCH] Extend gdb_core_cmd to allow "Cannot access memory..." messages) Sergio Durigan Junior
2015-03-31 11:30     ` [PATCH] Catch exception on solib_svr4_r_ldsomap Pedro Alves
2015-03-31 23:39       ` Sergio Durigan Junior

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).