SlideShare uma empresa Scribd logo
1 de 60
Baixar para ler offline
ADVANCED DEBUGGING USING
JAVA BYTECODES
Ganesh Samarthyam (ganesh@codeops.tech)
Don’t understand what’s under the
hood?
How to debug without source code?
Java Bytecodes
But this low level stuff is scary -
do I wanna learn it?
Did Rose knew how to use an axe
when trying to free Jack?
“On the job training!!”
So, come, let’s explore the bytecodes!
(1	-	(2	/	3))	+	((4	%	5)	*	6)
Draw the
expression tree
(1	-	(2	/	3))	+	((4	%	5)	*	6)
Perform post-order
traversal of the tree
1 2 3 / - 4 5 % 6 * +
post-order
traversal
result
Use a stack for
evaluating this
postfix expression
1 2 3 / - 4 5 % 6 * +
1 2 3 / - 4 5 % 6 * +
1 1
2
1
2
3
1
0
Initial
empty
push 1 push 2 push 3
pop 3
pop 2
push 2 / 3
1
pop 0
pop 1
push 1 - 0
1
push 4
4
1
push 5
4
5
1
pop 5
pop 4
push 4 % 5
4
1
push 6
4
6
1
pop 6
pop 4
push 6 * 4
24
25
pop 24
pop 1
push 24 + 1
1 2 3 / - 4 5 % 6 * +
Initial
empty
1 2 3 / - 4 5 % 6 * +
1
push 1
1 2 3 / - 4 5 % 6 * +
1
2
push 2
1 2 3 / - 4 5 % 6 * +
1
2
3
push 3
1 2 3 / - 4 5 % 6 * +
1
0
pop 3
pop 2
push 2 / 3
1 2 3 / - 4 5 % 6 * +
1
pop 0
pop 1
push 1 - 0
1 2 3 / - 4 5 % 6 * +
1
push 4
4
1 2 3 / - 4 5 % 6 * +
1
push 5
4
5
1 2 3 / - 4 5 % 6 * +
1
pop 5
pop 4
push 4 % 5
4
1 2 3 / - 4 5 % 6 * +
1
push 6
4
6
1 2 3 / - 4 5 % 6 * +
1
pop 6
pop 4
push 6 * 4
24
1 2 3 / - 4 5 % 6 * +
25
pop 24
pop 1
push 24 + 1
1 2 3 / - 4 5 % 6 * +
Let us give
names to these
operations
push 1
push 2
push 3
div
sub
push 4
push 5
mod
push 6
mul
add
int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6;
int r = (a - (b / c)) + ((d % e) * f);
This is what a Java
compiler generates
iload_1
iload_2
iload_3
idiv
isub
iload 4
iload 5
irem
iload 6
imul
iadd
istore 7
push 1
push 2
push 3
div
sub
push 4
push 5
mod
push 6
mul
add
ourbytecode
Javabytecodes
(1	-	(2	/	3))	+	((4	%	5)	*	6)Source code
Java
Compiler
JavaBytecode
JVM
iload_1
iload_2
iload_3
idiv
isub
iload 4
iload 5
irem
iload 6
imul
iadd
istore 7
Java bytecodes supports object oriented programming
Typed intermediate language
Supports primitive types (int, float, double, …) and
reference types (arrays, strings, objects, …)
Instructions can be classified into various types such as:
loading (*load*)
storing (*store*)
method invocation
arithmetic operations
logical operations
control flow
memory allocation
exception handling
…
:% ! xxd in
vim
Viewing hex values of
the .class files
$ cat Expr.java
class Expr {
public static void main(String []args) {
int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6;
int r = (a - (b / c)) + ((d % e) * f);
System.out.println("" + r);
}
}
$ javac Expr.java
$ java Expr
25
$ javap -c Expr.class
Compiled from "Expr.java"
class Expr {
Expr();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String[]);
Code:
0: iconst_1
1: istore_1
...
Java
compiler
JavaVM
Java
disassembler
Use java tool for
disassembling
Using Dr. Garbage’s Bytecode
Visualizer and Debugger
http://www.drgarbage.com/bytecode-visualizer/
Using Dr. Garbage’s Bytecode
Visualizer and Debugger
http://www.drgarbage.com/bytecode-visualizer/
System.out.println(“Hello World");
Java bytecodes
// disassembled code using javap tool
0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
3: ldc #3 // String Hello World
5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
int i = 10;
if(i != 20)
i = i*20;
System.out.println(i);
javap -c
0: bipush 10
2: istore_1
3: iload_1
4: bipush 20
6: if_icmpeq 14
9: iload_1
10: bipush 20
12: imul
13: istore_1
14: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
17: iload_1
18: invokevirtual #3 // Method java/io/PrintStream.println:(I)V
21: return
public static void
main(java.lang.String[]);
descriptor: ??
flags: ??, ??
Code:
stack=??, locals=??, args_size=??
Pop
Quiz
public static void main(String []args) {
int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6;
int r = (a - (b / c)) + ((d % e) * f);
System.out.println("" + r);
}
public static void
main(java.lang.String[]);
descriptor: ([Ljava/lang/String;)V
flags: ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=8, args_size=1
Answer
1 2 3 / - 4 5 % 6 * +
1 1
2
1
2
3
1
0
Initial
empty
push 1 push 2 push 3
pop 3
pop 2
push 2 / 3
1
pop 0
pop 1
push 1 - 0
1
push 4
4
1
push 5
4
5
1
pop 5
pop 4
push 4 % 5
4
1
push 6
4
6
1
pop 6
pop 4
push 6 * 4
24
25
pop 24
pop 1
push 24 + 1
Answer:
max stack
value is 3
Supplier<String> s = () -> "hello world";
System.out.println(s.get());
Pop
Quiz
What bytecode
instruction would
s.get() generate?
invokedynamic
Answer
Pop
Quiz
0: iconst_0
1: istore_1
2: iconst_0
3: istore_2
4: iload_2
5: bipush 10
7: if_icmpge 20
10: iload_1
11: iload_2
12: iadd
13: istore_1
14: iinc 2, 1
17: goto 4
20: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
23: iload_1
24: invokevirtual #3 // Method java/io/PrintStream.println:(I)V
27: return
Decompile this
assembly code
Answer
public static void main(String []args) {
int sum = 0;
for(int i = 0; i < 10; i++) {
sum += i;
}
System.out.println(sum);
}
0: iconst_0
1: istore_1
2: iconst_0
3: istore_2
4: iload_2
5: bipush 10
7: if_icmpge 20
10: iload_1
11: iload_2
12: iadd
13: istore_1
14: iinc 2, 1
17: goto 4
20: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
23: iload_1
24: invokevirtual #3 // Method java/io/PrintStream.println:(I)V
27: return
What is the “magic number"
of Java’s “.class” files?
Pop
Quiz
A. 0xDEADBEEF
B. 0xCAFEBABE
C. 0xC0DEC0DA
D. 0xBAADF00D
CAFEBABE
Let’s fix it
class URL {
public static void main(String []args) {
http://www.google.com
System.out.println("Hello");
}
}
http: is a label and // is start
of a comment!!
public static void main(java.lang.String[]);
Code:
0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream;
3: ldc #3 // String Hello
5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
8: return
Question	
What	will	be	the	output	of	this	program?
class Color {
int red,	green,	blue;
void Color()	{
red	=	10;	green	=	10; blue	=	10;
}
void printColor()	{
System.out.println("red:	"	+	red	+	"	green:	"	+	green	+	"	blue:	"	+	blue);
}
public	static	void	main(String	[]	args)	{
Color color=	new Color();
color.printColor();
}
}
A.	Compiler	error:	no	constructor	provided	for	the	class
B.	Compiles	fine,	and	when	run,	it	prints	the	following:	red:	0	green:	0	blue:	0
C.	Compiles	fine,	and	when	run,	it	prints	the	following:	red:	10	green:	10	blue:	10
D.	Compiles	fine,	and	when	run,	crashes	by	throwing	NullPointerException
Answer
What	will	be	the	output	of	this	program?
class Color {
int red,	green,	blue;
void Color()	{
red	=	10;	green	=	10;	blue	=	10;
}
void printColor()	{
System.out.println("red:	"	+	red	+	"	green:	"	+	green	+	"	blue:	"	+	blue);
}
public	static	void	main(String	[]	args)	{
Color color=	new Color();
color.printColor();
}
}
A.	Compiler	error:	no	constructor	provided	for	the	class
B.	Compiles	fine,	and	when	run,	it	prints	the	following:	red:	0	green:	0	blue:	0
C.	Compiles	fine,	and	when	run,	it	prints	the	following:	red:	10	green:	10	blue:	10
D.	Compiles	fine,	and	when	run,	crashes	by	throwing	NullPointerException
$ javap Color.class
Compiled from "Color.java"
class Color {
int red;
int green;
int blue;
Color();
void Color();
void printColor();
public static void main(java.lang.String[]);
}
Color();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
void Color();
Code:
0: aload_0
1: bipush 10
3: putfield #2 // Field red:I
6: aload_0
7: bipush 10
9: putfield #3 // Field green:I
12: aload_0
13: bipush 10
15: putfield #4 // Field blue:I
18: return
Aha! The generated code
doesn’t look right!
				void	Color()	{	
	 				red	=	10;	green	=	10;	blue	=	10;	
				}
abstract class Printer {
private Integer portNumber = getPortNumber();
abstract Integer getPortNumber();
public static void main(String[]s) {
Printer p = new LPDPrinter();
System.out.println(p.portNumber);
}
}
class LPDPrinter extends Printer {
/* Line Printer Deamon port no is 515 */
private Integer defaultPortNumber = 515;
Integer getPortNumber() {
return defaultPortNumber;
}
}
abstract class Printer {
private Integer portNumber = getPortNumber();
abstract Integer getPortNumber();
public static void main(String[]s) {
Printer p = new LPDPrinter();
System.out.println(p.portNumber);
}
}
class LPDPrinter extends Printer {
/* Line Printer Deamon port no is 515 */
private Integer defaultPortNumber = 515;
Integer getPortNumber() {
return defaultPortNumber;
}
}
$ javap -c LPDPrinter.class
Compiled from "Printer.java"
class LPDPrinter extends Printer {
LPDPrinter();
Code:
0: aload_0
1: invokespecial #1 // Method Printer."<init>":()V
4: aload_0
5: sipush 515
8: invokestatic #2 // Method java/lang/Integer.valueOf:(I)Ljava/
lang/Integer;
11: putfield #3 // Field defaultPortNumber:Ljava/lang/Integer;
14: return
java.lang.Integer getPortNumber();
Code:
0: aload_0
1: getfield #3 // Field defaultPortNumber:Ljava/lang/Integer;
4: areturn
}
Initialisation happens *after*
the base class constructor got
javap can get you lost in
details!
int ch = 0;
while((ch = inputFile.read()) != 0) {
System.out.print(ch);
}
48: iconst_0
49: istore 7
51: aload 5
53: invokevirtual #8 // Method java/io/FileReader.read:()I
56: dup
57: istore 7
59: ifeq 73
62: getstatic #9 // Field java/lang/System.out:Ljava/io/PrintStream
65: iload 7
67: invokevirtual #10 // Method java/io/PrintStream.print:(I)V
• Difficult to debug when reflection and runtime class
generation is involved
• Obfuscated bytecodes are extremely difficult to debug
FUN PROJECT
The best way to learn Java bytecodes is to implement a Java
disassembler on your own!
For implementation, read the documentation of Java
bytecodes (in the JVM specification) and use javap tool as
the reference implementation.
BOOKSTO READ
Free download here: https://docs.oracle.com/javase/specs/jvms/se8/jvms8.pdf
BOOKSTO READ
BOOKSTO READ
IMAGE CREDITS
• https://pixabay.com/static/uploads/photo/2015/12/28/15/58/ferrari-1111582_960_720.jpg
• http://i.dailymail.co.uk/i/pix/2014/08/29/article-0-0296355F000004B0-113_634x421.jpg
• http://blogs.shell.com/climatechange/wp-content/uploads/2015/01/Check-under-the-hood.jpg
• https://diaryofabusymumdotcom.files.wordpress.com/2015/01/1369952540_be029c8337.jpg
• http://trentarthur.ca/wp-content/uploads/2013/05/gatsby.jpg
• http://cdn.playbuzz.com/cdn/84b94651-08da-4191-9b45-069535cf523f/9c35f887-a6fc-4c8d-861a-f323078709e8.jpg
• http://pad2.whstatic.com/images/thumb/5/54/Draw-a-Simple-Tree-Step-2.jpg/aid594851-728px-Draw-a-Simple-Tree-Step-2.jpg
• http://www.seabreeze.com.au/Img/Photos/Windsurfing/5350271.jpg
• https://d.gr-assets.com/hostedimages/1380222758ra/461081.gif
• http://cdn.shopify.com/s/files/1/0021/6982/products/GW-7693274_large.jpg?v=1283553128
• http://www.fisher-price.com/en_IN/Images/RMA_RWD_rock_a_stack_tcm222-163387.jpg
• http://www.njfamily.com/NJ-Family/January-2011/Learn-How-to-Spot-a-Learning-Disability/Boy-learning-disability.jpg
• https://teens.drugabuse.gov/sites/default/files/styles/medium/public/NIDA-News-What-was-down-the-hole-Alice.jpg?itok=DH19L7F2
• http://archivedemo.cnx.org/resources/4df9b85136bb00ee04456b031aa0c344e54f282e/CNX_Psych_08_04_Knuckles.jpg
• http://archivedemo.cnx.org/resources/4df9b85136bb00ee04456b031aa0c344e54f282e/CNX_Psych_08_04_Knuckles.jpg
• http://www.urbanspaces.co.uk/image/error-message-error-us.jpg
• http://conservationmagazine.org/wordpress/wp-content/uploads/2013/05/dig-deeper.jpg
• http://4.bp.blogspot.com/-BAZm9rddEhQ/TWy441M-p1I/AAAAAAAAAQg/_SKF8PMkVHA/s1600/
mr%2Bfixit.tif%2B%2528Converted%2529--6.jpg

Mais conteúdo relacionado

Mais procurados

Functional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting LambdasFunctional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting LambdasGanesh Samarthyam
 
Advanced Java Practical File
Advanced Java Practical FileAdvanced Java Practical File
Advanced Java Practical FileSoumya Behera
 
Functional Thinking - Programming with Lambdas in Java 8
Functional Thinking - Programming with Lambdas in Java 8Functional Thinking - Programming with Lambdas in Java 8
Functional Thinking - Programming with Lambdas in Java 8Ganesh Samarthyam
 
Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.David Gómez García
 
Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and UtilitiesPramod Kumar
 
Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Nishan Barot
 
Java PRACTICAL file
Java PRACTICAL fileJava PRACTICAL file
Java PRACTICAL fileRACHIT_GUPTA
 
Java Generics for Dummies
Java Generics for DummiesJava Generics for Dummies
Java Generics for Dummiesknutmork
 
Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)Trisha Gee
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVMRafael Winterhalter
 
OCJP Samples Questions: Exceptions and assertions
OCJP Samples Questions: Exceptions and assertionsOCJP Samples Questions: Exceptions and assertions
OCJP Samples Questions: Exceptions and assertionsHari kiran G
 
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Susan Potter
 
Concurrency Concepts in Java
Concurrency Concepts in JavaConcurrency Concepts in Java
Concurrency Concepts in JavaDoug Hawkins
 

Mais procurados (20)

Functional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting LambdasFunctional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting Lambdas
 
Advanced Java Practical File
Advanced Java Practical FileAdvanced Java Practical File
Advanced Java Practical File
 
Java Generics
Java GenericsJava Generics
Java Generics
 
Functional Thinking - Programming with Lambdas in Java 8
Functional Thinking - Programming with Lambdas in Java 8Functional Thinking - Programming with Lambdas in Java 8
Functional Thinking - Programming with Lambdas in Java 8
 
Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.Java 8 Stream API. A different way to process collections.
Java 8 Stream API. A different way to process collections.
 
Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and Utilities
 
Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.
 
Java Generics
Java GenericsJava Generics
Java Generics
 
Java PRACTICAL file
Java PRACTICAL fileJava PRACTICAL file
Java PRACTICAL file
 
Java Generics for Dummies
Java Generics for DummiesJava Generics for Dummies
Java Generics for Dummies
 
Java programs
Java programsJava programs
Java programs
 
Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)
 
Initial Java Core Concept
Initial Java Core ConceptInitial Java Core Concept
Initial Java Core Concept
 
Java 8: the good parts!
Java 8: the good parts!Java 8: the good parts!
Java 8: the good parts!
 
Why Learn Python?
Why Learn Python?Why Learn Python?
Why Learn Python?
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVM
 
Java practical
Java practicalJava practical
Java practical
 
OCJP Samples Questions: Exceptions and assertions
OCJP Samples Questions: Exceptions and assertionsOCJP Samples Questions: Exceptions and assertions
OCJP Samples Questions: Exceptions and assertions
 
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
Scalaz By Example (An IO Taster) -- PDXScala Meetup Jan 2014
 
Concurrency Concepts in Java
Concurrency Concepts in JavaConcurrency Concepts in Java
Concurrency Concepts in Java
 

Destaque

Software Architecture - Principles Patterns and Practices - OSI Days Workshop...
Software Architecture - Principles Patterns and Practices - OSI Days Workshop...Software Architecture - Principles Patterns and Practices - OSI Days Workshop...
Software Architecture - Principles Patterns and Practices - OSI Days Workshop...CodeOps Technologies LLP
 
DevOps Fundamentals: A perspective on DevOps Culture
DevOps Fundamentals: A perspective on DevOps Culture DevOps Fundamentals: A perspective on DevOps Culture
DevOps Fundamentals: A perspective on DevOps Culture CodeOps Technologies LLP
 
