public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "daniel.hilburn at outlook dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug threads/29681] New: VS 2022 Preview C++ Android debugger crashes on breakpoint in thread on arm64v8a device
Date: Thu, 13 Oct 2022 13:54:49 +0000	[thread overview]
Message-ID: <bug-29681-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=29681

            Bug ID: 29681
           Summary: VS 2022 Preview C++ Android debugger crashes on
                    breakpoint in thread on arm64v8a device
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: threads
          Assignee: unassigned at sourceware dot org
          Reporter: daniel.hilburn at outlook dot com
  Target Milestone: ---

I have an Android app which I am attempting to debug on my Samsung Galaxy S21.
I’m using VS 2022 Preview. Ultimately, my goal is to create a fully native
project using the NativeActivity, as the old project template using ANT was
removed. This project is just the provided Gradle Android App project modified
to use the NativeActivity implemented in a second SharedLib project. When I
deploy the app to my phone and connect the debugger, it correctly starts the
NativeActivity and I can hit a breakpoint in the ANativeActivity_onCreate
function. So far so good. ANativeActivity_onCreate creates a second thread on
which to run my app code so that ANativeActivity_onCreate can return. That
second thread executes correctly without crashing. However, if I put a
breakpoint into the code running on that second thread, the debugger throws an
error and stops the app and disconnects.

I’ve enabled debugger logging using “Debug.MIDebugLog /On:MIDebugLog.txt
/OutputWindow” in the Command Terminal window in VS and the error it provides
is “Call Frame Instruction op 45 in vendor extension space is not handled on
this architecture.” It seems to be unable to retrieve the call stack from the
second thread. If I put a breakpoint in the ANativeActivity_onCreate
immediately after it creates the thread, I can see the new thread in the
Threads window. However, selecting it shows the same error and Visual Studio
shows a window explaining that the selected thread is not supported.

I contacted Visual Studio support about this issue
(https://developercommunity.visualstudio.com/t/VS-2022-Preview-C-Android-debugger-cra/10165250?space=62&entry=problem)
and they said that it is an issue with GDB and recommended that I contact you
guys.

I have attached an AndroidApp.zip file containing the small example project.
The test project is basically just the provided C++ Android App Gradle project
with an additional C++ Android Shared Object Library project compiling the
android_native_app_glue.c code. You can reproduce by putting a breakpoint in
android_native_app_glue.c in android_app_create() at line 314 and another in
android_app_entry() at line 240. The first breakpoint will hit on the initial
thread without trouble and the second breakpoint from the second thread will
cause the debugger to crash.

Please let me know if you need any additional information from me on this
issue, and thanks in advance for your assistance.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2022-10-13 13:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13 13:54 daniel.hilburn at outlook dot com [this message]
2022-10-13 14:01 ` [Bug threads/29681] " daniel.hilburn at outlook dot com
2022-10-13 14:01 ` daniel.hilburn at outlook dot com
2022-10-13 14:02 ` daniel.hilburn at outlook dot com
2022-10-14  1:07 ` simark at simark dot ca
2022-10-14  1:59 ` daniel.hilburn at outlook dot com
2022-10-14 13:19 ` daniel.hilburn at outlook dot com
2022-10-14 14:08 ` simark at simark dot ca
2022-10-14 14:17 ` daniel.hilburn at outlook dot com
2022-10-14 15:11 ` simark at simark dot ca
2022-10-14 15:30 ` daniel.hilburn at outlook dot com
2022-10-14 15:56 ` simark at simark dot ca
2022-10-14 16:07 ` daniel.hilburn at outlook dot com
2022-10-14 16:09 ` daniel.hilburn at outlook dot com
2022-10-15 14:12 ` daniel.hilburn at outlook dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-29681-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).