Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Debug multi thread application with Gdbserver on uClinux

Hi,

I'm trying to debug a simple multi thread application with Gdbserver on uClinux no-mmu.

The board is ALTERA NEEK-evb.

I can debug with no problem a process without threads. when trying to create a new thread i get the following error:

ptrace: Input/output error.

and the debug session is stuck.

After some debug i've been able to get the following backtrace of the stuck system :# 0 0x00725120 in __linuxthreads_create_event ()# 1 0x00723e1c in __pthread_initialize_manager ()# 2 0x00723fac in pthread_create ()# 3 0x007201a4 in main ()

Another thing : when i run the program without gdb, i can see that the threads created run and output (printf) to the terminal but my main thread (the one that created the other thread) does not output anything and it seems like he is not running.

Is there any limitation on debugging threads?

Do i need to configure something in the environment in order to debug threads?

Please advise.

Regards,

Raviv

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    AFAIK, thread debugging is not possible with the no-MMU version due to some problem(s) with the tool chain.

    I do not know whether it's possible/tested with the MMU enabled tool chain and/or with the new build system that combines both flavors.

    -Michael
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    AFAIK, thread debugging is not possible with the no-MMU version due to some problem(s) with the tool chain.

    I do not know whether it's possible/tested with the MMU enabled tool chain and/or with the new build system that combines both flavors.

    -Michael

    --- Quote End ---

    mschnell, i also can't debug in multi-core programs, and i use nios2 without MMU, is this the problem?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I don't know what you mean with "multi-core-programs", but if you mean "multi-thread applications, I did not test this myself, but in fact this is what I found in several discussions.

    If you are talking about multi-core hardware: Linux for NIOS is not able to do SMP. And due to limitations of the NIOS architecture, I doubt that we will see an SMP-Linux for same any time soon.

    -Michael