Using Clang to Visualize Large Codebases. Nathan Hawes and Ben Barham Oracle Labs Australia October 2014

Similar documents
Frappé: Querying the Linux Kernel Dependency Graph!

Component visualization methods for large legacy software in C/C++

VisCG: Creating an Eclipse Call Graph Visualization Plug-in. Kenta Hasui, Undergraduate Student at Vassar College Class of 2015

DIABLO VALLEY COLLEGE CATALOG

DEVELOPMENT OF AN ANALYSIS AND REPORTING TOOL FOR ORACLE FORMS SOURCE CODES

An Eclipse Plug-In for Visualizing Java Code Dependencies on Relational Databases

Real-time Debugging using GDB Tracepoints and other Eclipse features

Oracle Big Data SQL. Architectural Deep Dive. Dan McClary, Ph.D. Big Data Product Management Oracle

<Insert Picture Here> Oracle Application Express 4.0

SOFTWARE TESTING TRAINING COURSES CONTENTS

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Technical paper review. Program visualization and explanation for novice C programmers by Matthew Heinsen Egan and Chris McDonald.

Fully Automated Static Analysis of Fedora Packages

Tableau Your Data! Wiley. with Tableau Software. the InterWorks Bl Team. Fast and Easy Visual Analysis. Daniel G. Murray and

Performance Analysis and Optimization Tool

<Insert Picture Here> Oracle SQL Developer 3.0: Overview and New Features

Braindumps.C questions

Designing portal site structure and page layout using IBM Rational Application Developer V7 Part of a series on portal and portlet development

RFID Based 3D Indoor Navigation System Integrated with Smart Phones

Enterprise Data Visualization and BI Dashboard

Exploiting Key Answers from Your Data Warehouse Using SAS Enterprise Reporter Software

WEB& WEBSITE DESIGN TRAINING

Integrating SNiFF+ with the Data Display Debugger (DDD)

MySQL and Hadoop: Big Data Integration. Shubhangi Garg & Neha Kumari MySQL Engineering

NXTware Remote. Advanced Development and Maintenance Environment for OpenVMS and other Strategic Platforms

Building and Using Web Services With JDeveloper 11g

Microinvest Warehouse Pro Light Restaurant is designed to work in tandem with Microinvest Warehouse Pro which provides all back office functions.

Using Eclipse CDT/PTP for Static Analysis

Semantic Search in Portals using Ontologies

mframe Software Development Platform KEY FEATURES

Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)

ORACLE BUSINESS INTELLIGENCE, ORACLE DATABASE, AND EXADATA INTEGRATION

Building Views and Charts in Requests Introduction to Answers views and charts Creating and editing charts Performing common view tasks

Treemaps for Search-Tree Visualization

Xcode Project Management Guide. (Legacy)

APPLICATION MANAGEMENT SUITE FOR ORACLE E-BUSINESS SUITE APPLICATIONS

What is Visualization? Information Visualization An Overview. Information Visualization. Definitions

Scatter Chart. Segmented Bar Chart. Overlay Chart

What you can do:...3 Data Entry:...3 Drillhole Sample Data:...5 Cross Sections and Level Plans...8 3D Visualization...11

Intrusion Detection via Static Analysis

ArcGIS Viewer for Silverlight An Introduction

IBM WebSphere Business Monitor, Version 6.1

Transaction Monitoring Version for AIX, Linux, and Windows. Reference IBM

Function Point Modeler Enterprise Edition A Software Lifecycle Management Tool

Bitrix Site Manager 4.1. User Guide

Oracle Data Miner (Extension of SQL Developer 4.0)

Server Monitoring. AppDynamics Pro Documentation. Version Page 1

The Yocto Project Eclipse plug-in: An Effective IDE Environment for Embedded Application and System Developers

Lost in Space? Methodology for a Guided Drill-Through Analysis Out of the Wormhole

PC120 ALM Performance Center 11.5 Essentials

Software Metrics in Static Program Analysis

Pattern Insight Clone Detection

Vim, Emacs, and JUnit Testing. Audience: Students in CS 331 Written by: Kathleen Lockhart, CS Tutor

<Insert Picture Here> What's New in NetBeans IDE 7.2

Developers Guide. Designs and Layouts HOW TO IMPLEMENT WEBSITE DESIGNS IN DYNAMICWEB. Version: English

tools that make every developer a quality expert

VitalQIP DNS/DHCP & IP Address Management Software and Appliance Solution

