aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-02-12 19:15:01 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-02-12 19:15:01 +0000
commit570083757caf694cbcf250a64f88709a8676aacf (patch)
treeaabe688a01f31dd464a008d37466b355bdad33a0 /gdb/exec.c
parent8e43fc024d16859a34c2f2aa88b419e677373f88 (diff)
downloadgdb-570083757caf694cbcf250a64f88709a8676aacf.zip
gdb-570083757caf694cbcf250a64f88709a8676aacf.tar.gz
gdb-570083757caf694cbcf250a64f88709a8676aacf.tar.bz2
gdb/
Fix crash on loaded shlibs without loaded exec_bfd. * exec.c (exec_files_info): Do not crash on NULL EXEC_BFD. (set_section_command): Replace exec_bfd by p->bfd. gdb/testsuite/ * gdb.server/server-exec-info.exp: New file.
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index cd129f7..8a3e797 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -761,7 +761,10 @@ print_section_info (struct target_section_table *t, bfd *abfd)
static void
exec_files_info (struct target_ops *t)
{
- print_section_info (current_target_sections, exec_bfd);
+ if (exec_bfd)
+ print_section_info (current_target_sections, exec_bfd);
+ else
+ puts_filtered (_("\t<no file loaded>\n"));
if (vmap)
{
@@ -813,9 +816,9 @@ set_section_command (char *args, int from_tty)
table = current_target_sections;
for (p = table->sections; p < table->sections_end; p++)
{
- if (!strncmp (secname, bfd_section_name (exec_bfd,
+ if (!strncmp (secname, bfd_section_name (p->bfd,
p->the_bfd_section), seclen)
- && bfd_section_name (exec_bfd, p->the_bfd_section)[seclen] == '\0')
+ && bfd_section_name (p->bfd, p->the_bfd_section)[seclen] == '\0')
{
offset = secaddr - p->addr;
p->addr += offset;