Choosing Between Cross Platform of Native Development
Choosing	Between Cross Platform of Native DevelopmentChoosing	Between Cross Platform of Native Development
Choosing Between Cross Platform of Native DevelopmentCodeOps Technologies LLP
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkCodeOps Technologies LLP
 
Solid Principles Of Design (Design Series 01)
Solid Principles Of Design (Design Series 01)Solid Principles Of Design (Design Series 01)
Solid Principles Of Design (Design Series 01)Heartin Jacob
 
Zero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous DeliveryZero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous DeliveryMurughan Palaniachari
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Ganesh Samarthyam
 
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIModern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIGanesh Samarthyam
 

Destaque (20)

Java Generics - by Example
Java Generics - by ExampleJava Generics - by Example
Java Generics - by Example
 
Java 8 concurrency abstractions
Java 8 concurrency abstractionsJava 8 concurrency abstractions
Java 8 concurrency abstractions
 
Software Architecture - Principles Patterns and Practices - OSI Days Workshop...
Software Architecture - Principles Patterns and Practices - OSI Days Workshop...Software Architecture - Principles Patterns and Practices - OSI Days Workshop...
Software Architecture - Principles Patterns and Practices - OSI Days Workshop...
 
Better java with design
Better java with designBetter java with design
Better java with design
 
