ville.mattila@stonesoft.com wrote:
 
> >  When trying to get line numbers for disassembler output, I get
> > "dis: line numbers are not available" and normal disassembled output.
> > What am I missing?
> >
> > thanks,
> >
> >  - Ville
>
> You must be running a "patched-gdb", i.e., using a System.map or
> another vmlinux file on the crash command line that doesn't match
> the running/dumped kernel.

 Yes, I'm inspecting a crashdump and I thought I had compiled exact same
 kernel but "-g" flag enabled.  Does crash need all the kernel modules
 to be compiled with -g option as weel.
 

Right -- unfortunately the recompilation of the exact same kernel may
cause a shift in kernel text addresses, which throws off the line number
information.  You might try just running "crash vmlinux.dbg vmcore" and
see what happens.  If it doesn't complain about a mis-match, you should
be OK.  But if there is a shift in the text addressing, then there's a good
chance that it will propagate up into the static data addressing as well,
and the mis-match ensues...

For any kind of module data structure information to be picked up
when loading the module with the "mod" command, yes, the modules
would need to be compiled with -g as well.  However, due to the
relocation associated with kernel module object files, line numbers
have never worked with kernel modules.

 
 I'm using crash 4.0.3-4 and invoking crash like this:
 > crash vmlinux vmlinux.dbg vmcore
 vmlinux is kernel compiled without "-g" and vmlinux.dbg is "-g" compiled,
 the vmcore is the crashdump file generated by crashkernel. Should "dis -l" work
 in this case? Should I use system.map file as the crash is generated by another
 machine?
 
No, you're doing the right thing, but you won't get line numbers.

The system.map file won't help either -- it can be used as an
alternative to using the stripped "vmlinux" command line argument,
but it won't buy you anything.

Dave