This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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]

pthreads on i686 PC.


   I'm trying to use pthreads on eCos for a Xycom i686 PC. The normal cyg
threading routines work perfectly, but very simply pthread examples
crash on pthread_create.

Here is my source:
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
void* callFunction(void*);
void cyg_user_start(void)
{

  pthread_t thread_id;
  void* thread_result;
  puts("Here");
  pthread_create(&thread_id, NULL, callFunction, NULL);
}
void* callFunction(void* arg)
{
  puts("I've been called!");
  return arg;
}


Also, I tried using gdb remotely to try to figure out what exactly was
going on, but for some odd reason the symbol table never gets loaded.

I run i386-elf-gdb

(gdb) file Test.srec
Reading symbols from Test.srec...done.
(gdb) target remote <ip>:9000
Remote debugging using 155.101.22.185:9000
0x0000c158 in ?? ()
(gdb) load
Loading section .sec1, size 0x33642 lma 0x108000
Loading section .sec2, size 0x2bdc lma 0x13b648
Loading section .sec3, size 0xff8 lma 0x13e228
Start address 0x108000, load size 225814
Transfer rate: 258073 bits/sec, 319 bytes/write.
(gdb) break callFunction
No symbol table is loaded.  Use the "file" command.

I build all of my source using the -g command.

Also, a clue towards what might be happening is if I stick
"pthread_exit(NULL)" in "callFunction," the computer hard resets. Maybe
the main-thread of execution somehow gets killed by this call?

Thanks in advance for any help!
-Jason Thomas.

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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