mirror of https://github.com/cutefishos/appmotor
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			63 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Plaintext
		
	
			
		
		
	
	
			63 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Plaintext
		
	
/*! \page debug How To Debug Boosted Applications
 | 
						|
 | 
						|
\section debugging Debugging
 | 
						|
 | 
						|
To debug a launched application, the debugger must be attached
 | 
						|
to an already running booster process. Due to security limitations
 | 
						|
it's required to use <B>aegis-su</B> tool from <B>aegis-dss-tools</B> package. 
 | 
						|
See <A HREF="https://projects.maemo.org/trac/meego-security/wiki/DisablingAegisValidator#Useaegis-sutooltogranttcbtomodechange">Use aegis-su tool...</A>
 | 
						|
 | 
						|
 | 
						|
1. Run the following command:
 | 
						|
 | 
						|
\code
 | 
						|
aegis-su -r tcb aegis-exec -p gdb -a CAP::sys_ptrace gdb /usr/bin/applauncherd.bin $(pgrep booster-d)
 | 
						|
\endcode
 | 
						|
 | 
						|
2. Set a breakpoint to the application code and let the process
 | 
						|
continue to that point:
 | 
						|
 | 
						|
\code
 | 
						|
(gdb) break main.cpp:42
 | 
						|
No source file named main.cpp.
 | 
						|
Make breakpoint pending on future shared library load? (y or [n]) y
 | 
						|
 | 
						|
Breakpoint 1 (main.cpp:42) pending.
 | 
						|
(gdb) c
 | 
						|
Continuing.
 | 
						|
\endcode
 | 
						|
 | 
						|
3. Invoke the application with the booster to which the debugger
 | 
						|
is attached:
 | 
						|
 | 
						|
\code
 | 
						|
invoker --type=d /usr/bin/myApp
 | 
						|
\endcode
 | 
						|
 | 
						|
\subsection pie-binaries PIE binaries and debugging
 | 
						|
 | 
						|
If you use the \c pkg-config when building your binaries, they are
 | 
						|
linked with the \c -pie flag. The \c -pie flag  makes your binaries
 | 
						|
\e position \e independent \e executables. This means that the executables
 | 
						|
can be either used as a normal shared library or run, for example, from
 | 
						|
the command line.
 | 
						|
 | 
						|
This creates problems when debugging your application with gdb older than
 | 
						|
version 7.1 which introduced the support for PIE binaries.
 | 
						|
 | 
						|
To use gdb 7.0 or earlier, link your binaries as
 | 
						|
libraries by using \c -shared instead of \c -pie. After this, you cannot
 | 
						|
execute your binaries directly, you have to use \c invoker.
 | 
						|
 | 
						|
Setting correct linker flags with QMake:
 | 
						|
 | 
						|
\code
 | 
						|
QMAKE_CXXFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden
 | 
						|
QMAKE_LFLAGS += -shared -rdynamic
 | 
						|
\endcode
 | 
						|
 | 
						|
Remember to remove the CONFIG += qdeclarative-boostable, if used
 | 
						|
(ditto for meegotouch-boostable or qt-boostable).
 | 
						|
 | 
						|
*/
 |