On Fri, Jul 31, 2009 at 2:48 AM, Robert P. J. Day <[email protected]>wrote:
> > as a followup to my earlier post, here's something i want to > clarify. there's a difference in how much symbol-based debugging you > can do based on whether you configured your running kernel with > CONFIG_DEBUG_INFO or not, so i wanted to test what the differences Can someone tell me where to mark CONFIG_DEBUG_INFO=y ? > > were between two kernels, one configured with, one without. > > after i built both kernels, you can see the predictable difference > in size (ignore vmlinux.o, of course): > > $ ls -l vmlinux* > -rwxrwxr-x. 1 rpjday rpjday 15649485 2009-07-30 16:51 vmlinux > -rwxrwxr-x. 1 rpjday rpjday 116565773 2009-07-30 16:34 vmlinux.debug.info > -rw-rw-r--. 1 rpjday rpjday 15891639 2009-07-30 16:51 vmlinux.o > $ > > my basic question with the above is whether, apart from the > additional debug info embedded in the kernel image, were the two > kernels *exactly* the same -- that is, would they have the same > sections, with the same sizes, at the same offsets, so i could bounce > from one to the other with "gdb" to test the differences and not have > to keep rebooting? > > as a quick test, i ran > > $ objdump --section-headers <kernel image name> > > on both, and the only difference was the additional debug sections at > the end of the debug version: > > 2c2 > < vmlinux: file format elf64-x86-64 > --- > > vmlinux.debug.info: file format elf64-x86-64 > 89a90,107 > > 42 .debug_aranges 0001b040 0000000000000000 0000000000000000 00cace00 > 2**4 > > CONTENTS, READONLY, DEBUGGING > > 43 .debug_pubnames 00051010 0000000000000000 0000000000000000 > 00cc7e40 2**0 > > CONTENTS, READONLY, DEBUGGING > > 44 .debug_info 04c22970 0000000000000000 0000000000000000 00d18e50 > 2**0 > > CONTENTS, READONLY, DEBUGGING > > 45 .debug_abbrev 001e0d1e 0000000000000000 0000000000000000 0593b7c0 > 2**0 > > CONTENTS, READONLY, DEBUGGING > > 46 .debug_line 0044f12b 0000000000000000 0000000000000000 05b1c4de > 2**0 > > CONTENTS, READONLY, DEBUGGING > > 47 .debug_frame 0013ed00 0000000000000000 0000000000000000 05f6b610 > 2**3 > > CONTENTS, READONLY, DEBUGGING > > 48 .debug_str 0018f17c 0000000000000000 0000000000000000 060aa310 > 2**0 > > CONTENTS, READONLY, DEBUGGING > > 49 .debug_loc 0090b310 0000000000000000 0000000000000000 0623948c > 2**0 > > CONTENTS, READONLY, DEBUGGING > > 50 .debug_ranges 001a5f10 0000000000000000 0000000000000000 06b447a0 > 2**4 > > CONTENTS, READONLY, DEBUGGING > > the fact that all of the prior sections were (apparently) identical > suggests that i can, in fact, swap one kernel image with the other for > "gdb" and everything should continue to work, with the exception of > having symbols or not. is that a safe assumption? it *seems* to be, > i'm just wondering if anyone knows for sure. > > rday > > p.s. the above suggests that, if those debug sections are the only > difference, rather than build both versions of the kernel, i could > build the DEBUG_INFO version, save that, then strip a copy of it of > all of those debug sections to get the same effect, yes? > > -- > > ======================================================================== > Robert P. J. Day Waterloo, Ontario, CANADA > > Linux Consulting, Training and Annoying Kernel Pedantry. > > Web page: http://crashcourse.ca > Twitter: http://twitter.com/rpjday > "Kernel Newbie Corner" column @ linux.com: http://cli.gs/WG6WYX > ======================================================================== > > -- > To unsubscribe from this list: send an email with > "unsubscribe kernelnewbies" to [email protected] > Please read the FAQ at http://kernelnewbies.org/FAQ > > -- Regards, ~Sid~
