FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 01-01-1970, 01:00 AM
HATAYAMA Daisuke
 
Default x86: Collect register values for active tasks from KVMDUMP notes

KVMDUMP format contains register values for active tasks. So, get the
register values in case of KVMDUMP format.

Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
---
src/libgcore/gcore_x86.c | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/src/libgcore/gcore_x86.c b/src/libgcore/gcore_x86.c
index 03c3579..8c129d3 100644
--- a/src/libgcore/gcore_x86.c
+++ b/src/libgcore/gcore_x86.c
@@ -1742,6 +1742,30 @@ void gcore_x86_64_regsets_init(void)
#endif /* X86_64 */

#ifdef X86
+static void
+get_regs_from_kvmdump_notes(struct task_context *target,
+ struct user_regs_struct *regs)
+{
+ struct register_set *r = &kvm->registers[target->processor];
+
+ regs->ax = r->regs[0];
+ regs->cx = r->regs[1];
+ regs->dx = r->regs[2];
+ regs->bx = r->regs[3];
+ regs->sp = r->regs[4];
+ regs->bp = r->regs[5];
+ regs->si = r->regs[6];
+ regs->di = r->regs[7];
+ regs->cs = r->cs;
+ regs->ss = r->ss;
+ regs->ds = r->ds;
+ regs->es = r->es;
+ regs->fs = r->fs;
+ regs->gs = r->gs;
+ regs->ip = r->ip;
+ regs->flags = r->flags;
+}
+
static int genregs_get32(struct task_context *target,
const struct user_regset *regset,
unsigned int size, void *buf)
@@ -1750,6 +1774,13 @@ static int genregs_get32(struct task_context *target,
char *pt_regs_buf;
ulonglong pt_regs_addr;

+ if (is_task_active(target->task) && KVMDUMP_DUMPFILE()) {
+ get_regs_from_kvmdump_notes(target, regs);
+ if (user_mode(regs)) {
+ return TRUE;
+ }
+ }
+
pt_regs_buf = GETBUF(SIZE(pt_regs));

pt_regs_addr = machdep->get_stacktop(target->task) - SIZE(pt_regs);
--
1.7.4


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

Thread Tools




All times are GMT. The time now is 08:24 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org