summaryrefslogtreecommitdiff
path: root/hurd/debugging
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-05-24 23:08:09 +0200
committerThomas Schwinge <thomas@codesourcery.com>2012-05-24 23:08:09 +0200
commit2910b7c5b1d55bc304344b584a25ea571a9075fb (patch)
treebfbfbc98d4c0e205d2726fa44170a16e8421855e /hurd/debugging
parent35b719f54c96778f571984065579625bc9f15bf5 (diff)
Prepare toolchain/logs/master branch.
Diffstat (limited to 'hurd/debugging')
-rw-r--r--hurd/debugging/gdb.mdwn15
-rw-r--r--hurd/debugging/gdb/noninvasive_debugging.mdwn16
-rw-r--r--hurd/debugging/glibc.mdwn91
-rw-r--r--hurd/debugging/rpctrace.mdwn95
-rw-r--r--hurd/debugging/subhurd.mdwn90
-rw-r--r--hurd/debugging/translator.mdwn15
-rw-r--r--hurd/debugging/translator/capturing_stdout_and_stderr.mdwn37
-rw-r--r--hurd/debugging/translator/gdb.mdwn53
-rw-r--r--hurd/debugging/trap_in_the_kernel.mdwn27
9 files changed, 0 insertions, 439 deletions
diff --git a/hurd/debugging/gdb.mdwn b/hurd/debugging/gdb.mdwn
deleted file mode 100644
index 1fede74f..00000000
--- a/hurd/debugging/gdb.mdwn
+++ /dev/null
@@ -1,15 +0,0 @@
-[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]]
-
-[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
-id="license" text="Permission is granted to copy, distribute and/or modify this
-document under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with no Invariant
-Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled
-[[GNU Free Documentation License|/fdl]]."]]"""]]
-
-The [[GNU_debugger_*GDB*|/gdb]] works on GNU/Hurd
-systems as it does on other system, but has some additional [hurd-specific
-features](http://sourceware.org/gdb/current/onlinedocs/gdb_19.html#Hurd%20Native)
-to offer, such as [[noninvasive_debugging]] (for avoiding [[deadlock]]s), for
-example.
diff --git a/hurd/debugging/gdb/noninvasive_debugging.mdwn b/hurd/debugging/gdb/noninvasive_debugging.mdwn
deleted file mode 100644
index fa7a3c5b..00000000
--- a/hurd/debugging/gdb/noninvasive_debugging.mdwn
+++ /dev/null
@@ -1,16 +0,0 @@
-[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]]
-
-[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
-id="license" text="Permission is granted to copy, distribute and/or modify this
-document under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with no Invariant
-Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled
-[[GNU Free Documentation License|/fdl]]."]]"""]]
-
-Sometimes using [[GDB]] on a [[system_server|translator]] can result in a [[deadlock]]. You
-can however still use GDB by using the [`set
-noninvasive`](http://sourceware.org/gdb/current/onlinedocs/gdb_19.html#Hurd%20Native)
-option. This indicates to GDB to not stop the program but allows you to
-nevertheless examine its state. Thus, you can get [[/gdb/backtrace]]s and values of
-variables (and watch them change underneath you).
diff --git a/hurd/debugging/glibc.mdwn b/hurd/debugging/glibc.mdwn
deleted file mode 100644
index 028d4fe4..00000000
--- a/hurd/debugging/glibc.mdwn
+++ /dev/null
@@ -1,91 +0,0 @@
-[[!meta copyright="Copyright © 2007, 2008, 2010, 2011 Free Software Foundation,
-Inc."]]
-
-[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
-id="license" text="Permission is granted to copy, distribute and/or modify this
-document under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with no Invariant
-Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled [[GNU Free Documentation
-License|/fdl]]."]]"""]]
-
-Here are some hints about how to approach testing after nontrivial changes to
-glibc have been done.
-
----
-
-First step is having the build of glibc succeed. This is actually more
-difficult than one might expect as it involves (towards the end of the build
-process -- unless you are cross-compiling, of course -- that the
-newly created libraries and loader actually work: they'll be used to run the
-`rpcgen` program. If that step doesn't succeed, it'll look similar to this:
-
- [...]
- CPP='gcc -E -x c-header' [...]/build/elf/ld.so.1 --library-path [...] [...]/build/sunrpc/rpcgen [...]
- Segmentation fault
-
----
-
-Unless cross-compiling, the next thing you'll probably want to do
-is running the test suite, or parts of it.
-
-There is a list of [[known failures|open_issues/glibc]].
-
----
-
-If you've been doing simple changes to glibc functions that end up in
-`libc.so`, you may test them like this (like for a `strerror_l` implementation
-in this case):
-
- $ LD_PRELOAD=./libc.so ./ld.so ./a.out 10 1073741928 de_DE.utf8
- 1073741928 (0x40000068): Computer bought the farm
- 1073741928 (0x40000068): Der Computer hat den Bauernhof erworben
-
-You usually will only have luck using the new `libc.so` (from
-`[glibc-build]/libc.so`) in combination together with the new `ld.so` (from
-`[glibc-build]/elf/ld.so`):
-
- $ LD_PRELOAD=./libc.so ./a.out 10 1073741928 de_DE.utf8
- Killed
- $ LD_PRELOAD=./libc.so /lib/ld.so ./a.out 10 1073741928 de_DE.utf8
- Killed
-
-Make sure static linking is working OK at all. Running the
-`[glibc-build]/elf/sln` program (a stripped-down `ln` that is statically
-linked) ought to test that. Also, static linking under various conditions will
-already have been tested when running the test suite, especially in `elf/` and
-`dlfcn/`.
-
-Make sure static linking with cthreads is working. If you can get an
-`ext2fs.static` compiled and linked against the new glibc, that is good.
-
-[TODO].
-
-Then debug its startup as a normal program on your working hurd.
-
- $ [...]/ext2fs.static --help
- [...]
-
-Then try its full server startup.
-
- $ settrans -ca node [...]/ext2fs.static BACKING_STORE
- $ ls -l node/
- [...]
-
-Make sure dynamic linking for servers is working. If you haven't broken the
-ABI, you can just use an existing `/hurd/foobar` binary, started the way
-glibc's `testrun.sh` does it.
-
-[TODO]: Is this the correct way to do that?
-
- $ settrans -ca node [glibc]/build/testrun.sh /hurd/ext2fs BACKING_STORE
- $ cd node/
- [...]
-
----
-
-Test it in a [[subhurd]].
-
----
-
-Test it on a real system.
diff --git a/hurd/debugging/rpctrace.mdwn b/hurd/debugging/rpctrace.mdwn
deleted file mode 100644
index fd24f081..00000000
--- a/hurd/debugging/rpctrace.mdwn
+++ /dev/null
@@ -1,95 +0,0 @@
-[[!meta copyright="Copyright © 2007, 2008, 2009, 2010, 2011 Free Software
-Foundation, Inc."]]
-
-[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
-id="license" text="Permission is granted to copy, distribute and/or modify this
-document under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with no Invariant
-Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled [[GNU Free Documentation
-License|/fdl]]."]]"""]]
-
-*rpctrace* is -- roughly -- an equivavlent to Linux's *strace* or Solaris' or
-BSD's *truss*. It is used to trace [[remote_procedure_call|rpc]]s a process is
-doing.
-
-See `rpctrace --help` about how to use it.
-
-
-# Issues and Patches
-
-[[!tag open_issue_hurd]]
-
-* <http://savannah.gnu.org/patch/?2104> -- don't assert that local port names
- are valid
-* <http://savannah.gnu.org/bugs/?3939> -- `rpctrace`d program hangs when signal
- that terminates or suspends it is sent
- * <http://savannah.gnu.org/patch/?1633> -- terminated with `C-c` `rpctrace`d
- programs hang
-* <http://savannah.gnu.org/patch/?5580> -- more readable output
-
-* IRC, unknown channel, unknown date
-
- <youpi> how to rpctrace a translator ?
- <youpi> ah, just settrans /usr/bin/rpctrace...
- <youpi> hum, it hung, and killing it got a Mach panic (thread in unexpected
- state) ...
-
-* IRC, unknown channel, unknown date
-
- <antrik> hm... for a funny effect, try running rpctrace on
- /servers/socket/1, and then use dpkg... ;-)
-
-* IRC, unknown channel, unknown date.
-
- <youpi> the problem of rpctrace is that it's a man in the middle :)
- <youpi> so in principle, by design authentication stuff shouldn't work
- <antrik> I don't think the Hurd auth mechanism in any way prevents or tries to prevent man-in-the-middle...
- <youpi> maybe, but just try, you'll see all kinds of issue as soon as you have authentication stuff
- <youpi> and the basic reason is that being a man in the middle needs special care
- <youpi> which rpctrace doesn't completely do
- <antrik> it's a while since I have dived into rpctrace; but AIUI, it should work just fine if the proxying is done properly
- <antrik> note that there is a number of known bugs in rpctrace, for which zhengda has sent patches... though I haven't reviewed all of them I think
- <antrik> there are some nasty Mach operations that are really hard to proxy -- but I don't think the auth mechanism needs any of these...
-
-* IRC, freenode, #hurd, 2011-11-04
-
- [[!taglink open_issue_documentation]]
-
- <mcsim> hello. Are there any documentation about understanding output
- of rpctrace?
- <braunr> no
- <braunr> you should read the source code, best doc available
- <braunr> if you have too many numbers and almost no symbolc names,
- you're lacking rpc definition lists
- <braunr> check that the gnumach-common package is installed, as it
- provides the gnumach definitions
- <braunr> (the glibc ones are almost always available)
- <braunr> with those two, you should be fine for the beginning
- <mcsim> gnumach-common is installed. And what is the name for glibc
- package for gnumach definitions.
- <mcsim> Also I'm using libraries specified by LD_LIBRARY_PATH. Does it
- make influence on absence of symbolic names?
- <braunr> no
- <braunr> rpctrace --help
- <braunr> see the --rpc-list=FILE option
- <braunr> the default lists are in /usr/share/msgids/, with the .msgids
- extension
- <braunr> $ dpkg -S msgids
- <braunr> gnumach-common: /usr/share/msgids/gnumach.msgids
- <braunr> hurd: /usr/share/msgids/hurd.msgids
- <braunr> ok, glibc has none, it's the hurd
- <braunr> for more details about the output, read the source code
- <braunr> it shouldn't be that hard to grasp
- <mcsim> -I /usr/share/msgids helped
- <mcsim> thank you
- <braunr> it shouldn't have, it's the default path
- <mcsim> but symbolic names appeared
- <braunr> well, that's weird :)
- <pinotree> braunr: the output of rpctrace --help should tell the
- default dir for msgids
-
-
-# See Also
-
-See also [[open_issues/librpci]].
diff --git a/hurd/debugging/subhurd.mdwn b/hurd/debugging/subhurd.mdwn
deleted file mode 100644
index 7b5b07b1..00000000
--- a/hurd/debugging/subhurd.mdwn
+++ /dev/null
@@ -1,90 +0,0 @@
-# General Information
-
-* [[/hurd/subhurd]]
-
----
-
-# Debugging the Hurd Startup Process
-
-_one.full_ is the subhurd's root file system image and has been installed as
-follows: [TODO]
-
-_Wx_ translates to terminal window _x_.
-
-W1
-
- $ fsysopts one.full/ --readonly
- $ sudo boot -I -d -s -D one.full/ one.full/boot/script.boot one.full.ext2
- Pausing. . .
-
-(In theory it shouldn't be neccessary to run the subhurd as user _root_, but in
-practice [that doesn't work at the
-moment](http://savannah.gnu.org/bugs/?17341).)
-
-W2
-
- $ ps -Af
- [...]
- root 851 385 p4 0:00.01 boot -I -d -s -D one.full/ one.full/boot/script.boot one.full.ext2
- - 853 1 ? 0:00.00 ?
- - 854 1 ? 0:00.00 ?
- [...]
- $ sudo gdb /var/tmp/one.full/hurd/ext2fs.static
- [...]
- (gdb) attach 853
- Attaching to program `/var/tmp/one.full/hurd/ext2fs.static', pid 853
- warning: Can't modify tracing state for pid 853: No signal thread
- Can't fetch registers from thread 1: No such thread
-
-(The _boot_ program [could be modified to print out the
-pids](http://savannah.gnu.org/bugs/?19254), so that one wouldn't have to fumble
-with _ps_.)
-
-W3
-
- $ sudo gdb /var/tmp/one.full/lib/ld.so.1
- [...]
- (gdb) set solib-absolute-prefix /var/tmp/one.full
- (gdb) attach 854
- Attaching to program `/var/tmp/one.full/lib/ld.so.1', pid 854
- warning: Can't modify tracing state for pid 854: No signal thread
- Can't fetch registers from thread 1: No such thread
-
-W1
-
- [<Enter>.]
- /hurd/ext2fs.static --bootflags=-dsf --host-priv-port=38 --device-master-port=43 --exec-server-task=47 -Tdevice pseudo-root
- /lib/ld.so.1 /hurd/exec
-
-Now that this step has been accomplished, you can set break points in GDB, etc.
-
-W2
-
- (gdb) continue
- Continuing.
- warning: Can't wait for pid 853: No child processes
-
-W1
-
- Hurd server bootstrap: ext2fs.static[pseudo-root] exec
-
-W3
-
- (gdb) continue
- Continuing.
- warning: Can't wait for pid 854: No child processes
-
- Program received signal EXC_BAD_ACCESS, Could not access memory.
- __mach_port_mod_refs (task=1, name=139802, right=1, delta=-1)
- at /var/tmp/glibc-2_5-branch/build_--without-tls_--without-__thread/mach/RPC_mach_port_mod_refs.c:132
- 132 InP->Head.msgh_reply_port = __mig_get_reply_port();
- (gdb) x/i $pc
- 0x168f2 <__mach_port_mod_refs+82>: call 0x151b0 <__mig_get_reply_port>
-
----
-
-Sources:
-
-* [[subhurd/running_a_subhurd]]
-* <http://lists.gnu.org/archive/html/bug-hurd/2007-02/msg00030.html>
-* [[Thomas_Schwinge|tschwinge]]'s mind
diff --git a/hurd/debugging/translator.mdwn b/hurd/debugging/translator.mdwn
deleted file mode 100644
index d439e17b..00000000
--- a/hurd/debugging/translator.mdwn
+++ /dev/null
@@ -1,15 +0,0 @@
-[[!meta copyright="Copyright © 2008 Free Software Foundation, Inc."]]
-
-[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
-id="license" text="Permission is granted to copy, distribute and/or modify this
-document under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with no Invariant
-Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled
-[[GNU Free Documentation License|/fdl]]."]]"""]]
-
-[[!inline
-pages="hurd/debugging/translator/* and !*/discussion"
-show=0
-feeds=no
-actions=yes]]
diff --git a/hurd/debugging/translator/capturing_stdout_and_stderr.mdwn b/hurd/debugging/translator/capturing_stdout_and_stderr.mdwn
deleted file mode 100644
index b7cfc3c9..00000000
--- a/hurd/debugging/translator/capturing_stdout_and_stderr.mdwn
+++ /dev/null
@@ -1,37 +0,0 @@
-[[!meta copyright="Copyright © 2008, 2009, 2010 Free Software Foundation,
-Inc."]]
-
-[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
-id="license" text="Permission is granted to copy, distribute and/or modify this
-document under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with no Invariant
-Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled
-[[GNU Free Documentation License|/fdl]]."]]"""]]
-
-Sometimes it may already be helpful to capture a translator's `stdout` and
-`stderr`, for example in this situation where [[translator/pfinet]] was
-silently dying all the time, without any console output:
-
- $ sudo settrans -fgap ↩
- /servers/socket/2 ↩
- /bin/sh -c '/hurd/pfinet -i eth0 -a [...] > /tmp/stdout 2> /tmp/stderr'
- $ [...]
- $ cat /tmp/stdout
- NET4: Linux TCP/IP 1.0 for NET4.0
- IP Protocols: ICMP, UDP, TCP
- TCP: Hash tables configured (ehash 65536 bhash 65536)
- $ cat /tmp/stderr
- pfinet: ../../hurd.work/pfinet/ethernet.c:196: ethernet_xmit: Unexpected error: (os/device) invalid IO size.
-
-(Trying to run [[GDB]] in this case was of no help -- due to a bug in GDB
-(supposedly) it wouldn't catch the fault.)
-
-Be made aware that both `stdout` and `stderr` will be block bufferend and no
-longer line buffered when doing such a redirection, so you'll have to arrange
-for appropriate `fflush`es on these, or force them to be line buffered again
-using the appropriate glibc magic (`setvbuf`). Otherwise you'll see text in
-the output files only if either glibc herself decides to flush (after some KiB
-of text) the after translator exits.
-
-There is also a [[related open issue|open_issues/translator_stdout_stderr]].
diff --git a/hurd/debugging/translator/gdb.mdwn b/hurd/debugging/translator/gdb.mdwn
deleted file mode 100644
index 82a50736..00000000
--- a/hurd/debugging/translator/gdb.mdwn
+++ /dev/null
@@ -1,53 +0,0 @@
-[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]]
-
-[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
-id="license" text="Permission is granted to copy, distribute and/or modify this
-document under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with no Invariant
-Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled
-[[GNU Free Documentation License|/fdl]]."]]"""]]
-
-Say you want to try running file system server ([[`ext2fs`|translator/ext2fs]],
-[[`jfs`|translator/jfs]], ...) against a modified version of
-[[`libpager`|libpager]] and debug the latter one using [[debugging/GDB]].
-
-Set the [[hurd/translator]] like this:
-
- $ settrans -fgap ↩
- jfs.img.i ↩
- /usr/bin/env ↩
- LD_LIBRARY_PATH=~tschwinge/tmp/hurd/hurd.ogi/build/libpager ↩
- "$PWD"/jfs.obj/jfs ↩
- "$PWD"/jfs.img
-
-Then, when starting GDB, start it like this (or use an equivalent method, of
-course):
-
- $ LD_LIBRARY_PATH=~tschwinge/tmp/hurd/hurd.ogi/build/libpager ↩
- gdb ↩
- ~tschwinge/tmp/jfs/jfs.obj/jfs 15436
- GNU gdb 6.5-debian
- [...]
- Reading symbols from /lib/libdiskfs.so.0.3...Reading symbols from /lib/debug/lib/libdiskfs.so.0.3...done.
- done.
- Loaded symbols for /lib/libdiskfs.so.0.3
- Reading symbols from /devel4/tschwinge/tmp/hurd/hurd.ogi/build/libpager/libpager.so.0.3...done.
- Loaded symbols for /devel4/tschwinge/tmp/hurd/hurd.ogi/build/libpager/libpager.so.0.3
- Reading symbols from /lib/libstore.so.0.3...Reading symbols from /lib/debug/lib/libstore.so.0.3...done.
- done.
- Loaded symbols for /lib/libstore.so.0.3
- [...]
- (gdb) break pager_demuxer
- Breakpoint 1 at 0x105c98d: file ../../libpager/demuxer.c, line 27.
- [...]
- Breakpoint 1, pager_demuxer (inp=0x12bded0, outp=0x12bbec0) at ../../libpager/demuxer.c:27
- 27 {
- (gdb) list
- 22 /* Demultiplex a single message directed at a pager port; INP is the
- 23 message received; fill OUTP with the reply. */
- 24 int
- 25 pager_demuxer (mach_msg_header_t *inp,
- [...]
-
-Voilà.
diff --git a/hurd/debugging/trap_in_the_kernel.mdwn b/hurd/debugging/trap_in_the_kernel.mdwn
deleted file mode 100644
index 11f989e3..00000000
--- a/hurd/debugging/trap_in_the_kernel.mdwn
+++ /dev/null
@@ -1,27 +0,0 @@
-[[!meta copyright="Copyright © 2010 Free Software Foundation, Inc."]]
-
-[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
-id="license" text="Permission is granted to copy, distribute and/or modify this
-document under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with no Invariant
-Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled [[GNU Free Documentation
-License|/fdl]]."]]"""]]
-
-[[!tag open_issue_gnumach open_issue_documentation]]
-
-IRC, #hurd, September 2010
-
- <diegonc> when an application executes an out instruction in user mode, how is
- kernel mode entered? general protection trap?
- <youpi> some sort of trap, yes
- <youpi> I'd rather think about illegal instruction, but yes
- <diegonc> hm.. so to debug what happens inside that instruction I'll have to
- break at the trap handler. Can I instruct kdb to stop only when a given task
- caused the trap?
- <youpi> applications usually don't trap, so what I usually do is to uncomment
- the test at the end of user_trap() before the call to kdb_trap()
- <diegonc> "if (debug_all_traps_with_kdb && .. " <- that test?
- <youpi> yes
- <youpi> so comment the test to make kdb_trap() called all the time
- <diegonc> oh, I understand now :)