Skip to contentSkip to conversation

Debugging Reiser4 with UML in 2.5

DISCUSSION Jon Smirl 3 participants 3 messages Dec 10, 2002 – Dec 11, 2002

lore
Share & tools
lore

Jon Smirl

author
#0 lore raw

I'm trying to give the new Reiser4 a whirl with UML in a 2.5 kernel. I can't seem to figure out how to make gdb work right in this setup. I've heard that UML is being used to develop Reiser4 so maybe you can give me some pointers.

I have the 2.4.59 kernel built with UML and Reiser4 in it. I can boot and come to a prompt. I can mount my reiser4 volume and make files on it, etc..

Now I start up ddd on the host and attach to the tracing thread for UML. I add a "br reiser4_read" and continue.

From the UML prompt I cat a file. My UML console prints out "Trace/breakpoint trap" and continues.

How do I get a gdb hooked to the right process so that it will catch the breakpoint?

=====
Jon Smirl
[email protected]

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

#1 lore raw
Quoted 21 lines · Jon Smirl

I'm trying to give the new Reiser4 a whirl with UML in a 2.5 kernel. I can't seem to figure out how to make gdb work right in this setup. I've heard that UML is being used to develop Reiser4 so maybe you can give me some pointers.

I have the 2.4.59 kernel built with UML and Reiser4 in it. I can boot and come to a prompt. I can mount my reiser4 volume and make files on it, etc..

Now I start up ddd on the host and attach to the tracing thread for UML. I add a "br reiser4_read" and continue.

Quoted 1 line

From the UML prompt I cat a file. My UML console

prints out "Trace/breakpoint trap" and continues.

How do I get a gdb hooked to the right process so that it will catch the breakpoint?

Quoted 12 lines

=====
Jon Smirl
[email protected]

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Oleg will answer your questions in 9 hours (we are in Moscow)....

#2 lore raw
In reply to Jon Smirl

Hello!

Quoted 5 lines · Jon Smirl

I'm trying to give the new Reiser4 a whirl with UML in a 2.5 kernel. I can't seem to figure out how to make gdb work right in this setup. I've heard that UML is being used to develop Reiser4 so maybe you can give me some pointers.

Sure. Later on I assume that you use tt mode of UML (particularly because skas mode is not very usable with reiser4 right now).

Quoted 3 lines

I have the 2.4.59 kernel built with UML and Reiser4 in it. I can boot and come to a prompt. I can mount my reiser4 volume and make files on it, etc..

That's good.

Quoted 3 lines

Now I start up ddd on the host and attach to the tracing thread for UML. I add a "br reiser4_read" and continue.

Hm. First of all you need to compile your UML with CONFIG_DEBUGSYM and CONFIG_PT_PROXY config options.

Quoted 5 lines
Quoted 1 line

From the UML prompt I cat a file. My UML console

prints out "Trace/breakpoint trap" and continues.

How do I get a gdb hooked to the right process so that it will catch the breakpoint?

Run gdb with these two options:
debug=parent gdb-pid=<pid>
where <pid> is pid of gdb process started by your ddd instance. UML will stop after loading, now in ddd type
'att 1' (without quotes)
You will see something like this:
0xa013dc51 in __kill ()

Now put all of the breakpoints you are interested in and this kind of stuff and execute 'c' command to continue UML boot.
After that it works like a debugging userspace threaded program. See http://user-mode-linux.sourceforge.net/debugging.html fore more info.

Bye,
Oleg