Merge lp:~nick-dedekind/unity/phablet.run_on_device_gdb into lp:unity/phablet

Proposed by Nick Dedekind
Status: Merged
Approved by: Albert Astals Cid
Approved revision: no longer in the source branch.
Merged at revision: 645
Proposed branch: lp:~nick-dedekind/unity/phablet.run_on_device_gdb
Merge into: lp:unity/phablet
Diff against target: 49 lines (+9/-3)
1 file modified
run_on_device (+9/-3)
To merge this branch: bzr merge lp:~nick-dedekind/unity/phablet.run_on_device_gdb
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Michał Sawicz Needs Fixing
Review via email: mp+159378@code.launchpad.net

Commit message

Added gdb debugging (-g/--gdb) run_on_device option.

Description of the change

Added gdb debugging (-g/--gdb) run_on_device option.

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

You should probably use ./run -g instead of calling the binary manually

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

can't we use `./run -g -- $RUN_OPTIONS` instead of calling gdb by hand?

actually `./run $RUN_OPTIONS` in the original code is wrong - it should be `./run -- $RUN_OPTIONS`.

review: Needs Information
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> can't we use `./run -g -- $RUN_OPTIONS` instead of calling gdb by hand?
>
> actually `./run $RUN_OPTIONS` in the original code is wrong - it should be
> `./run -- $RUN_OPTIONS`.

Yes. and done.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Why is the normal run using BUILD_DIR instead of CODE_DIR?

review: Needs Information
Revision history for this message
Michał Sawicz (saviq) wrote :

They both should, there is no ./run in $BUILD_DIR

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Hey, s/BUILD/CODE/ needs to happen here.

review: Needs Fixing
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> Hey, s/BUILD/CODE/ needs to happen here.

Hm. odd that it seemed to work for me.
Fixed.

Revision history for this message
Albert Astals Cid (aacid) wrote :

You don't really need BUILD_DIR anymore now :-)

review: Needs Fixing
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> You don't really need BUILD_DIR anymore now :-)

:) removed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run_on_device'
2--- run_on_device 2013-04-24 09:10:40 +0000
3+++ run_on_device 2013-04-30 19:28:33 +0000
4@@ -11,6 +11,7 @@
5 RUN_OPTIONS=-qmljsdebugger=port:$TARGET_DEBUG_PORT
6 DEVICENAME=`adb shell "getprop ro.cm.device" | tr -d '\n\r'`
7 SETUP=false
8+GDB=false
9 SUDO="echo $PASSWORD | sudo -S"
10 NUM_JOBS='$(( `grep -c ^processor /proc/cpuinfo` + 1 ))'
11
12@@ -55,7 +56,7 @@
13
14 install_dependencies() {
15 exec_with_adb apt-get -y install openssh-server
16- exec_with_ssh $SUDO apt-get -y install build-essential rsync bzr ccache
17+ exec_with_ssh $SUDO apt-get -y install build-essential rsync bzr ccache gdb
18 exec_with_ssh $SUDO add-apt-repository -y ppa:canonical-qt5-edgers/qt5-proper
19 exec_with_ssh $SUDO add-apt-repository -s -y ppa:phablet-team/ppa
20 exec_with_ssh $SUDO apt-get update
21@@ -87,7 +88,11 @@
22 adb shell "chroot /data/ubuntu /usr/bin/service ubuntu-session restart"
23 fi
24 adb shell pkill $BINARY
25- exec_with_ssh "cd $CODE_DIR/ && ./run -- $RUN_OPTIONS"
26+ if $GDB; then
27+ exec_with_ssh "cd $CODE_DIR/ && ./run -g -- $RUN_OPTIONS"
28+ else
29+ exec_with_ssh "cd $CODE_DIR && ./run -- $RUN_OPTIONS"
30+ fi
31 if [ $CONTAINS_SHELL -eq 0 ]; then
32 echo "Restoring $SERVICEFILE on device from $SERVICEFILE.backup"
33 adb shell cp $SERVICEFILE.backup $SERVICEFILE
34@@ -95,13 +100,14 @@
35 fi
36 }
37
38-set -- `getopt -n$0 -u -a --longoptions="setup,help" "sh" "$@"`
39+set -- `getopt -n$0 -u -a --longoptions="setup,gdb,help" "sgh" "$@"`
40
41 # FIXME: giving incorrect arguments does not call usage and exit
42 while [ $# -gt 0 ]
43 do
44 case "$1" in
45 -s|--setup) SETUP=true;;
46+ -g|--gdb) GDB=true;;
47 -h|--help) usage;;
48 --) shift;break;;
49 esac

Subscribers

People subscribed via source and target branches