Skip to content

Commit

Permalink
samples: add gdb debug target
Browse files Browse the repository at this point in the history
  • Loading branch information
john-tornblom committed Jun 16, 2024
1 parent d4a33b7 commit 3a2374c
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
*.sprx
nid_db.xml
aerolib.csv

.gdb_history
9 changes: 8 additions & 1 deletion samples/arbitrary_syscall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif

ELF := arbitrary_syscall.elf

CFLAGS := -Wall -Werror
CFLAGS := -Wall -Werror -g

all: $(ELF)

Expand All @@ -38,3 +38,10 @@ clean:
test: $(ELF)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^

debug: $(ELF)
gdb \
-ex "target extended-remote $(PS5_HOST):2159" \
-ex "file $(ELF)" \
-ex "remote put $(ELF) /data/$(ELF)" \
-ex "set remote exec-file /data/$(ELF)" \
-ex "start"
9 changes: 8 additions & 1 deletion samples/browser/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ endif

ELF := browser.elf

CFLAGS := -Wall -Werror -DPS5_URL='"$(PS5_URL)"'
CFLAGS := -Wall -Werror -g -DPS5_URL='"$(PS5_URL)"'
CFLAGS += -lSceSystemService -lSceUserService

all: $(ELF)
Expand All @@ -40,3 +40,10 @@ clean:
test: $(ELF)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^

debug: $(ELF)
gdb \
-ex "target extended-remote $(PS5_HOST):2159" \
-ex "file $(ELF)" \
-ex "remote put $(ELF) /data/$(ELF)" \
-ex "set remote exec-file /data/$(ELF)" \
-ex "start"
9 changes: 8 additions & 1 deletion samples/hello_cxx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif

ELF := hello_cxx.elf

CFLAGS := -Wall -Werror
CFLAGS := -Wall -Werror -g

all: $(ELF)

Expand All @@ -38,3 +38,10 @@ clean:
test: $(ELF)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^

debug: $(ELF)
gdb \
-ex "target extended-remote $(PS5_HOST):2159" \
-ex "file $(ELF)" \
-ex "remote put $(ELF) /data/$(ELF)" \
-ex "set remote exec-file /data/$(ELF)" \
-ex "start"
9 changes: 8 additions & 1 deletion samples/hello_sprx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif

ELF := hello_sprx.elf

CFLAGS := -Wall -Werror -lSceRandom
CFLAGS := -Wall -Werror -g -lSceRandom

all: $(ELF)

Expand All @@ -38,3 +38,10 @@ clean:
test: $(ELF)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^

debug: $(ELF)
gdb \
-ex "target extended-remote $(PS5_HOST):2159" \
-ex "file $(ELF)" \
-ex "remote put $(ELF) /data/$(ELF)" \
-ex "set remote exec-file /data/$(ELF)" \
-ex "start"
9 changes: 8 additions & 1 deletion samples/hello_stdio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif

ELF := hello_stdio.elf

CFLAGS := -Wall -Werror
CFLAGS := -Wall -Werror -g

all: $(ELF)

Expand All @@ -38,3 +38,10 @@ clean:
test: $(ELF)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^

debug: $(ELF)
gdb \
-ex "target extended-remote $(PS5_HOST):2159" \
-ex "file $(ELF)" \
-ex "remote put $(ELF) /data/$(ELF)" \
-ex "set remote exec-file /data/$(ELF)" \
-ex "start"
9 changes: 8 additions & 1 deletion samples/hello_world/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif

ELF := hello_world.elf

CFLAGS := -Wall -Werror
CFLAGS := -Wall -Werror -g

all: $(ELF)

Expand All @@ -38,3 +38,10 @@ clean:
test: $(ELF)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^

debug: $(ELF)
gdb \
-ex "target extended-remote $(PS5_HOST):2159" \
-ex "file $(ELF)" \
-ex "remote put $(ELF) /data/$(ELF)" \
-ex "set remote exec-file /data/$(ELF)" \
-ex "start"
9 changes: 8 additions & 1 deletion samples/http2_get/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif

ELF := http2_get.elf

CFLAGS := -Wall -Werror -lSceNet -lSceSsl -lSceHttp2
CFLAGS := -Wall -Werror -g -lSceNet -lSceSsl -lSceHttp2

all: $(ELF)

Expand All @@ -38,3 +38,10 @@ clean:
test: $(ELF)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^

debug: $(ELF)
gdb \
-ex "target extended-remote $(PS5_HOST):2159" \
-ex "file $(ELF)" \
-ex "remote put $(ELF) /data/$(ELF)" \
-ex "set remote exec-file /data/$(ELF)" \
-ex "start"
10 changes: 9 additions & 1 deletion samples/hwinfo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif

ELF := hwinfo.elf

CFLAGS := -Wall -Werror -lkernel_sys
CFLAGS := -Wall -Werror -g -lkernel_sys

all: $(ELF)

Expand All @@ -38,3 +38,11 @@ clean:
test: $(ELF)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^

debug: $(ELF)
gdb \
-ex "target extended-remote $(PS5_HOST):2159" \
-ex "file $(ELF)" \
-ex "remote put $(ELF) /data/$(ELF)" \
-ex "set remote exec-file /data/$(ELF)" \
-ex "start"

9 changes: 8 additions & 1 deletion samples/list_files/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif

ELF := list_files.elf

CFLAGS := -Wall -Werror
CFLAGS := -Wall -Werror -g

all: $(ELF)

Expand All @@ -38,3 +38,10 @@ clean:
test: $(ELF)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^

debug: $(ELF)
gdb \
-ex "target extended-remote $(PS5_HOST):2159" \
-ex "file $(ELF)" \
-ex "remote put $(ELF) /data/$(ELF)" \
-ex "set remote exec-file /data/$(ELF)" \
-ex "start"
10 changes: 9 additions & 1 deletion samples/mntinfo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif

ELF := mntinfo.elf

CFLAGS := -Wall -Werror -lkernel_sys
CFLAGS := -Wall -Werror -g -lkernel_sys

all: $(ELF)

Expand All @@ -37,3 +37,11 @@ clean:

test: $(ELF)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^

debug: $(ELF)
gdb \
-ex "target extended-remote $(PS5_HOST):2159" \
-ex "file $(ELF)" \
-ex "remote put $(ELF) /data/$(ELF)" \
-ex "set remote exec-file /data/$(ELF)" \
-ex "start"
9 changes: 8 additions & 1 deletion samples/ps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ endif

ELF := ps.elf

CFLAGS := -Wall -Werror
CFLAGS := -Wall -Werror -g

all: $(ELF)

Expand All @@ -38,3 +38,10 @@ clean:
test: $(ELF)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^

debug: $(ELF)
gdb \
-ex "target extended-remote $(PS5_HOST):2159" \
-ex "file $(ELF)" \
-ex "remote put $(ELF) /data/$(ELF)" \
-ex "set remote exec-file /data/$(ELF)" \
-ex "start"

0 comments on commit 3a2374c

Please sign in to comment.