Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by ina · May 09, 2011 at 07:42 AM · debugfunctionstrace

Trace which line of a script called a particular function

is there a way to do a backtrace on which line of the script called a particular function?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dreamer · May 09, 2011 at 07:54 AM 0
Share

you asked 3 questions in 10 $$anonymous$$utes? That's very productive. LoL

avatar image Dreamer · May 09, 2011 at 08:01 AM 0
Share

wow, I just cheked you have asked 247 questions so far. Now UnityAnswers has 23,724 questions in total which means 1% of them is asked by YOU. applaud

avatar image ina · May 09, 2011 at 09:27 AM 0
Share

asking questions is how i learn. google can only work so much. please feel free to answer if you have knowledge to share.

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by loramaru · May 09, 2011 at 07:58 AM

Hopefully this will suit your needs.

Debug.Log(System.Environment.StackTrace);
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by CHPedersen · May 09, 2011 at 08:02 AM

The way to do that is to use a standard debugging tool and set breakpoints, then execute each statement one by one to follow the code's control flow in in your editor. This isn't possible with Visual Studio however, since Unity uses Mono and therefore can't attach to Visual Studio's debugger, but perhaps it's possible with Mono Develop, I've never used that as an editor for unity.

As a lowtech alternative, you could simply insert strategic Debug.Log calls to see what gets called and what doesn't...

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ina · May 09, 2011 at 09:29 AM 0
Share

can you suggest some standard debugging tools that'd do what you said for unity ... the debug.log only goes so far and doesn't go recursively to indicate which function called which

avatar image CHPedersen · May 09, 2011 at 09:51 AM 0
Share

It seems $$anonymous$$ono Develop does have a standard debugger. Take a look at http://www.mono-project.com/Debugger. Unity ships with mono develop and uses its runtime system, so it should attach to $$anonymous$$ono Develop's debugger, too.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Unity Alert or Trace 2 Answers

DEBUG;TRACE; Compile Problems 1 Answer

Unity 2017 frame rate capped? 2 Answers

Can I see debug log(ex:printf) from C++ dll in Unity? 0 Answers

Unity crashes without debugging 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges