Hi Dave/Adam, Could you give me some references/examples for this type of debugging. Much appreciation for you great help.
Thanks, John 2007/9/18, David Powell <[EMAIL PROTECTED]>: > > Adam Leventhal wrote: > > On Mon, Sep 17, 2007 at 06:45:58PM +0800, xiong xiaoyi wrote: > >> Hi experts, > >> > >> I have a simple problem on mdb debugging, I use mdb to debug a core, > >> > >>> $C > >> ffbfde18 libc.so.1`realfree+0x40(90c58, ef012eef, ff000000, a90fc, 0, > >> ff362a00) > >> ffbfde78 libc.so.1`cleanfree+0x58 (0, 4, ff01b6b8, ff012620, a885c, 1) > >> ffbfded8 libc.so.1`_malloc_unlocked+0x104(8, ef012eec, 90c50, ef012eef, > >> 1c00, > >> ff19e5c0) > >> ffbfdf38 libc.so.1`malloc+0x48(8, 1cc4, 1, ff012620, a9824, ff01ca2c) > >> ffbfdf98 libc.so.1`calloc+0x58 (8, 8, 8, 10, 30, 30) > >> ffbfdff8 libnsl.so.1`thr_get_storage+0x40(ff22e440, 8, 5ce70, 59c2c, > 0, 0) > >> > >> In above stack, it prints function's argument, but the number of the > >> arguments is not same as the function definition. > >> For example, in mdb, we get: > >> > >> ffbfdf38 libc.so.1`malloc+0x48(8, 1cc4, 1, ff012620, a9824, > ff01ca2c) > >> > >> But the molloc definition is : > >> > >> malloc(size_t size) > >> > >> So from the mdb output above, how can I know what's the size in malloc? > >> Thanks in advance. > > > > This question is probably more appropriate for mdb-discuss, but to > answer: > > > > On SPARC we always give you the values of the 8 input registers in order > > from 0 to 7. You should just pay attention to the first value in this > case. > > Keep in mind that the registers listed in the stack trace are the %i > registers stored at the point the next function was called (in this > case, at malloc+0x48). You will need to verify (with ::dis) that the > register you're interested in hasn't been modified since the top of > the function. If it has, you'll either need to find where the > argument was stashed, or reconstruct the argument using the caller's > stack frame and the code around calloc+0x58. > > Dave > >
_______________________________________________ opensolaris-code mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
