All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Antoine Martin <antoine@nagafix.co.uk>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] buggy UML AMD64?
Date: Tue, 23 Jan 2007 17:20:07 +0200	[thread overview]
Message-ID: <45B627A7.7070407@panasas.com> (raw)
In-Reply-To: <45B364DC.8040405@nagafix.co.uk>

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

Antoine Martin wrote:
>> for me I just do
>> #gdb um/vmlinux (was compiled with -O um)
>> gdb>run ubd0=/var/opt/FedoraCore5-AMD64-root_fs eth0=tuntap,,,192.168.0.117
>> after first trap in gdb
>> gdb>handle SIGUSR1 pass nostop noprint
>> from than on its strait gdb, tell me if you need a script for loading symbols of kernel modules.
>
> That would be great, it could go on the wiki too.
> 
> Thanks
> Antoine

Attach is a script that works for both uml running in gdb or for kgdb.
Usage: add-symbol-file module

Where module can be just the mod_name or mod_name.ko or a full-path

What you do is ssh into a running uml, after the module was loaded by the uml, and run the script.
The printed message is what you need to paste at the gdb command-line. (the first chance you get)
Note that the path echoed is relative to the uml root. You might need to adjust it for gdb since
gdb will see the host path. If the module is inside the root_fs file than you will need to point
gdb to a copy of the module file on the host.

I hope that helps
Boaz Harrosh

[-- Attachment #2: add-symbol-file --]
[-- Type: text/plain, Size: 1669 bytes --]

#!/bin/sh
#
# Print gdb command to load a module's symbols
#
# Copyright (C) 2006 Panasas, Inc.  All rights reserved.
# Copyright (C) 2006 Benny Halevy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# Usage: add-symbol-file module
#   module can be either the module name or path to the module object.
#
# Note: When used in UML, this script must run in UML's context in order
#       to access /sys/module/$mod/sections/.* to get the dynamic relocation
#       addresses but the module path must be valid in gdb's context so that
#       gdb can load the object.
#
progname=`basename $0`
mod=$1
if [ "$mod" = "" ]; then
	echo Usage: `$progname` module 1>&2
	exit 1
fi
if [[ -e "$mod" || "$mod" == */* ]]; then
	obj="$mod"
else
	rel=`uname -r`
	modpath="/lib/modules/$rel/kernel"
	obj=`find $modpath -name "$mod" -o -name "$mod.ko" -o -name "$mod.o" | head -1`
	if [ ! -e "$obj" ]; then
		echo "$progname: $mod was not found in $modpath" 1>&2
		exit 1
	fi
fi
mod=`basename $mod | sed 's/\..*o$//'`
dir=/sys/module/$mod/sections
if [ ! -d $dir ]; then
	echo "$progname: $dir not found" 1>&2
	exit 1
fi

s="`cat $dir/.text`"
for i in .rodata .data .bss; do
	s="$s -s $i `cat $dir/$i`"
done

echo "add-symbol-file $obj $s"

[-- Attachment #3: Type: text/plain, Size: 347 bytes --]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 194 bytes --]

_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2007-01-23 15:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-17 16:15 [uml-devel] UML/64bit is miscompiled by gcc 4.0.3 on Ubuntu 6.06 LTS Blaisorblade
2007-01-17 18:17 ` Christopher S. Aker
2007-01-17 18:15   ` Antoine Martin
2007-01-17 19:50     ` Antoine Martin
2007-01-19 11:00       ` [uml-devel] buggy UML AMD64? Antoine Martin
2007-01-19 16:07         ` Daniel Gryniewicz
2007-01-19 16:14           ` Antoine Martin
2007-01-19 16:38             ` Daniel Gryniewicz
2007-01-19 16:42               ` Antoine Martin
2007-01-19 17:33                 ` Antoine Martin
2007-01-19 19:56                   ` Antoine Martin
2007-01-21  9:17                     ` Boaz Harrosh
2007-01-21 13:04                       ` Antoine Martin
2007-01-23 15:20                         ` Boaz Harrosh [this message]
2007-01-21 14:38                     ` Joel Palmius
2007-01-21 14:46                       ` Antoine Martin
2007-01-21 14:55                         ` Joel Palmius
2007-01-21 16:11                         ` Joel Palmius
2007-01-22 22:09                         ` Jeff Dike
2007-01-23  0:59                           ` Antoine Martin
2007-01-19 16:38             ` Antoine Martin
2007-02-15  3:43     ` [uml-devel] UML/64bit is miscompiled by gcc 4.0.3 on Ubuntu 6.06 LTS Blaisorblade
2007-01-19 23:31   ` Blaisorblade
2007-01-17 23:26 ` Jeff Dike
2007-01-19 23:18   ` Blaisorblade
2007-01-22 20:59     ` Jeff Dike
2007-01-23  8:09       ` Blaisorblade

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45B627A7.7070407@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=antoine@nagafix.co.uk \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.