DevOps Fundamentals: A perspective on DevOps Culture
DevOps Fundamentals: A perspective on DevOps Culture DevOps Fundamentals: A perspective on DevOps Culture
DevOps Fundamentals: A perspective on DevOps Culture
 
7 best quotes on dev ops
7 best quotes on dev ops7 best quotes on dev ops
7 best quotes on dev ops
 
Choosing Between Cross Platform of Native Development
Choosing	Between Cross Platform of Native DevelopmentChoosing	Between Cross Platform of Native Development
Choosing Between Cross Platform of Native Development
 
DevOps - A Gentle Introduction
DevOps - A Gentle IntroductionDevOps - A Gentle Introduction
DevOps - A Gentle Introduction
 
Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
 
Java Concurrency by Example
Java Concurrency by ExampleJava Concurrency by Example
Java Concurrency by Example
 
Solid Principles Of Design (Design Series 01)
Solid Principles Of Design (Design Series 01)Solid Principles Of Design (Design Series 01)
Solid Principles Of Design (Design Series 01)
 
Zero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous DeliveryZero downtime release through DevOps Continuous Delivery
Zero downtime release through DevOps Continuous Delivery
 
DevOps Toolchain v1.0
DevOps Toolchain v1.0DevOps Toolchain v1.0
DevOps Toolchain v1.0
 
