Skip to content
Snippets Groups Projects
Commit 7df81de5 authored by jacob's avatar jacob
Browse files

add directory commands to gdb script

parent b92e914b
No related branches found
No related tags found
No related merge requests found
...@@ -722,6 +722,7 @@ static int jt_dbg_modules_2_4(int argc, char **argv) ...@@ -722,6 +722,7 @@ static int jt_dbg_modules_2_4(int argc, char **argv)
return 0; return 0;
} }
printf("dir\n");
for (mp = mod_paths; mp->name != NULL; mp++) { for (mp = mod_paths; mp->name != NULL; mp++) {
struct module_info info; struct module_info info;
int rc; int rc;
...@@ -739,6 +740,8 @@ static int jt_dbg_modules_2_4(int argc, char **argv) ...@@ -739,6 +740,8 @@ static int jt_dbg_modules_2_4(int argc, char **argv)
printf("add-symbol-file %s%s%s/%s.o 0x%0lx\n", path, printf("add-symbol-file %s%s%s/%s.o 0x%0lx\n", path,
path[0] ? "/" : "", mp->path, mp->name, path[0] ? "/" : "", mp->path, mp->name,
info.addr + sizeof(struct module)); info.addr + sizeof(struct module));
printf("dir %s%s%s\n", path,
path[0] ? "/" : "", mp->path);
} }
} }
...@@ -774,6 +777,7 @@ static int jt_dbg_modules_2_5(int argc, char **argv) ...@@ -774,6 +777,7 @@ static int jt_dbg_modules_2_5(int argc, char **argv)
return 0; return 0;
} }
printf("dir\n");
while ((rc = fscanf(file, "%s %s %s %s %s %lx\n", while ((rc = fscanf(file, "%s %s %s %s %s %lx\n",
modname, others, others, others, others, &modaddr)) == 6) { modname, others, others, others, others, &modaddr)) == 6) {
for (mp = mod_paths; mp->name != NULL; mp++) { for (mp = mod_paths; mp->name != NULL; mp++) {
...@@ -783,6 +787,8 @@ static int jt_dbg_modules_2_5(int argc, char **argv) ...@@ -783,6 +787,8 @@ static int jt_dbg_modules_2_5(int argc, char **argv)
if (mp->name) { if (mp->name) {
printf("add-symbol-file %s%s%s/%s.o 0x%0lx\n", path, printf("add-symbol-file %s%s%s/%s.o 0x%0lx\n", path,
path[0] ? "/" : "", mp->path, mp->name, modaddr); path[0] ? "/" : "", mp->path, mp->name, modaddr);
printf("dir %s%s%s\n", path,
path[0] ? "/" : "", mp->path);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment