Пример #1
0
const gchar *
ide_debugger_thread_get_group (IdeDebuggerThread *self)
{
  IdeDebuggerThreadPrivate *priv = ide_debugger_thread_get_instance_private (self);

  g_return_val_if_fail (IDE_IS_DEBUGGER_THREAD (self), NULL);

  return priv->group;
}
Пример #2
0
gint
ide_debugger_thread_compare (IdeDebuggerThread *a,
                             IdeDebuggerThread *b)
{
  IdeDebuggerThreadPrivate *priv_a = ide_debugger_thread_get_instance_private (a);
  IdeDebuggerThreadPrivate *priv_b = ide_debugger_thread_get_instance_private (b);

  g_return_val_if_fail (IDE_IS_DEBUGGER_THREAD (a), 0);
  g_return_val_if_fail (IDE_IS_DEBUGGER_THREAD (b), 0);

  if (priv_a->id && priv_b->id)
    {
      if (g_ascii_isdigit (*priv_a->id) && g_ascii_isdigit (*priv_b->id))
        return g_ascii_strtoll (priv_a->id, NULL, 10) -
               g_ascii_strtoll (priv_b->id, NULL, 10);
    }

  return g_strcmp0 (priv_a->id, priv_b->id);
}
static void
on_frame_activated (IdeDebuggerEditorAddin *self,
                    IdeDebuggerThread      *thread,
                    IdeDebuggerFrame       *frame,
                    IdeDebuggerThreadsView *threads_view)
{
  IdeDebuggerAddress addr;
  const gchar *path;
  guint line;

  IDE_ENTRY;

  g_assert (IDE_IS_DEBUGGER_EDITOR_ADDIN (self));
  g_assert (IDE_IS_DEBUGGER_THREAD (thread));
  g_assert (IDE_IS_DEBUGGER_FRAME (frame));
  g_assert (IDE_IS_DEBUGGER_THREADS_VIEW (threads_view));

  ide_debugger_locals_view_load_async (self->locals_view, thread, frame, NULL, NULL, NULL);

  path = ide_debugger_frame_get_file (frame);
  line = ide_debugger_frame_get_line (frame);

  if (line > 0)
    line--;

  if (path != NULL)
    {
      IdeContext *context = ide_widget_get_context (GTK_WIDGET (threads_view));
      g_autoptr(IdeLocation) location = NULL;
      g_autofree gchar *project_path = ide_context_build_filename (context, path, NULL);
      g_autoptr(GFile) file = g_file_new_for_path (project_path);

      location = ide_location_new (file, line, -1);
      ide_editor_surface_focus_location (self->editor, location);

      IDE_EXIT;
    }

  addr = ide_debugger_frame_get_address (frame);

  if (addr != IDE_DEBUGGER_ADDRESS_INVALID)
    {
      ide_debugger_editor_addin_navigate_to_address (self, addr);
      IDE_EXIT;
    }

  g_warning ("Failed to locate source or memory address for frame");

  IDE_EXIT;
}
Пример #4
0
void
ide_debugger_thread_set_group (IdeDebuggerThread *self,
                               const gchar       *group)
{
  IdeDebuggerThreadPrivate *priv = ide_debugger_thread_get_instance_private (self);

  g_return_if_fail (IDE_IS_DEBUGGER_THREAD (self));

  if (g_strcmp0 (priv->group, group) != 0)
    {
      g_free (priv->group);
      priv->group = g_strdup (group);
      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_GROUP]);
    }
}