DevOps game marshmallow challenge
DevOps game marshmallow challengeDevOps game marshmallow challenge
DevOps game marshmallow challenge
 
Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams Productive Programming in Java 8 - with Lambdas and Streams
Productive Programming in Java 8 - with Lambdas and Streams
 
Java concurrency questions and answers
Java concurrency questions and answers Java concurrency questions and answers
Java concurrency questions and answers
 
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time APIModern Programming in Java 8 - Lambdas, Streams and Date Time API
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
 
Core Java - Quiz Questions - Bug Hunt
Core Java - Quiz Questions - Bug HuntCore Java - Quiz Questions - Bug Hunt
Core Java - Quiz Questions - Bug Hunt
 

Semelhante a Advanced Debugging Using Java Bytecodes

Wap to implement bitwise operators
Wap to implement bitwise operatorsWap to implement bitwise operators
Wap to implement bitwise operatorsHarleen Sodhi
 
Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Anton Arhipov
 
Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015Raimon Ràfols
 
Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014Raimon Ràfols
 
JSUG - Tech Tips1 by Christoph Pickl
JSUG - Tech Tips1 by Christoph PicklJSUG - Tech Tips1 by Christoph Pickl
JSUG - Tech Tips1 by Christoph PicklChristoph Pickl
 
LISA QooxdooTutorial Slides
LISA QooxdooTutorial SlidesLISA QooxdooTutorial Slides
LISA QooxdooTutorial SlidesTobias Oetiker
 
JavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfJavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfSathwika7
 
Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011Anton Arhipov
 
Java 스터디 강의자료 - 1차시
Java 스터디 강의자료 - 1차시Java 스터디 강의자료 - 1차시
Java 스터디 강의자료 - 1차시Junha Jang
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoinknight1128
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers ToolboxStefan
 
Lies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerLies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerGarth Gilmour
 
NetPonto - The Future Of C# - NetConf Edition
NetPonto - The Future Of C# - NetConf EditionNetPonto - The Future Of C# - NetConf Edition
NetPonto - The Future Of C# - NetConf EditionPaulo Morgado
 
EcmaScript unchained
EcmaScript unchainedEcmaScript unchained
EcmaScript unchainedEduard Tomàs
 
Go Says WAT?
Go Says WAT?Go Says WAT?
Go Says WAT?jonbodner
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
 

Semelhante a Advanced Debugging Using Java Bytecodes (20)

Java Bytecodes by Example
Java Bytecodes by ExampleJava Bytecodes by Example
Java Bytecodes by Example
 
Wap to implement bitwise operators
Wap to implement bitwise operatorsWap to implement bitwise operators
Wap to implement bitwise operators
 
Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011
 
Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015Improving Java performance at JBCNConf 2015
Improving Java performance at JBCNConf 2015
 
Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014Improving Android Performance at Droidcon UK 2014
Improving Android Performance at Droidcon UK 2014
 
JSUG - Tech Tips1 by Christoph Pickl
JSUG - Tech Tips1 by Christoph PicklJSUG - Tech Tips1 by Christoph Pickl
JSUG - Tech Tips1 by Christoph Pickl
 
LISA QooxdooTutorial Slides
LISA QooxdooTutorial SlidesLISA QooxdooTutorial Slides
LISA QooxdooTutorial Slides
 
JavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdfJavaProgrammingForBeginners-Presentation.pdf
JavaProgrammingForBeginners-Presentation.pdf
 
Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011
 
Java 스터디 강의자료 - 1차시
Java 스터디 강의자료 - 1차시Java 스터디 강의자료 - 1차시
Java 스터디 강의자료 - 1차시
 
Jdk 7 4-forkjoin
Jdk 7 4-forkjoinJdk 7 4-forkjoin
Jdk 7 4-forkjoin
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers Toolbox
 
Lies Told By The Kotlin Compiler
Lies Told By The Kotlin CompilerLies Told By The Kotlin Compiler
Lies Told By The Kotlin Compiler
 
NetPonto - The Future Of C# - NetConf Edition
NetPonto - The Future Of C# - NetConf EditionNetPonto - The Future Of C# - NetConf Edition
NetPonto - The Future Of C# - NetConf Edition
 
In Vogue Dynamic
In Vogue DynamicIn Vogue Dynamic
In Vogue Dynamic
 
Os lab final
Os lab finalOs lab final
Os lab final
 
EcmaScript unchained
EcmaScript unchainedEcmaScript unchained
EcmaScript unchained
 
Mastering Java ByteCode
Mastering Java ByteCodeMastering Java ByteCode
Mastering Java ByteCode
 
Go Says WAT?
Go Says WAT?Go Says WAT?
Go Says WAT?
 
JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?JVM Mechanics: When Does the JVM JIT & Deoptimize?
JVM Mechanics: When Does the JVM JIT & Deoptimize?
 

Mais de Ganesh Samarthyam

Applying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeApplying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeGanesh Samarthyam
 
CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”Ganesh Samarthyam
 
Great Coding Skills Aren't Enough
Great Coding Skills Aren't EnoughGreat Coding Skills Aren't Enough
Great Coding Skills Aren't EnoughGanesh Samarthyam
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionGanesh Samarthyam
 
