Re: Make note information human readable when help -D

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/18/2014 05:07 AM, Dave Anderson wrote:
OK thanks -- although further testing showed that the patch needed a bit more work
in netdump.c to prevent calling display_ELF_note() if:

(1) the architecture is not x86 or x86-64
(2) the note type is not NT_PRSTATUS or QEMU, because it would also erroneously pass
     pointers to other note types such as NT_PRPSINFO and NT_TASKSTRUCT.

Queued for crash-7.1.0:

   https://github.com/crash-utility/crash/commit/e36a1eb28b30c12deb72ffc515747801facae913


Hello Dave,

I found something is missing in the committed patch. In dump_Elf64_Nhdr, qemu note of X86
is not available to call display_ELF_note. The process is like below:

if (BITS32() && type == NT_PRSTATUS)
	display_ELF_note
else
	if (machine_type("X86_64"))
		display_ELF_note

And about the fix, please check the attachment.

--
Regards
Qiao Nuohan
>From 992f826e0a590a023efe7cf663db6095baa52dbd Mon Sep 17 00:00:00 2001
From: Qiao Nuohan <qiaonuohan@xxxxxxxxxxxxxx>
Date: Mon, 22 Dec 2014 11:56:26 +0800
Subject: [PATCH] qemu note

---
 netdump.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/netdump.c b/netdump.c
index 1f1cb0b..3eaeeee 100644
--- a/netdump.c
+++ b/netdump.c
@@ -2271,10 +2271,14 @@ dump_Elf64_Nhdr(Elf64_Off offset, int store)
 		}
 	}
 
-	if (BITS32() && (xen_core || (note->n_type == NT_PRSTATUS))) {
+	if (BITS32() && (xen_core || (note->n_type == NT_PRSTATUS) || qemuinfo)) {
 		if (nd->ofp && !XEN_CORE_DUMPFILE() && !(pc->flags2 & LIVE_DUMP)) {
-			if (machine_type("X86") && (note->n_type == NT_PRSTATUS))
-				display_ELF_note(EM_386, PRSTATUS_NOTE, note, nd->ofp);
+			if (machine_type("X86")) { 
+				if (note->n_type == NT_PRSTATUS)
+					display_ELF_note(EM_386, PRSTATUS_NOTE, note, nd->ofp);
+				else if(qemuinfo)
+					display_ELF_note(EM_386, QEMU_NOTE, note, nd->ofp);
+			}
 		}
 
 		iptr = (int *)uptr;
-- 
1.8.5.3

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux