Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Search for possible codepaths between function A and function B #249

Closed
egraether opened this issue Nov 30, 2016 · 12 comments
Closed

Search for possible codepaths between function A and function B #249

egraether opened this issue Nov 30, 2016 · 12 comments
Assignees
Labels
Milestone

Comments

@egraether
Copy link
Contributor

reported by mail

@jpenalbae
Copy link

I would break this into

  • Search for possible codepaths between function A and function B

  • Search recursively if any of the callees of the current function call to function X

    • This could be done by right clicking, show a context menu and then input the desired function to search for.
    • Being able to define a custom list per project for this would be also cool, so you could have a submenu in the context menu with the custom entries such as pthread_mutex_lock()/pthread_mutex_unlock(), mutex_lock()/mutex_unlock(), and avoid having to type them every time.

@wrongway88
Copy link
Contributor

Thanks for your feedback @jpenalbae, we will look into this as soon as we can.

@jpenalbae
Copy link

I forgot to mention another possible subtask:

  • Find all the possible paths to reach function X

On a normal program all the codepaths would obviously always begin with main(). But for libraries it would show which exported symbols make use of function X, and for kernels it would show which syscalls or ioctls make use of the function X.

@egraether
Copy link
Contributor Author

+1 by mail

1 similar comment
@egraether
Copy link
Contributor Author

+1 by mail

@egraether egraether self-assigned this Feb 15, 2017
@egraether
Copy link
Contributor Author

Added support for call graphs, inheritance trees and include trees using Sugiyama-style graph drawing with 0.11.98

Searching for specific code paths between functions is not possible yet.

@bsw4p
Copy link

bsw4p commented Mar 1, 2018

+1

@egraether
Copy link
Contributor Author

Suggestion from Slack channel:
Use functionA -> functionB syntax in search field. Also add actions path to here and path from here to graph context menu, which can be used when displaying a depth graph.

@egraether
Copy link
Contributor Author

+1 via mail
Also allow specifying classes and involve all their members in the path search.

@egraether egraether added this to the Sourcetrail 2019.3 Beta milestone Jun 4, 2019
@egraether
Copy link
Contributor Author

Also filter by containing file or directory

@dwlsalmeida
Copy link

By the way: I feel that composing an overview of part of the code for coworkers is somewhat limiting. Users can hide nodes, which is great, but they cannot add them. I feel that maybe users should be able to add nodes to the graph window and they should automatically connect if they're related.

@egraether
Copy link
Contributor Author

Implemented with 2019.3.16

New Custom Trail dialog is available in the top left of the graph view and allows to search for:

  • paths between A & B
  • all paths starting from A
  • all paths ending in A

Available options:

  • search depth: 1 - 50 + infinite
  • layout: horizontal/vertical
  • filter: by node/edge types

Filtering by containing file or directory is still missing. Opened as new feature request #712.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants