Allow no debuginfo to be found when (trying to) produce the help msg
for activating the host visibility in gdbsrv
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14227 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_gdbserver/server.c b/coregrind/m_gdbserver/server.c
index 72d6660..5346401 100644
--- a/coregrind/m_gdbserver/server.c
+++ b/coregrind/m_gdbserver/server.c
@@ -327,16 +327,20 @@
hostvisibility = True;
}
if (hostvisibility) {
- const DebugInfo *tooldi = VG_(find_DebugInfo) ((Addr)handle_gdb_valgrind_command);
- vg_assert(tooldi);
- const NSegment *toolseg = VG_(am_find_nsegment)
- (VG_(DebugInfo_get_text_avma) (tooldi));
- vg_assert(toolseg);
+ const DebugInfo *tooldi
+ = VG_(find_DebugInfo) ((Addr)handle_gdb_valgrind_command);
+ const NSegment *toolseg
+ = tooldi ?
+ VG_(am_find_nsegment) (VG_(DebugInfo_get_text_avma) (tooldi))
+ : NULL;
VG_(gdb_printf)
("Enabled access to Valgrind memory/status by GDB\n"
"If not yet done, tell GDB which valgrind file(s) to use, "
"typically:\n"
- "add-symbol-file %s %p\n", VG_(am_get_filename)(toolseg), (void*) toolseg->start);
+ "add-symbol-file %s %p\n",
+ toolseg ? VG_(am_get_filename)(toolseg)
+ : "<toolfile> <address> e.g.",
+ toolseg ? (void*)toolseg->start : (void*)0x38000000);
} else
VG_(gdb_printf)
("Disabled access to Valgrind memory/status by GDB\n");