Coding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeCoding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeGanesh Samarthyam
 
Bangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationBangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationGanesh Samarthyam
 
Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterGanesh Samarthyam
 
Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Ganesh Samarthyam
 
OO Design and Design Patterns in C++
OO Design and Design Patterns in C++ OO Design and Design Patterns in C++
OO Design and Design Patterns in C++ Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship DeckBangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship DeckGanesh Samarthyam
 
Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageGanesh Samarthyam
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Ganesh Samarthyam
 
Java Generics - Quiz Questions
Java Generics - Quiz QuestionsJava Generics - Quiz Questions
Java Generics - Quiz QuestionsGanesh Samarthyam
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz QuestionsGanesh Samarthyam
 
Core Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quizCore Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quizGanesh Samarthyam
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Ganesh Samarthyam
 

Mais de Ganesh Samarthyam (20)

Wonders of the Sea
Wonders of the SeaWonders of the Sea
Wonders of the Sea
 
Animals - for kids
Animals - for kids Animals - for kids
Animals - for kids
 
Applying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeApplying Refactoring Tools in Practice
Applying Refactoring Tools in Practice
 
CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”
 
Great Coding Skills Aren't Enough
Great Coding Skills Aren't EnoughGreat Coding Skills Aren't Enough
Great Coding Skills Aren't Enough
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
 
Coding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeCoding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean Code
 
Bangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationBangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief Presentation
 
Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - Poster
 
Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)
 
OO Design and Design Patterns in C++
OO Design and Design Patterns in C++ OO Design and Design Patterns in C++
OO Design and Design Patterns in C++
 
Bangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship DeckBangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship Deck
 
Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
 
Java Generics - Quiz Questions
Java Generics - Quiz QuestionsJava Generics - Quiz Questions
Java Generics - Quiz Questions
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
 
Core Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quizCore Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quiz
 
Java Class Design
Java Class DesignJava Class Design
Java Class Design
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...
 

Último

WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 

Último (20)

WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 

