Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tcf-dev] Next Step in RTEMS Support
  • From: Eugene Tarassov <eugenet@xxxxxxxxxx>
  • Date: Fri, 13 Nov 2020 21:49:22 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=xilinx.com; dmarc=pass action=none header.from=xilinx.com; dkim=pass header.d=xilinx.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FmshGyiNFhbeiUzWkKWYR+y7RjXfXREsnSI9cp8m4Vs=; b=Ze0LkfnZLmyz31a6Mfpo8domeIhuea2iFk9u0jiNyLEZYe9ZfLgl6KndyfIdPTLUMYF/pZib/T7OLhspv1yBci2dY2VS3CdpVsMVW+J9GWe+1+CvdVrTzY4VLAM1qROmoE24vLTJcXwU4EoLT3KAooKDK21GGG0FLg8k7qRfFuQpfIWj92LV8BLBXW3cIKXAuOZ4zfpw1cjRRtFU7D3gUmf5gDOLgUHiuP7yDvn5E8yDaRHMv2c3oZobWGfwuzNHcG4ilX5aB8RwrUs+jSy4d5N/ESXuA4HjmVu51hM9q80U3HtdbAsq6f+feO3QhANStftC8T8H955ZUIeAHelf5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MbM9TwZNAK/I1wEV05nznZFfQPq5doMGLYlE7xlcH6nWjWJdS0q3Iq5iAYMZRLk6QjjyowHbBDdy54HQItYMBR++V/3YCIZyAHmfWUjEQnN0utrNDc47KIzLTIrYcmZZI229u4h1n6nNpbR76cnY28AUwgVO0utlGWvYK+ovhvmNKv0AwOvSN7Mw4VpLegzi6qdBcV0F1lfy+IcK0HLrwfdA86jz6ryUY2hhmFNcYZgnloeVsG7z/shKBsLiCFu8IKa+deJkxP4xDRtB/x5n0OMyvzM/wasQdW+OkdFq3wHHGyIqrPyDZ6OLTJNL8EMlWi+oEj3Z0D00c8yHGRFnpg==
  • Delivered-to: tcf-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/tcf-dev>
  • List-help: <mailto:tcf-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/tcf-dev>, <mailto:tcf-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/tcf-dev>, <mailto:tcf-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHWugCllbrZGxHS0Um2KtuVH1+YSKnGkKzw
  • Thread-topic: [tcf-dev] Next Step in RTEMS Support

Hi Joel,

 

> context_find_from_pid() appears to always return NULL for me.

 

It is empty stub in context-rtems.c. You need to implement it.

Or, you can use generic implementation of context_find_from_pid - add #include <tcf/framework/pid-hash.h> in context-rtems.c

Or copy/paste the code if you need to modify it for RTEMS.

 

> If the UI side translated the start method name into an address for the target

 

No, you need to translate name into an address in start_process_imp() using find_symbol_by_name().

The find_symbol_by_name  function will talk to the host to get symbol information.

The function can throw “cache miss” exception, which might need special handling, see cache_enter()/cache_exit() description.

 

BTW, for host side symbols, you need to run and use symbols server on the host, see org.eclipse.tcf.agent/server.

 

Regards,

Eugene

 

 

From: tcf-dev-bounces@xxxxxxxxxxx <tcf-dev-bounces@xxxxxxxxxxx> On Behalf Of Joel Sherrill
Sent: Friday, November 13, 2020 1:04 PM
To: TCF Development <tcf-dev@xxxxxxxxxxx>
Subject: [tcf-dev] Next Step in RTEMS Support

 

CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.

 

Hi

 

After puzzling over this, I realized that the context-vxworks.c was the closest example to what should work with RTEMS. Most of the services mapped directly over and I put in stubs for the ones that did not but they are not called yet. I am now at the point where there is something I need a some insight into to get hooked up correctly.

 

I have hooked the RTEMS task create extension (similar to taskCreateHookAdd()) and use the same event thread model. The create hook posts an event which is processed by event_thread_func() (context-vxworks.c:688). The call to post_event() occurs in the RTEMS version just like the VxWorks version and the event thread calls event_handler(). I think this code is exactly the same as in context-vxworks.c. Up until here, I think the flow is OK up to here. The event_handler() function has this:

 

static void event_handler(void * arg) {
    struct event_info * info = (struct event_info *)arg;
    Context * current_ctx = context_find_from_pid(info->current_ctx.ctxId, 1);
    Context * stopped_ctx = context_find_from_pid(info->stopped_ctx.ctxId, 1);

context_find_from_pid() appears to always return NULL for me. I added prints and always see this:

 

In event_handler current_ctx=0
In event_handler - EVENT_TASK_ADD  

 

And then it bails at the equivalent of what is line 657 in context-vxworks.c. 

 

I had temporarily disabled the Processes service because RTEMS does not have posix_openpt(), grantpt(), unlockpt(), or ptsname().  Looking in processes.c, I see VxWorks has its own implementation of start_process_imp(). But RTEMS does not do symbols on the target like VxWorks so this "spawn a task" substitute model won't quite work either. If the UI side translated the start method name into an address for the target, it would work the same. But I don't know if that's an option or not.

 

I added a stub implementation of start_process_imp() for RTEMS that doesn't do anything hoping that would help but no luck.

 

It feels like I have made a lot of progress but not quite enough. It seems like I am not tripping a step that adds the Context to the pid hash map. And no threads are showing up on the UI side. 

 

We have prints in every method in context-rtems.c and nothing gets called except the events associated with the attempting to add the existing threads and newly created threads. 

 

What magic bit am I missing?

 

Thanks.

 

--joel

RTEMS


Back to the top