I want to write a function or debugging method that will help print useful information. When it is called, I need:
Is it possible to get this information without passing a number of parameters?
I want to do something like:
debug();
which then goes into each method and function and helps print out useful information about what is happening.
gdb , . , , , ,
gdb
__PRETTY_FUNCTION__ / Objective-C. self , .
__PRETTY_FUNCTION__
self
#define, , , :
#define
#define METHOD() printf("%s\t0x%x\n", __PRETTY_FUNCTION__, (unsigned int)self)
, :
METHOD();
:
-[MyClass initWithFoo:bar:] 0x12345678
, , , , gdb, , .
backtrace n
n
Karl Kraft DebugLog
, , - .
NSThread , unsymbolicated backtrace, callStackReturnAddresses. 10.6 , callStackSymbols.
callStackReturnAddresses
callStackSymbols
, . , - , , ARM. ( -) ARM, , , - ARM ABI ( ). ARM. i386, ppc.
You can use the backtrace (3) API to find out which method or function you called. Getting the caller, if any, is much, much more complicated.
Source: https://habr.com/ru/post/1716796/More articles:send gmail from php form - phpWhat is best for defining extensions in the XML standard? - xmlPossible injection from a date string Select query - sqlhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1716794/is-a-a-href-around-an-object-ie-flash-just-a-bad-idea-or-is-there-actually-a-standard-about-how-a-click-on-such-an-object-has-to-be-handled&usg=ALkJrhgQQwEpAE9b9Q3hdNjGFp2CPijH3gJava proxy setup, URL and System.setProperty? - javaInserting an invalid ActiveRecord date in a MySQL database - mysqlHow to create a macro with several lines of code? - objective-cHow to query data from multiple lists in SharePoint - sharepointIp in country, city, lat, lang javascript service - jsonC # 3.0 Save itextsharp pdf to database using MemoryStream - c #All Articles