bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need Quick Help on GDB crash (Did I do something wrong ?)


From: Madhusudan Challa
Subject: Re: Need Quick Help on GDB crash (Did I do something wrong ?)
Date: Mon, 03 Sep 2001 12:58:36 -0700

This works fine for me, looks like you have a stripped dynamic linker, try 
putting
in this patch if its not there already.

-madhusudan

Mon Jan 27 21:36:26 1997  Andreas Schwab  <<EMAIL: PROTECTED>>

 * solib.c (bfd_lookup_symbol): If there are no normal symbols try
 the dynamic symbol table.

--- gdb-4.16/gdb/solib.c.~1~ Mon Apr 29 22:44:30 1996
+++ gdb-4.16/gdb/solib.c Sat Jun 15 02:19:25 1996
@@ -444,14 +444,25 @@
   unsigned int i;
   struct cleanup *back_to;
   CORE_ADDR symaddr = 0;
+  int dynamic = 0;

   storage_needed = bfd_get_symtab_upper_bound (abfd);

+  if (storage_needed == 0)
+    {
+      /* No symbols found, try the dynamic symbol table.  */
+      storage_needed = bfd_get_dynamic_symtab_upper_bound (abfd);
+      dynamic = 1;
+    }
+
   if (storage_needed > 0)
     {
       symbol_table = (asymbol **) xmalloc (storage_needed);
       back_to = make_cleanup (free, (PTR)symbol_table);
-      number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
+      if (dynamic)
+ number_of_symbols = bfd_canonicalize_dynamic_symtab (abfd, symbol_table);
+      else
+ number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);

       for (i = 0; i < number_of_symbols; i++)
  {


Chi-Cheong Weng wrote:

> Hi I was trying to see if I can invoke c functions within
> GDB. But it crashed. I remembered I was able to do this
> before.
> Basically two files debug.c and test.cc
> I set a break point at foo(1), then i try to
> invoke prt by doing "p prt(1)". I expect it
> to print 1 but the GDB crashed.
> Did I do some thing wrong ?? If you know the answer, pls
> reply to my email address asap. thank you,
> address@hidden
> Chi-Cheong

--
-madhusudan

Ericsson Inc
work :- 805-562-6066





reply via email to

[Prev in Thread] Current Thread [Next in Thread]