[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] GDB debugging with threads
Hi John,
I tried the instructions which you sent me in your previous mail. I got a couple of compile errors during the build process.
In utils.c file in user/gdbserver, in the function "perror_with_name", sys_nerr and sys_errlist are being thrown out as undefined. I fixed this by commenting out those lines. A similar error occurred in linux_low.c.
Finally, I got this to build and when I tried testing it..it was not working as expected...the gdb running on the host doesn't still recognize the threads being created.
Appreciate your inputs on what to do next to get this to work.
Thanks, Sowmya
-----Original Message-----
From: John Williams [mailto:jwilliams@itee.uq.edu.au]
Sent: Thursday, June 02, 2005 7:40 PM
To: Jadda, Sowmya (GE Infrastructure Security); Walter Tomkoski
Subject: Re: microblaze-uClinux-GDB threads problem
Hi Sowmya,
I have not tried multithreaded gdbserver support previously. I spent
some time and at least got it to compile - you can follow my
instructions and test it for yourself:
1. Get the latest copy of uClinux-2.4.x/include/asm-microblaze/elf.h
from CVS
2. Edit the following line in your uClibc/.config file:
change
# PTHREADS_DEBUG_SUPPORT is not set
to
PTHREADS_DEBUG_SUPPORT=y
3. Copy attached gregset.h and gdb_proc_service.h files into
user/gdbserver directory
4. edit user/gdbserver/configure.srv, around line 74 (in the
mb*-*-linux*) section add this line:
srv_linux_thread_db=yes
5. apply the attached procfs.patch in the directory
uClinux-dist/uClibc/libc/sysdeps/linux/microblaze/sys
$ patch -p0 < procfs.patch
6. Clean your libs and the gdbserver application (from uClinux-dist)
$ make lib_clean
$ rm -rf user/gdbserver/build
7. make the libs and gdbserver
$ make dep lib_only user_only
8. gdbserver will bomb out with an error like this:
./../gdb_proc_service.h:62: error: redefinition of typedef 'prfpregset_t'
/mnt/home2/jwilliam/cvstest/uClinux-dist/include/sys/procfs.h:133:
error: previous declaration of 'prfpregset_t' was here
Edit the file user/gdbserver/build/config.h, changing the last two
definitions from this:
/* Define if <sys/procfs.h> has prfpregset_t. */
/* #undef HAVE_PRFPREGSET_T */
/* Define if <sys/procfs.h> has elf_fpregset_t. */
/* #undef HAVE_ELF_FPREGSET_T */
to this:
/* Define if <sys/procfs.h> has prfpregset_t. */
#define HAVE_PRFPREGSET_T 1
/* Define if <sys/procfs.h> has elf_fpregset_t. */
#define HAVE_ELF_FPREGSET_T 1
9. Make user_only again, it should complete cleanly.
Apart from step (8), you should only have to do this once. I haven't
looked to see why step 8 is necessary, you'll just need to redo it after
you clean out the gdbserver/build directory.
As I said, this gets it to compile on my box, but I haven't tested it.
I'll be interested to hear if it works. As I said to Walter, it may
also be necssary to have threads support built into mb-gdb - I cannot
say if that has been done or not.
Regards,
John
Hi John,
> I using the microblaze processor and uClinux distribution for our development. Walt White from GE was earlier in contact with you for the use of GDB.
> Now, I am using the gdbserver to debug a simple thread file. I am facing a problem. Here is the brief description of the problem.
>
> When I tried to debug the thread application using single step with a breakpoint just before the pthread_create(), and when I step over this, I see the thread being created in my application. But when I do a "info threads", I see only one thread, the main thread but not the thread which is created in the application.
>
> I tried to dig into this and found out some silly/interesting facts. But I am sure, how far they are related to this.
>
> 1. In the uClinux-dist/user/gdbserver directory, there is a file called "thread-db.c". After compiling and building the application, I don't see a "thread-db.o". I feel this this might be one of the reasons for the GDB not to recognize that threads are created in my application.
>
> 2. In the uClinux-dist/user/gdbserver directory, there is a Makefile. When I opened and looked for thread-db.o, I see that it is dependent on two other files, server.h and gdb_proc_service.h. And very suprisingly, I donot see that file in the gdbserver directory.
>
> Appreciate your thoughts and inputs on this.
>
> Regards, Sowmya
Sowmya Jadda
GE Infrastructure, Security
EEDP
Enterprise Solutions
T 561 912 1632
F 561 998 6572
C 561 542 7462
D *214-1632
E sowmya.jadda@ge.com
www.gesecurity.com
791 Park of Commerce Blvd., Suite 100
Boca Raton, FL, 33487, U.S.A.
GE Security, Inc.
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/