This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: ia64 portion of libunwind patch


Jeff,

Can you expand a little here on how this function interacts with libunwind? I can see that its reading in data, but is that data found in the target's space? If it is then the info should be pulled direct from the target and the BFD/objfile should not be used. The relevant target stratum can then re-direct the request to a local file.

I'm also wondering if the unwind code (probably impossible I know) could use a callback to request the memory rather than require an entire buffer.

Hence the question.

Andrew

+static int
+ia64_find_proc_info_x (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
+		       int need_unwind_info, void *arg)
+{
+  struct obj_section *sec = find_pc_section (ip);
+  unw_dyn_info_t di;
+  int ret;
+  void *buf = NULL;
+
+  if (!sec)
+    {
+      /* XXX This only works if the host and the target architecture are
+	 both ia64 and if the have (more or less) the same kernel
+	 version.  */
+      if (get_kernel_table (ip, &di) < 0)
+	return -UNW_ENOINFO;
+    }
+  else
+    {
+      ret = ia64_find_unwind_table (sec->objfile, ip, &di, &buf);
+      if (ret < 0)
+	return ret;
+    }
+
+  if (gdbarch_debug >= 1)
+    fprintf_unfiltered (gdb_stdlog, "acquire_unwind_info: %lx -> "
+			"(name=`%s',segbase=%lx,start=%lx,end=%lx,gp=%lx,"
+			"length=%lu,data=%p)\n", ip, (char *)di.u.ti.name_ptr,
+			di.u.ti.segbase, di.start_ip, di.end_ip,
+			di.gp, di.u.ti.table_len, di.u.ti.table_data);
+
+  ret = libunwind_search_unwind_table (&as, ip, &di, pi, need_unwind_info, arg);
+
+  /* We no longer need the dyn info storage so free it.  */
+  xfree (buf);
+
+  return ret;
+}
+



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]