Optional custom API wrapper. C/C++ program. M program

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

Windchill Service Information Manager Curriculum Guide

Visualizing Information Flow through C Programs

Oracle Forms Developer 10g: Build Internet Applications

Interaction and Visualization Techniques for Programming

Introduction to Software Testing Chapter 8.1 Building Testing Tools Instrumentation. Chapter 8 Outline

Lecture 1 Introduction to Android

Sterling Business Intelligence

Fast and Easy Delivery of Data Mining Insights to Reporting Systems

The FDA Forensics Lab, New Tools and Capabilities

Hadoop Basics with InfoSphere BigInsights

GEOGRAPHIC INFORMATION SYSTEMS CERTIFICATION

Spring,2015. Apache Hive BY NATIA MAMAIASHVILI, LASHA AMASHUKELI & ALEKO CHAKHVASHVILI SUPERVAIZOR: PROF. NODAR MOMTSELIDZE

Oracle Database 10g: Building GIS Applications Using the Oracle Spatial Network Data Model. An Oracle Technical White Paper May 2005

Content. Development Tools 2(63)

Apache Sentry. Prasad Mujumdar

Development at the Speed and Scale of Google. Ashish Kumar Engineering Tools

Reporting with HP ALM/QC

R / TERR. Ana Costa e SIlva, PhD Senior Data Scientist TIBCO. Copyright TIBCO Software Inc.

CA Application Performance Management r9.x Implementation Proven Professional Exam

Microsoft Enterprise Search for IT Professionals Course 10802A; 3 Days, Instructor-led

Developing Web and Mobile Dashboards with Oracle ADF

Using SQL Developer. Copyright 2008, Oracle. All rights reserved.

Software Development Kit

Web Design Specialist

Hierarchy and Tree Visualization

TEST AUTOMATION FRAMEWORK

MICROSOFT DYNAMICS CRM Roadmap. Release Preview Guide. Q Service Update. Updated: August, 2011

This tutorial is designed for SEO professionals as well as beginners who would like to learn the basics of Web Analytics and its techniques.

ITG Software Engineering

Effective Java Programming. efficient software development

Transcription:

Using Clang to Visualize Large Codebases Nathan Hawes and Ben Barham Oracle Labs Australia October 2014

Safe Harbour The following is intended to provide some insight into a line of research in Oracle Labs. It is intended for informamon purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or funcmonality, and should not be relied upon in making purchasing decisions. Oracle reserves the right to alter its development plans and pracmces at any Mme, and the development, release, and Mming of any features or funcmonality described in connecmon with any Oracle product or service remains at the sole discremon of Oracle. Any views expressed in this presentamon are my own and do not necessarily reflect the views of Oracle. 2

Code Comprehension The truth is in the source! 3

But what if that source is large? 10 million lines 4

But what if that source is large? 10 million lines 50 lines 5

But what if that source is large? 10 million lines 50 lines 6

Code Comprehension in IDEs Go to definimon, find uses, class overview, type hierarchy, etc. IDEs impracmcal to use for large C/C++ codebases Imprecise language recognimon Issues with custom build systems 7

Current PracMce For large C/C++ codebases Text editors and text- search tools vim, emacs grep, sed, cscope Fast and simple But imprecise à Symbol types, scopes, linking informamon, preprocessor Low- level focus static VALUE mnew( ) { data- >id = rid; } Find definimon method.h:70 node.h:244 thread_pthread.c:594 (+ 17 more) Actual definimon (14 th ) proc.c:21 8

Frappé Aims Provide precise dependency informamon With easy build integramon Allow users to specify higher- level queries directly Not just defs or refs Show users the broader context of the system 9

Frappé Overview EXTRACT QUERY DISPLAY Source Code Dependency Graph User Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 10

Dependency Graph Natural representamon of the code Call graphs, type hierarchies, control flow graphs, etc. Nodes and edges Build system: modules, files, and linking informamon between them File system: directories and files Preprocessor: includes, macros, their expansion and interrogamons Symbols: funcmons, locals, types, and relamons between them High- level quesmons become graph queries Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 11

Go to DefiniMon main() writes.buf contains scope{} foo() bar() Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 12

Go to DefiniMon main() writes.buf contains scope{} foo() bar() Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 13

Go to DefiniMon main() writes.buf contains scope{} foo() bar() Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 14

Find References main() writes.buf contains scope{} foo() bar() Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 15

Find References main() writes.buf contains scope{} foo() bar() Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 16

