Re: [PATCH 00/11] sadump: Incremental update patches

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

 



diff --git a/netdump.c b/netdump.c
index f8da284..4011f36 100644
--- a/netdump.c
+++ b/netdump.c
@@ -2508,6 +2508,7 @@ next_sysrq:
 		    (((sp >= GET_STACKBASE(bt->task)) &&
 		      (sp < GET_STACKTOP(bt->task))) ||
 		    in_alternate_stack(bt->tc->processor, sp))) {
+			bt->flags |= BT_KERNEL_SPACE;
 			*eip = ip;
 			*esp = sp;
 			return;
diff --git a/x86.c b/x86.c
index b69adb2..df91110 100755
--- a/x86.c
+++ b/x86.c
@@ -699,6 +699,8 @@ db_stack_trace_cmd(addr, have_addr, count, modif, task, flags)
 	} else if ((bt->flags & BT_KERNEL_SPACE)) {
 		if (KVMDUMP_DUMPFILE())
 			kvmdump_display_regs(bt->tc->processor, fp);
+		else if (ELF_NOTES_VALID() && DISKDUMP_DUMPFILE())
+			diskdump_display_regs(bt->tc->processor, fp);
 		else if (SADUMP_DUMPFILE())
 			sadump_display_regs(bt->tc->processor, fp);
 	}
diff --git a/x86_64.c b/x86_64.c
index 7a7de3c..1c18999 100755
--- a/x86_64.c
+++ b/x86_64.c
@@ -2880,7 +2880,9 @@ x86_64_low_budget_back_trace_cmd(struct bt_info *bt_in)
 			sadump_display_regs(bt->tc->processor, ofp);
 		return;
 	} else if ((bt->flags & BT_KERNEL_SPACE) &&
-		   (KVMDUMP_DUMPFILE() || SADUMP_DUMPFILE())) {
+		   (KVMDUMP_DUMPFILE() ||
+		    (ELF_NOTES_VALID() && DISKDUMP_DUMPFILE()) ||
+		    SADUMP_DUMPFILE())) {
 		fprintf(ofp, "    [exception RIP: ");
 		if ((sp = value_search(bt->instptr, &offset))) {
 			fprintf(ofp, "%s", sp->name);
@@ -2892,6 +2894,8 @@ x86_64_low_budget_back_trace_cmd(struct bt_info *bt_in)
 		fprintf(ofp, "]\n");
 		if (KVMDUMP_DUMPFILE())
 			kvmdump_display_regs(bt->tc->processor, ofp);
+		else if (ELF_NOTES_VALID() && DISKDUMP_DUMPFILE())
+			diskdump_display_regs(bt->tc->processor, ofp);
 		else if (SADUMP_DUMPFILE())
 			sadump_display_regs(bt->tc->processor, ofp);
         } else if (bt->flags & BT_START) {
@@ -4377,6 +4381,11 @@ skip_stage:
 	if (ur_rip && ur_rsp) {
         	*rip = ur_rip;
 		*rsp = ur_rsp;
+		if (is_kernel_text(ur_rip) &&
+		    (((ur_rsp >= GET_STACKBASE(bt->task)) &&
+		      (ur_rsp < GET_STACKTOP(bt->task))) ||
+		     in_alternate_stack(bt->tc->processor, ur_rsp)))
+			bt_in->flags |= BT_KERNEL_SPACE;
 		if (!is_kernel_text(ur_rip) && in_user_stack(bt->tc->task, ur_rsp))
 			bt_in->flags |= BT_USER_SPACE;
 		return;
@@ -4400,8 +4409,19 @@ skip_stage:
 	 *  Use what was (already) saved in the panic task's 
 	 *  registers found in the ELF header.
 	 */ 
-	if (bt->flags & BT_KDUMP_ELF_REGS)
+	if (bt->flags & BT_KDUMP_ELF_REGS) {
+		user_regs = bt->machdep;
+		ur_rip = ULONG(user_regs + OFFSET(user_regs_struct_rip));
+		ur_rsp = ULONG(user_regs + OFFSET(user_regs_struct_rsp));
+		if (is_kernel_text(ur_rip) &&
+		    (((ur_rsp >= GET_STACKBASE(bt->task)) &&
+		      (ur_rsp < GET_STACKTOP(bt->task))) ||
+		     in_alternate_stack(bt->tc->processor, ur_rsp)))
+			bt_in->flags |= BT_KERNEL_SPACE;
+		if (!is_kernel_text(ur_rip) && in_user_stack(bt->tc->task, ur_rsp))
+			bt_in->flags |= BT_USER_SPACE;
 		return;
+	}
 
 	if (CRASHDEBUG(1)) 
         	error(INFO, 
--
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