Advanced Debugging Using Java Bytecodes

  • 1. ADVANCED DEBUGGING USING JAVA BYTECODES Ganesh Samarthyam (ganesh@codeops.tech)
  • 2. Don’t understand what’s under the hood?
  • 3. How to debug without source code?
  • 4. Java Bytecodes But this low level stuff is scary - do I wanna learn it?
  • 5. Did Rose knew how to use an axe when trying to free Jack?
  • 6. “On the job training!!”
  • 7. So, come, let’s explore the bytecodes!
  • 11. 1 2 3 / - 4 5 % 6 * + post-order traversal result
  • 12. Use a stack for evaluating this postfix expression 1 2 3 / - 4 5 % 6 * +
  • 13.
  • 14. 1 2 3 / - 4 5 % 6 * + 1 1 2 1 2 3 1 0 Initial empty push 1 push 2 push 3 pop 3 pop 2 push 2 / 3 1 pop 0 pop 1 push 1 - 0 1 push 4 4 1 push 5 4 5 1 pop 5 pop 4 push 4 % 5 4 1 push 6 4 6 1 pop 6 pop 4 push 6 * 4 24 25 pop 24 pop 1 push 24 + 1
  • 15. 1 2 3 / - 4 5 % 6 * + Initial empty
  • 16. 1 2 3 / - 4 5 % 6 * + 1 push 1
  • 17. 1 2 3 / - 4 5 % 6 * + 1 2 push 2
  • 18. 1 2 3 / - 4 5 % 6 * + 1 2 3 push 3
  • 19. 1 2 3 / - 4 5 % 6 * + 1 0 pop 3 pop 2 push 2 / 3
  • 20. 1 2 3 / - 4 5 % 6 * + 1 pop 0 pop 1 push 1 - 0
  • 21. 1 2 3 / - 4 5 % 6 * + 1 push 4 4
  • 22. 1 2 3 / - 4 5 % 6 * + 1 push 5 4 5
  • 23. 1 2 3 / - 4 5 % 6 * + 1 pop 5 pop 4 push 4 % 5 4
  • 24. 1 2 3 / - 4 5 % 6 * + 1 push 6 4 6
  • 25. 1 2 3 / - 4 5 % 6 * + 1 pop 6 pop 4 push 6 * 4 24
  • 26. 1 2 3 / - 4 5 % 6 * + 25 pop 24 pop 1 push 24 + 1
  • 27. 1 2 3 / - 4 5 % 6 * + Let us give names to these operations push 1 push 2 push 3 div sub push 4 push 5 mod push 6 mul add
  • 28. int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6; int r = (a - (b / c)) + ((d % e) * f); This is what a Java compiler generates iload_1 iload_2 iload_3 idiv isub iload 4 iload 5 irem iload 6 imul iadd istore 7 push 1 push 2 push 3 div sub push 4 push 5 mod push 6 mul add ourbytecode Javabytecodes
  • 30. Java bytecodes supports object oriented programming Typed intermediate language Supports primitive types (int, float, double, …) and reference types (arrays, strings, objects, …) Instructions can be classified into various types such as: loading (*load*) storing (*store*) method invocation arithmetic operations logical operations control flow memory allocation exception handling …
  • 31. :% ! xxd in vim Viewing hex values of the .class files
  • 32.
  • 33. $ cat Expr.java class Expr { public static void main(String []args) { int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6; int r = (a - (b / c)) + ((d % e) * f); System.out.println("" + r); } } $ javac Expr.java $ java Expr 25 $ javap -c Expr.class Compiled from "Expr.java" class Expr { Expr(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return public static void main(java.lang.String[]); Code: 0: iconst_1 1: istore_1 ... Java compiler JavaVM Java disassembler Use java tool for disassembling
  • 34. Using Dr. Garbage’s Bytecode Visualizer and Debugger http://www.drgarbage.com/bytecode-visualizer/
  • 35. Using Dr. Garbage’s Bytecode Visualizer and Debugger http://www.drgarbage.com/bytecode-visualizer/
  • 36. System.out.println(“Hello World"); Java bytecodes // disassembled code using javap tool 0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 3: ldc #3 // String Hello World 5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
  • 37. int i = 10; if(i != 20) i = i*20; System.out.println(i); javap -c 0: bipush 10 2: istore_1 3: iload_1 4: bipush 20 6: if_icmpeq 14 9: iload_1 10: bipush 20 12: imul 13: istore_1 14: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 17: iload_1 18: invokevirtual #3 // Method java/io/PrintStream.println:(I)V 21: return
  • 38. public static void main(java.lang.String[]); descriptor: ?? flags: ??, ?? Code: stack=??, locals=??, args_size=?? Pop Quiz public static void main(String []args) { int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6; int r = (a - (b / c)) + ((d % e) * f); System.out.println("" + r); }
  • 39. public static void main(java.lang.String[]); descriptor: ([Ljava/lang/String;)V flags: ACC_PUBLIC, ACC_STATIC Code: stack=3, locals=8, args_size=1 Answer
  • 40. 1 2 3 / - 4 5 % 6 * + 1 1 2 1 2 3 1 0 Initial empty push 1 push 2 push 3 pop 3 pop 2 push 2 / 3 1 pop 0 pop 1 push 1 - 0 1 push 4 4 1 push 5 4 5 1 pop 5 pop 4 push 4 % 5 4 1 push 6 4 6 1 pop 6 pop 4 push 6 * 4 24 25 pop 24 pop 1 push 24 + 1 Answer: max stack value is 3
  • 41. Supplier<String> s = () -> "hello world"; System.out.println(s.get()); Pop Quiz What bytecode instruction would s.get() generate?
  • 43. Pop Quiz 0: iconst_0 1: istore_1 2: iconst_0 3: istore_2 4: iload_2 5: bipush 10 7: if_icmpge 20 10: iload_1 11: iload_2 12: iadd 13: istore_1 14: iinc 2, 1 17: goto 4 20: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 23: iload_1 24: invokevirtual #3 // Method java/io/PrintStream.println:(I)V 27: return Decompile this assembly code
  • 44. Answer public static void main(String []args) { int sum = 0; for(int i = 0; i < 10; i++) { sum += i; } System.out.println(sum); } 0: iconst_0 1: istore_1 2: iconst_0 3: istore_2 4: iload_2 5: bipush 10 7: if_icmpge 20 10: iload_1 11: iload_2 12: iadd 13: istore_1 14: iinc 2, 1 17: goto 4 20: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 23: iload_1 24: invokevirtual #3 // Method java/io/PrintStream.println:(I)V 27: return
  • 45. What is the “magic number" of Java’s “.class” files? Pop Quiz A. 0xDEADBEEF B. 0xCAFEBABE C. 0xC0DEC0DA D. 0xBAADF00D
  • 48. class URL { public static void main(String []args) { http://www.google.com System.out.println("Hello"); } } http: is a label and // is start of a comment!! public static void main(java.lang.String[]); Code: 0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 3: ldc #3 // String Hello 5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 8: return
  • 49. Question What will be the output of this program? class Color { int red, green, blue; void Color() { red = 10; green = 10; blue = 10; } void printColor() { System.out.println("red: " + red + " green: " + green + " blue: " + blue); } public static void main(String [] args) { Color color= new Color(); color.printColor(); } } A. Compiler error: no constructor provided for the class B. Compiles fine, and when run, it prints the following: red: 0 green: 0 blue: 0 C. Compiles fine, and when run, it prints the following: red: 10 green: 10 blue: 10 D. Compiles fine, and when run, crashes by throwing NullPointerException
  • 50. Answer What will be the output of this program? class Color { int red, green, blue; void Color() { red = 10; green = 10; blue = 10; } void printColor() { System.out.println("red: " + red + " green: " + green + " blue: " + blue); } public static void main(String [] args) { Color color= new Color(); color.printColor(); } } A. Compiler error: no constructor provided for the class B. Compiles fine, and when run, it prints the following: red: 0 green: 0 blue: 0 C. Compiles fine, and when run, it prints the following: red: 10 green: 10 blue: 10 D. Compiles fine, and when run, crashes by throwing NullPointerException
  • 51. $ javap Color.class Compiled from "Color.java" class Color { int red; int green; int blue; Color(); void Color(); void printColor(); public static void main(java.lang.String[]); } Color(); Code: 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return void Color(); Code: 0: aload_0 1: bipush 10 3: putfield #2 // Field red:I 6: aload_0 7: bipush 10 9: putfield #3 // Field green:I 12: aload_0 13: bipush 10 15: putfield #4 // Field blue:I 18: return Aha! The generated code doesn’t look right! void Color() { red = 10; green = 10; blue = 10; }
  • 52. abstract class Printer { private Integer portNumber = getPortNumber(); abstract Integer getPortNumber(); public static void main(String[]s) { Printer p = new LPDPrinter(); System.out.println(p.portNumber); } } class LPDPrinter extends Printer { /* Line Printer Deamon port no is 515 */ private Integer defaultPortNumber = 515; Integer getPortNumber() { return defaultPortNumber; } }
  • 53. abstract class Printer { private Integer portNumber = getPortNumber(); abstract Integer getPortNumber(); public static void main(String[]s) { Printer p = new LPDPrinter(); System.out.println(p.portNumber); } } class LPDPrinter extends Printer { /* Line Printer Deamon port no is 515 */ private Integer defaultPortNumber = 515; Integer getPortNumber() { return defaultPortNumber; } } $ javap -c LPDPrinter.class Compiled from "Printer.java" class LPDPrinter extends Printer { LPDPrinter(); Code: 0: aload_0 1: invokespecial #1 // Method Printer."<init>":()V 4: aload_0 5: sipush 515 8: invokestatic #2 // Method java/lang/Integer.valueOf:(I)Ljava/ lang/Integer; 11: putfield #3 // Field defaultPortNumber:Ljava/lang/Integer; 14: return java.lang.Integer getPortNumber(); Code: 0: aload_0 1: getfield #3 // Field defaultPortNumber:Ljava/lang/Integer; 4: areturn } Initialisation happens *after* the base class constructor got
  • 54. javap can get you lost in details! int ch = 0; while((ch = inputFile.read()) != 0) { System.out.print(ch); } 48: iconst_0 49: istore 7 51: aload 5 53: invokevirtual #8 // Method java/io/FileReader.read:()I 56: dup 57: istore 7 59: ifeq 73 62: getstatic #9 // Field java/lang/System.out:Ljava/io/PrintStream 65: iload 7 67: invokevirtual #10 // Method java/io/PrintStream.print:(I)V
  • 55. • Difficult to debug when reflection and runtime class generation is involved • Obfuscated bytecodes are extremely difficult to debug
  • 56. FUN PROJECT The best way to learn Java bytecodes is to implement a Java disassembler on your own! For implementation, read the documentation of Java bytecodes (in the JVM specification) and use javap tool as the reference implementation.
  • 57. BOOKSTO READ Free download here: https://docs.oracle.com/javase/specs/jvms/se8/jvms8.pdf
  • 60. IMAGE CREDITS • https://pixabay.com/static/uploads/photo/2015/12/28/15/58/ferrari-1111582_960_720.jpg • http://i.dailymail.co.uk/i/pix/2014/08/29/article-0-0296355F000004B0-113_634x421.jpg • http://blogs.shell.com/climatechange/wp-content/uploads/2015/01/Check-under-the-hood.jpg • https://diaryofabusymumdotcom.files.wordpress.com/2015/01/1369952540_be029c8337.jpg • http://trentarthur.ca/wp-content/uploads/2013/05/gatsby.jpg • http://cdn.playbuzz.com/cdn/84b94651-08da-4191-9b45-069535cf523f/9c35f887-a6fc-4c8d-861a-f323078709e8.jpg • http://pad2.whstatic.com/images/thumb/5/54/Draw-a-Simple-Tree-Step-2.jpg/aid594851-728px-Draw-a-Simple-Tree-Step-2.jpg • http://www.seabreeze.com.au/Img/Photos/Windsurfing/5350271.jpg • https://d.gr-assets.com/hostedimages/1380222758ra/461081.gif • http://cdn.shopify.com/s/files/1/0021/6982/products/GW-7693274_large.jpg?v=1283553128 • http://www.fisher-price.com/en_IN/Images/RMA_RWD_rock_a_stack_tcm222-163387.jpg • http://www.njfamily.com/NJ-Family/January-2011/Learn-How-to-Spot-a-Learning-Disability/Boy-learning-disability.jpg • https://teens.drugabuse.gov/sites/default/files/styles/medium/public/NIDA-News-What-was-down-the-hole-Alice.jpg?itok=DH19L7F2 • http://archivedemo.cnx.org/resources/4df9b85136bb00ee04456b031aa0c344e54f282e/CNX_Psych_08_04_Knuckles.jpg • http://archivedemo.cnx.org/resources/4df9b85136bb00ee04456b031aa0c344e54f282e/CNX_Psych_08_04_Knuckles.jpg • http://www.urbanspaces.co.uk/image/error-message-error-us.jpg • http://conservationmagazine.org/wordpress/wp-content/uploads/2013/05/dig-deeper.jpg • http://4.bp.blogspot.com/-BAZm9rddEhQ/TWy441M-p1I/AAAAAAAAAQg/_SKF8PMkVHA/s1600/ mr%2Bfixit.tif%2B%2528Converted%2529--6.jpg