Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
Tools and Software
Software Tools
Jump...
Cancel
Software Tools
Arm Development Studio forum
ARM DS-5 Tutorial For Android
Tools, Software and IDEs blog
Forums
Videos & Files
Help
Jump...
Cancel
New
Replies
20 replies
Subscribers
126 subscribers
Views
8287 views
Users
0 members are here
Related
ARM DS-5 Tutorial For Android
Offline
Nanik T
over 7 years ago
Note: This was originally posted on 5th December 2011 at http://forums.arm.com
Hi,
I've created a step by step blog post for using DS-5 as debugger tool for Android
http://kernel.ozandroid.info/?p=83
Hope this is useful for others.
Cheers
Parents
Offline
Krystian Bigaj
over 7 years ago
Note: This was originally posted on 17th December 2011 at
http://forums.arm.com
Finally I've got DS-5 Debugger 'working' with SGS2 on GB (2.3). But it's a little painful.
EDIT: Debugging on SGS2 with ICS (4.0 LPQ) works fine, at least! No need to use below manual.
First of all, option in DS-5 named "Download and debug an Android application" wasn't work as expected.
I'll describe it more later, after I do more tests with it.
To make debugging work on SGS2 (and Windows) I need to:
0. Create DS-5 Debugger profile as in tutorial, but change "Debug operation" to "Attach to a running Android application"
1. Build and Install apk
You can use "Android application" debugging profile. It will:
- build .apk
- install it on device
- run it
Of course you need build your .so first if you haven't for example added ndk-build to your
project "Builders" (which is really easy as of NDK v7 - no need to use cygwin).
2. Run activity on device(if it wasn't started in point 1), and then close it by 'back button'
As I know, process of this activity will be still running (but activity thread/application(?) will be closed).
Closing activity is very important. I couldn't get debbuging work without this point!.
3. Start debugging using your DS-5 debug profile.
You shouldn't get any errors, and in "Debug Control" there should be break on thread waiting on "epoll_wait".
Debugger should attach to your process (but activity isn't running) and pause it.
4. Set breakpoint(s) in your C/C++ code. (optional)
5. Press "Run/Continue" (green button in "Debug Control").
It will not run your activity! It will just continue run of your paused android process (in point 3).
6. Then start your activity on device. You should see breakpoint hit (if you set it in point 4).
7. You can also add breakpoints later, but first you need to pause application.
In "Debug Control" window press yellow II button, and then you can
add/remove breakpoints, and next press again "Run/Continue" button.
But this doesn't work always (but most time do).
Sometimes I get errors at point 3 or at point 6 (gdbserver: "[1] Segmentation fault run-as com.examp...")
Then you need to try again from point 2. (run and close activity...).
Problem with this configuration is that, if your application crashing at start,
you won't be able to debug it
You need to successfully run and close activity (process of activity must remain running).
I think that this one could be workarounded by changes in code (to run your main code at some condition/variable,
which will be chnaged manually on debugging session at second activity run).
I would really thanks to DS-5 team and @nicksydney. Good job!
It's first debbuger (and tutorial for it) that worked for me!
PS. Really nice view to see debugging working on device after 6+ months of
using of LOGI/__android_log_print and analysing/filtering LogCat
But I think that it cannot replace my VisualStudio+Mali OpenGL ES 2.0 emulator setup,
at least for now, but I will definitly help when testing code/application on real device!
Cancel
Up
0
Down
Reply
Cancel
Reply
Offline
Krystian Bigaj
over 7 years ago
Note: This was originally posted on 17th December 2011 at
http://forums.arm.com
Finally I've got DS-5 Debugger 'working' with SGS2 on GB (2.3). But it's a little painful.
EDIT: Debugging on SGS2 with ICS (4.0 LPQ) works fine, at least! No need to use below manual.
First of all, option in DS-5 named "Download and debug an Android application" wasn't work as expected.
I'll describe it more later, after I do more tests with it.
To make debugging work on SGS2 (and Windows) I need to:
0. Create DS-5 Debugger profile as in tutorial, but change "Debug operation" to "Attach to a running Android application"
1. Build and Install apk
You can use "Android application" debugging profile. It will:
- build .apk
- install it on device
- run it
Of course you need build your .so first if you haven't for example added ndk-build to your
project "Builders" (which is really easy as of NDK v7 - no need to use cygwin).
2. Run activity on device(if it wasn't started in point 1), and then close it by 'back button'
As I know, process of this activity will be still running (but activity thread/application(?) will be closed).
Closing activity is very important. I couldn't get debbuging work without this point!.
3. Start debugging using your DS-5 debug profile.
You shouldn't get any errors, and in "Debug Control" there should be break on thread waiting on "epoll_wait".
Debugger should attach to your process (but activity isn't running) and pause it.
4. Set breakpoint(s) in your C/C++ code. (optional)
5. Press "Run/Continue" (green button in "Debug Control").
It will not run your activity! It will just continue run of your paused android process (in point 3).
6. Then start your activity on device. You should see breakpoint hit (if you set it in point 4).
7. You can also add breakpoints later, but first you need to pause application.
In "Debug Control" window press yellow II button, and then you can
add/remove breakpoints, and next press again "Run/Continue" button.
But this doesn't work always (but most time do).
Sometimes I get errors at point 3 or at point 6 (gdbserver: "[1] Segmentation fault run-as com.examp...")
Then you need to try again from point 2. (run and close activity...).
Problem with this configuration is that, if your application crashing at start,
you won't be able to debug it
You need to successfully run and close activity (process of activity must remain running).
I think that this one could be workarounded by changes in code (to run your main code at some condition/variable,
which will be chnaged manually on debugging session at second activity run).
I would really thanks to DS-5 team and @nicksydney. Good job!
It's first debbuger (and tutorial for it) that worked for me!
PS. Really nice view to see debugging working on device after 6+ months of
using of LOGI/__android_log_print and analysing/filtering LogCat
But I think that it cannot replace my VisualStudio+Mali OpenGL ES 2.0 emulator setup,
at least for now, but I will definitly help when testing code/application on real device!
Cancel
Up
0
Down
Reply
Cancel
Children
No data
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Suggested Answer
error encountered when try to connect FVP
0
1517
views
7
replies
Latest
12 days ago
by
fantim.zhang
Answered
Key difference between GCC arm-none-eabi and arm-eabi
0
compiler
GCC
Getting Started
parameters
GNU
eabi
52706
views
6
replies
Latest
14 days ago
by
Juvanta
Suggested Answer
Can anyone please help me on how evalution development studio 2020.1 work s and which compiler is needed and how it can be setup?
0
1107
views
3
replies
Latest
17 days ago
by
Ronan Synnott
Suggested Answer
Can anyone tell me the difference between DSTREAM and DSTREAM-ST?
0
1335
views
2
replies
Latest
22 days ago
by
Xiang
Not Answered
Would you be interested in a VScode extension to handle ARM toolchain?
0
1228
views
0
replies
Started
24 days ago
by
vix
<
>
View all questions in Arm Development Studio forum