The problem is that GDB ask for current thread id before OpenOCD compute it.
If we block it GDB won't let you connect to OpenOCD, IMO we have to let
it like that and try to change the current thread when we upload .elf file.
Vivien
On 17/06/2013 10:45, Vivien Giraud wrote:
> Hi everyone,
>
> I found where all my problem come from !
> Each time I want to print the thread list in GDB I'v got a error
> because openOCD try to read at 0x0.
> After lots of reading and observations I found that GDB allways say
> that the last thread is the current one (using '*').
> So, using traces, I found that OpenOCD send the 'current thread'
> command before knowing wich one is it, so it send 0 as current thread.
>
> *rtos.c:rtos_thread_packet*
>
> / else if (strstr(packet, "qC")) {//
> // if (target->rtos != NULL) {//
> // char buffer[15];//
> // int size;//
> // size = snprintf(buffer, 15, "QC%08X",
> (int)target->rtos->current_thread);/
>
> This send 'QC00000000X' to GDB, saying that current is 0 on 1 to X
> listed threads.
>
> And after it do :
>
> *eCos.c:eCos_update_threads*
>
> / /* read the current thread id *///
> // uint32_t current_thread_addr;//
> // retval = target_read_buffer(rtos->target,//
> // rtos->symbols[eCos_VAL_current_thread_ptr].address,//
> // 4,//
> // (uint8_t *)¤t_thread_addr);/
>
> Is there any reason why we do this in disorder ?
> If I hardcode 'QC00000002' for example, it works well (if current
> thread is 2 of course).
>
> It seems to be the same problem Freddie meet here:
> http://www.mail-archive.com/[email protected]/msg01549.html
> Look it's saying current htread is the last one ! and after he can't
> do anything.
>
> Hope, this time, it will help !
>
> PS: I'm currently working on it trying to making a patch but I want to
> be sure that there is no special reason that it is in this disorder.
>
> Vivien
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel