This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Can this be happening?


> -----Original Message-----
> From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org]On
> Behalf Of Mohammed, Moqtadir
> 
> > -----Original Message-----
> > From: Daniel Jacobowitz [mailto:drow@false.org]
> > 
> > On Tue, Jul 03, 2007 at 02:38:51PM -0700, Jim Blandy wrote:
> > > I don't know why the upper bits would be set.  GDB may be
> > > misinterpreting the information in the core file.
> > 
> > The kernel dumps it as 32-bit too.  It's not clear what 
> those bits are
> > for, but I bet they're really in your core dump and you 
> should ask the
> > kernel developers.
> > 
> > Moves from the segment registers may leave implementation 
> defined data
> > in the upper half register - but that's only for fairly old Intel
> > processors.
> 
> I didn't knew that the dump itself was 32 bit. Will check the 
> core dump code
> in kernel to see if it is truncating or not before dumping.
> 
Just for the record, I see that in
http://lxr.linux.no/source/fs/binfmt_elf.c#L1473

They truncate the segment registers to 16 bit for all the threads
in the process except the current thread whose regs do not get truncated:

There are two calls used : 
elf_core_copy_regs for the current thread
elf_core_copy_task_regs in elf_dump_thread_status() which truncates.

Since in my application, the thread that crashed was the current thread,
the registers were not truncated and which is probably why we see 32bit values.

Someone can please close the bug 2281.

Thanks,
Moqtadir


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]