Minimal Stub for remote debugging Minheng Tan Columbia University.

Slides:



Advertisements
Similar presentations
GDB Improvements for Telecom System. GDBs Strengths, Today Primary debugger for Linux Used by Eclipse for C, C++ debugging –Eclipse communicates with.
Advertisements

System Integration and Performance
The Fetch – Execute Cycle
2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
© 2003 Xilinx, Inc. All Rights Reserved Debugging.
1BA3 G Lacey Lecture 51 Evaluating mathematical expressions  How do computers evaluate x + y or any mathematical expression ?  Answer : “Reverse Polish.
Presenter : Chien-Hung Chen Tsung-Cheng Lin Kuan-Fu Kuo EICE team Open On-Chip Debugger Ch6. Design and Architecture.
Debugging code with limited system resource. Minheng Tan Oct
Environment & tools Assistant Anssi Jääskeläinen Visiting hours: Tuesdays Room: 6606
Buffer overflows and various code injection methods Raghunathan Srinivasan CSE 539, 2/2/2011.
Chapter 4 H1 Assembly Language: Part 2. Direct instruction Contains the absolute address of the memory location it accesses. ld instruction:
Memory & Storage Architecture Seoul National University Computer Architecture “ Bomb Lab Hints” 2nd semester, 2014 Modified version : The original.
DEBUGGERS For CS302 Data Structures Course Slides prepared by TALHA OZ (most of the text is from
Debugger Presented by 李明璋 2012/05/08. The Definition of Bug –Part of the code which would result in an error, fault or malfunctioning of the program.
The Programming Interface. Main Points Creating and managing processes – fork, exec, wait Performing I/O – open, read, write, close Communicating between.
Chapter 2 Software Tools and Assembly Language Syntax.
Embedded Systems Principle of Debugger. Reference Materials kl.de/avr_projects/arm_projects/#winarmhttp://
Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Practical Malware Analysis Ch 8: Debugging Rev
Memory & Storage Architecture Seoul National University GDB commands Hyeon-gyu School of Computer Science and Engineering.
Slides created by: Professor Ian G. Harris Test and Debugging  Controllability and observability are required Controllability Ability to control sources.
Reporter: PCLee. Assertions in silicon help post-silicon debug by providing observability of internal properties within a system which are.
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
Instructor Notes GPU debugging is still immature, but being improved daily. You should definitely check to see the latest options available before giving.
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
1 Debugging: Catching Bugs ( II ) Ying Wu Electrical Engineering & Computer Science Northwestern University EECS 230 Lectures.
CSE 332: C++ debugging Why Debug a Program? When your program crashes –Finding out where it crashed –Examining program memory at that point When a bug.
Seminar of “Virtual Machines” Course Mohammad Mahdizadeh SM. University of Science and Technology Mazandaran-Babol January 2010.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
S OME USEFUL D EBUG C OMMANDS FOR C LEAR -S PEED S OFTWARE D EVELOPMENT K IT -- COMMANDS FROM CHAP.7 By: Pallav Laskar.
Application Debugging. Debugging methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic.
Georgia Institute of Technology Creating Classes part 2 Barb Ericson Georgia Institute of Technology June 2006.
Presenter : Shao-Chieh Hou 2012/8/27 Second ACM/IEEE International Symposium on Networks-on-Chip IEEE computer society.
Debugging 1/6/2016. Debugging 1/6/2016 Debugging  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a program.
Dale Roberts Debugger Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
Unit - V. Debugging GNU Debugger helps you in getting information about the following: 1.If a core dump happened, then what statement or expression did.
COP 3530 Spring 12 Discussion Session 1. Agenda 1.Introduction 2.Remote programming 3.Separate code 4.Compile -- g++,makefile 5.Debug -- gdb 6.Questions?
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
© 2002 IBM Corporation Confidential | Date | Other Information, if necessary Copyright © 2009 Ericsson, Made available under the Eclipse Public License.
Introduction Ken Ryall – Nokia Warren Paul – Nokia Daymon Rogers – Freescale John Cortell - Freescale.
CMSC 104, Version 8/061L14AssignmentOps.ppt Assignment Operators Topics Increment and Decrement Operators Assignment Operators Debugging Tips Reading Section.
Chapter 6 Programming l Problem solving l Debugging.
Evaluating the Fault Tolerance Capabilities of Embedded Systems via BDM M. Rebaudengo, M. Sonza Reorda Politecnico di Torino Dipartimento di Automatica.
Dale Roberts Debugger Dale Roberts, Lecturer Computer Science, IUPUI Department of Computer and Information Science, School.
The LC-3 – Chapter 6 COMP 2620 Dr. James Money COMP
CSCI 4061 Recitation 2 1.
Discussion on mp1.
Winter 2009 Tutorial #6 Arrays Part 2, Structures, Debugger
Tutorial 2 IDE of Keil for the ARM 7 board(2)
Dynamic Analysis ddaa.
Assembly Language Programming Part 3
Debugging with gdb gdb is the GNU debugger on our CS machines.
Malware Incident Response  Dynamic Analysis - 2
HP C/C++ Remote developer plug-in for Eclipse
Computer Architecture “Bomb Lab Hints”
Debuggers.
Programming Problem solving Debugging
Debugging Debug environments Debug via serial
Using a Debugger 1-Jan-19.
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science
GNU DEBUGGER TOOL. What is the GDB ? GNU Debugger It Works for several languages – including C/C++ [Assembly, Fortran,Go,Objective-C,Pascal]
When your program crashes
Tutorial: The Programming Interface
CSC235 - Visual Studio Tutorial
Reverse Engineering for CTFs
Kernel Tracing David Ferry, Chris Gill, Brian Kocoloski
Debugging.
Presentation transcript:

Minimal Stub for remote debugging Minheng Tan Columbia University

My project - debugger stub My GDBServer debugger stub. Runs on Red Hat Linux, x86 Provides minimum command support(but facilitates all debugging requirements) Speaks Remote Serial Protocol (RSP) over tcp/ip Debugs most applications running Linux.

Debuggers MSDev Windbg dbx gdb

Chip Machine A Remote Debugging Debugger Program Stub

Remote Debugging …continued Machine A Debugger Read register 3, Read memory at 0x338828, Write “CC” at 0x380280, Continue program.

Remote Debugging …continued Chip Program Stub Register 3 is 0x75939ff3, Memory content at 0x is 0x094833, Memory content written, Program resumed execution.

Remote Serial Protocol Request/Reply protocol ASCII encoding Packet based. Simple to parse, implement, extend. Runs on almost all communication medium

RSP commands implemented “g” – read all register “G” – write all register “m” – read memory from a memory at specific address “M” – write data to memory at specific address “?” – Get last signal(what happened to the program)

RSP commands implements…continued “s” – step the program. Make the debugged program execute 1 instruction and relinquish control. “c” – continue the program. Resume the debugged program and wait until it stop on a breakpoint, bus error, access violation, etc…

Implement read register buf = malloc (regset->size); res = ptrace (PTRACE_GETREGS, childpid, 0, buf);

Implement write register regset->fill_function (buf); res = ptrace (PTRACE_SETREGS, childpid, 0, (int) buf);

Implement read memory i = 0; while (startAddr <= endAddr) { buffer[i++] = ptrace(PTRACE_PEEKTEXT, childpid, startAddr, 0 ); startAddr+=sizeof(PTRACE_XFER_TYPE); }

Implement write memory i = 0; while ( startAddr <= endAddr ) { ptrace (PTRACE_POKETEXT, childpid, startAddr, buffer[i++]); StartAddr+=sizeof(PTRACE_XFER_TYPE); }

Implement Step/Continue ptrace (PTRACE_CONT, childpid, 1, 0); ptrace (PTRACE_SINGLESTEP, childpid, 1, 0);

Summary Minimum commands implemented Packet based remote serial protocol. Debugger uses the bare minimum stub to implement big things.