[okl4-developer] no debugging symbols with gdb

Tim Heath timh at ok-labs.com
Fri May 2 00:54:47 EST 2008


Lucas:

Thanks for sharing your findings. 
Keep up the good work.

Regards,

Tim Heath
Open Kernel Labs
312 924-1073



-----Original Message-----
From: developer-bounces at okl4.org [mailto:developer-bounces at okl4.org] On
Behalf Of Nelson Tam
Sent: Tuesday, April 29, 2008 9:53 AM
To: Lukas HANEL
Cc: developer at okl4.org
Subject: Re: [okl4-developer] no debugging symbols with gdb

Hi Lukas,

On 30/04/2008, at 12:20 AM, Lukas HANEL wrote:
>
> I figured that out on my own, even though I made some detour:
>
> When using the actual binary to boot, I run into problems with the 
> Kernel starting at address 0xf0000000. So I used objcopy 
> --change-addresses -0xXXXXXXXX to forge the kernel to start in my 
> physical memory. That way I was able to run the kernel, but it did not 
> finish the startup. As I figured out, the problem arises from a switch 
> statement, which was transformed into a series of absolute jumps. As 
> these addresses were not changed by objcopy, shortly after such a 
> jump, the kernel crashed.
>
> I tried then to boot the image.boot and use gdb with the original 
> kernel binary and that worked.
>
> As the kernel starts on physical addresses gdb could not use the 
> standard kernel image. So I use my objcopied binary for the first 
> phase of kernel startup. Afterwards I add the original kernel image 
> with add-symbol-file to gdb. And that way I can continue.


Thanks for sharing that with us.  It sounds like a potentially useful  
technique that we could use also.  Definitely we'll look into it  
further and perhaps we can provide better support for gdb-ready ELF  
images that are automatically generated during build time.

--
(nt)

Nelson Tam





More information about the Developer mailing list