06-18-2013 05:07 AM
Who knows how does /base/sbin/launcher works?
I am searching how can I startup an app to foreground by telnet to devie and run it up by command, instead of tap the icon on device screen.
I found the parent process of app below is at /base/sbin/launcher, but don't know how to use it?
execute /base/sbin/launcher path/exe can not startup the app...
I lookup SDK, but nothing found.
1 # pidin | grep exe_name
47562854 1 app/native/exe_name10r RECEIVE 2
47562854 2 app/native/exe_name10r CONDVAR (0x80bb17c)
get PID 47562854
2 # pidin -f Pmbe | grep 47562854
47562854 28K(516K)* 1 5505163
47562854 28K(132K) 2 5505163
get PPID 5505163
3 # pidin | grep 5505163
5505163 1 base/sbin/launcher 12r RECEIVE 1
5505163 2 base/sbin/launcher 1r REPLY 2146348
5505163 3 base/sbin/launcher 12r SIGWAITINFO
Solved! Go to Solution.
06-18-2013 08:54 AM
06-23-2013 10:46 PM
Appreciative for your comments. It helps me a lot I think.
Actually, another issue makes me stuck:
My intent is debug app from begining of startup in console remotely, bring it up in window and interact with it.
I tried to capture message between IDE and device, but it's cryptographic and unreadable.
So I thought how to launch app, maybe helpful to bring it up in window.
Now I'm clear with that, as you said, if I want to launch remotely, must with the help of blackberry-deploy tool, with the -launchApp option.
06-26-2013 04:37 AM
Thanks for your suggestion.
Now I can launch app into screen window and debug it from main() by command line.
The solution is:
1 Launch and allow native debugging by blackberry-deploy.bat (host_xxx_x\win32\x86\usr\bin)
The option below is very usefull:
-debugNative - hold native application immediately after the spawn to allow native debugging
Full command is:
blackberry-deploy.bat -launchApp -debugNative -device <host | IP> -password <password> -package-fullname <package full name>
Finished, it returns the PID info:
Info: Sending request: Launch
Info: Action: Launch
Info: Debug native: on
Info: Launching <app>
2 gdb remotely and attach the process by ntoarm-gdb (host_xxx_x\win32\x86\usr\bin)
target qnx IP:8000
Cannot access memory at address 0x0
Breakpoint 1 at 0x809bfaa: file ../src/main.cpp, line 27.
Breakpoint 1, main (argc=1, argv=0x75cf074) at ../src/main.cpp:27
27 Application app(argc, argv);
06-26-2013 09:13 AM
06-27-2013 09:59 PM
I can not make it without your help,
I'd like to share more with all. I found debug app in command line is more efficient than in IDE. So I am going to use this way to debug in the future.
Debug shared library by gdb in command line:
1 get the shared library base address in memory
continue with before steps, ssh/telnet to device, then:
pidin -f aO | grep libNoname
Unable to find link_map.: No error
0x78208000 libNoname.so /apps/package-name/native/lib/libNoname.so
2 get the offset of text section in shared library
GNU toolchain on windows, bbndk/host_xxx/win32/x86/usr/bin/ntoarm-objdump
ntoarm-objdump -h libNoname.so | grep text
8 .text 0000c7cc 00008ea8 00008ea8 00008ea8 2**3
3 add symbols to gdb
0x78208000 + 00008ea8 = 0x786b8ea8
add-symbol-file libNoname.so 0x786b8ea8
.text_addr = 0x786b8ea8
(y or n) y
Reading symbols from....
4 then set the breakpoint and debug
The breakpoint can be hit correctly.