Find References main() writes.buf contains scope{} foo() bar() Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 17

Impact EsMmaMon insert() pop() first() init() #PREV expands #FIRST #NULL Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 18

Impact EsMmaMon insert() pop() first() init() #PREV expands #FIRST #NULL Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 19

Impact EsMmaMon insert() pop() first() init() #PREV expands #FIRST #NULL Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 20

Impact EsMmaMon insert() pop() first() init() #PREV expands #FIRST #NULL Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 21

Frappé Architecture EXTRACTOR IMPORTER EDITOR PLUGINS CLI SCRIPTS WEB UI Source Code.fo Server User Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 22

Frappé Architecture EXTRACTOR IMPORTER EDITOR PLUGINS CLI SCRIPTS WEB UI Source Code.fo Server User Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 23

Extractor Simple Build IntegraLon Compiler Wrappers NaMve Compiler Clang + Plugin.o.fo 24

Extractor Simple Build IntegraLon Compiler Wrappers NaMve Compiler Clang + Plugin.o.fo 25

Extractor Simple Build IntegraLon Compiler Wrappers NaMve Compiler Clang + Plugin.o.fo 26

Extractor Clang Plugin PPCallbacks Includes, macros, their expansions and interrogamons RecursiveASTVisitor Visit all declaramons, types, and expressions Easy to use interface Provides detailed locamon informamon 27

Frappé Architecture EXTRACTOR IMPORTER EDITOR PLUGINS CLI SCRIPTS WEB UI Source Code.fo Server User Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 28

Frappé Architecture EXTRACTOR IMPORTER EDITOR PLUGINS CLI SCRIPTS WEB UI Source Code.fo Server User Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 29

Frappé Architecture EXTRACTOR IMPORTER EDITOR PLUGINS CLI SCRIPTS WEB UI Source Code.fo Server User Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 30

Frappé Architecture EXTRACTOR IMPORTER EDITOR PLUGINS CLI SCRIPTS WEB UI Source Code.fo Server User Copyright 2014 Oracle and/or its affiliates. All rights reserved. Oracle ConfidenMal - Restricted 31

Code Maps Visualising large codebases 32

Code Maps Using a cartographic map metaphor ConMnent/country/state/city à module/sub- module/file/funcmon DisMncMve shape and posimons serve as landmarks Can overlay a variety of informamon 33

Overlay Search Results Visual filtering Contextual search Copyright 2014 Oracle and/or its affiliates. All rights reserved. Frappé: a code comprehension tool for large codebases 34

Overlay Paths java.lang.runtimeexception: bad at Foobar.setup(Foobar.java:74) at Foobar.launch(Foobar.java:43) at Bar.launch(Bar.java:39) at Bar.bar(Bar.java:97) at Foo.foo(Foo.java:35) at Main.main(Main.java:104) Path in stack trace Path on map 35

Overlay Metrics Fine granularity Coarse granularity 36

But how? 37

ExisMng Approaches Deline, R. Staying oriented with sooware terrain maps In proc. of the workshop of visual languages and computamon, 2005 Kuhn, A.; Erni, D.; Loretan, P.; Nierstrasz, O. SoOware cartography: themalc sooware visualizalon with consistent layout Journal of Sopware Maintenance and EvoluMon, 2010 38

Input AbstracMon hierarchy Abstracts files into higher level groupings Use directory structure by default Dependency graph Represents dependencies between files as a weighted edge Use references 39

Map GeneraMon Graph layout Implicit surface generamon Surface subdivision Recursive subdivision 40

Map GeneraMon Implicit surface generamon Graph layout Noack, A. & Lewerentz, C. A space of layout styles for hierarchical graph models of sooware systems Proceedings of the 2005 ACM symposium on Sopware visualizamon, ACM, 2005, 155-164 Recursive subdivision Nocaj, A. & Brandes, U. CompuLng Voronoi Treemaps: Faster, Simpler, and ResoluLon- independent Computer Graphics Forum, Blackwell Publishing Ltd, 2012, 31, 855-864 41

DemonstraMon Linux 42

Future Work More detailed dependency graph Find calls where third argument is macro FLAG Find all funcmons the pointer fptr could point to More overlays Test coverage, profiling data Store mulmple versions Impact esmmamon Code map evolumon (stability) 43

Nathan Hawes and Ben Barham nathan.hawes@oracle.com ben.barham@oracle.com Oracle Labs Australia hsp://labs.oracle.com/locamons/australia Research Director crismna.cifuentes@oracle.com