Skip to content

Commit 46275a9

Browse files
author
Liu Yonggang
committed
Fixed the bug that dp will cause ptx debugger crash if dp without <n> parameter
1 parent 0b8b46c commit 46275a9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/debug.cc

+7-3
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,13 @@ void gpgpu_sim::gpgpu_debug() {
130130
if (!strcmp(tok, "dp")) {
131131
int shader_num = 0;
132132
tok = strtok(NULL, " \t\n");
133-
sscanf(tok, "%d", &shader_num);
134-
dump_pipeline((0x40 | 0x4 | 0x1), shader_num, 0);
135-
printf("\n");
133+
if (0x0 == tok) {
134+
printf("Hint: dp must take with <n> to display pipeline contents on SM \n");
135+
} else {
136+
sscanf(tok, "%d", &shader_num);
137+
dump_pipeline((0x40 | 0x4 | 0x1), shader_num, 0);
138+
printf("\n");
139+
}
136140
fflush(stdout);
137141
} else if (!strcmp(tok, "q") || !strcmp(tok, "quit")) {
138142
printf("\nreally quit GPGPU-Sim (y/n)?\n");

0 commit comments

Comments
 (0)