GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...GITS Indonesia
Pada Juli 2019, berlangsung GITS Class #16, workshop gratis dan terbuka untuk umum, di kantor GITS Indonesia. Farhan (DevOps di GITS Indonesia) membawakan materi tentang CI/CD menggunakan GitLab Runner.
Jangan sampai ketinggalan!
Follow akun GITS Indonesia untuk mendapatkan info terkait event seru selanjutnya!
Instagram: @gitsindonesia
Twitter: @gitsindonesia
Facebook: GITS Indonesia
Medium: GITS Apps Insight
YouTube: GITS Indonesia
LinkedIn: GITS Indonesia
Website: https://gits.id/
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...GITS Indonesia
Pada Juli 2019, berlangsung GITS Class #16, workshop gratis dan terbuka untuk umum, di kantor GITS Indonesia. Farhan (DevOps di GITS Indonesia) membawakan materi tentang CI/CD menggunakan GitLab Runner.
Jangan sampai ketinggalan!
Follow akun GITS Indonesia untuk mendapatkan info terkait event seru selanjutnya!
Instagram: @gitsindonesia
Twitter: @gitsindonesia
Facebook: GITS Indonesia
Medium: GITS Apps Insight
YouTube: GITS Indonesia
LinkedIn: GITS Indonesia
Website: https://gits.id/
I used these slides to present the benefits of using Kotlin to a group of people I work with. The presentation focuses on comparing Kotlin to Java, and in particular showing how Kotlin can help in writing safer, more concise and readable code. I used a few java gotchas/puzzles to demonstrate how Kotlin may prevent us from doing silly things.
New language from Google, static safe compiler, with GC and as fast as C++ or Java, syntax simpler then Python - 2 hour-long tutorial and you can start code.
In this talk Serhii will talk about Go, also known as Golang – an open source language developed at Google and used in production by companies such as Docker, Dropbox, Facebook and Google itself. Go is now heavily used as a general-purpose programming language that’s a pleasure to use and maintain. This introductory talk contains many live demos of basic language concepts, concurrency model, simple HTTP-based endpoint implementation and, of course, tests using build-in framework. This presentation will be interesting for backend engineers and DevOps to understand why Go had become so popular and how it might help to build robust and maintanable services.
Agenda of the presentation:
1. Go is not C, not Java, not anything
2. Rob Pike argument
3. Main ideas and basics
4. Concurrency model
5. Tools
6. Issues
Salesforce CI (Continuous Integration) - SFDX + Bitbucket PipelinesAbhinav Gupta
Exploring Salesforce Continous Integration options, with external and internal CI Tools like CircleCI, TravisCI, Bitbucket, Jenkins, and Gitlab.
What are the best practices when planning to go for CI in Salesforce, like
- Active Scratch Org Limit
- Which branches to pick for running CI scripts
- Cost and security of external vs internal tools.
- Branch Permissions
- Other hidden features like integrations, env variable, etc.
Introduction to kotlin and OOP in Kotlinvriddhigupta
Now that the Android Campaign has started, let’s make a few things clear
NO PREREQUISITES to attend the jams! Absolutely none. Just come with a curious mind and we will handle the rest ♂️♀️
The first study jam which will be conducted on 3rd December, Friday at 6.30 PM will cover half of Unit 1 which is about learning the Kotlin language
And finally, about making the application, we will be making it with you in the upcoming study jams so no matter how much of a beginner you are, you will have made something in the end!
I used these slides to present the benefits of using Kotlin to a group of people I work with. The presentation focuses on comparing Kotlin to Java, and in particular showing how Kotlin can help in writing safer, more concise and readable code. I used a few java gotchas/puzzles to demonstrate how Kotlin may prevent us from doing silly things.
New language from Google, static safe compiler, with GC and as fast as C++ or Java, syntax simpler then Python - 2 hour-long tutorial and you can start code.
In this talk Serhii will talk about Go, also known as Golang – an open source language developed at Google and used in production by companies such as Docker, Dropbox, Facebook and Google itself. Go is now heavily used as a general-purpose programming language that’s a pleasure to use and maintain. This introductory talk contains many live demos of basic language concepts, concurrency model, simple HTTP-based endpoint implementation and, of course, tests using build-in framework. This presentation will be interesting for backend engineers and DevOps to understand why Go had become so popular and how it might help to build robust and maintanable services.
Agenda of the presentation:
1. Go is not C, not Java, not anything
2. Rob Pike argument
3. Main ideas and basics
4. Concurrency model
5. Tools
6. Issues
Salesforce CI (Continuous Integration) - SFDX + Bitbucket PipelinesAbhinav Gupta
Exploring Salesforce Continous Integration options, with external and internal CI Tools like CircleCI, TravisCI, Bitbucket, Jenkins, and Gitlab.
What are the best practices when planning to go for CI in Salesforce, like
- Active Scratch Org Limit
- Which branches to pick for running CI scripts
- Cost and security of external vs internal tools.
- Branch Permissions
- Other hidden features like integrations, env variable, etc.
Introduction to kotlin and OOP in Kotlinvriddhigupta
Now that the Android Campaign has started, let’s make a few things clear
NO PREREQUISITES to attend the jams! Absolutely none. Just come with a curious mind and we will handle the rest ♂️♀️
The first study jam which will be conducted on 3rd December, Friday at 6.30 PM will cover half of Unit 1 which is about learning the Kotlin language
And finally, about making the application, we will be making it with you in the upcoming study jams so no matter how much of a beginner you are, you will have made something in the end!
When the debugging of modern software is required, basic GDB techniques are insufficient, but new techniques can be created from the nearly 160 commands available in GDB. "Modern software" refers to multi-threading, using STL and other libraries, IPC, signals and exception
mechanisms. In this lecture, techniques for debugging large, modern software written in C++ will be explained.
.NET Conf 2019 Tel-Aviv Israel
There are cases where bugs are discovered only after the product is shipped and used by the end-users. The main reason for these bugs that appear only in the production environment is the use of real user scenarios with real user data. Production debugging is about solving customer-facing issues that aren't easily reproducible in the development or testing environments. When it comes to a cloud-hosted application, production debugging becomes even harder. The code is running on multiple hosts, a business flow can span many services. A remote debugging session with the cloud is dangerous and may introduce side effects to the currently running software, such as performance degradation, interruption of service, and data correctness issues.
In this lecture, we will see how we can remote debug our cloud staging environment, and how we can use Visual Studio Snapshot debugger to set Snapshots and Log points in our production environment.
To get even more insights, the audience will see a revolutionary tool and approach for a collaborative production debugging – OzCode Debugging as a Service (DaaS), where the DevOps and the Dev team can solve production problems together!
You will learn:
1. The difficulties of debugging a modern cloud-hosted application
2. Methods and tools for capturing the state and debugging cloud-hosted services
When Good Code Goes Bad: Tools and Techniques for Troubleshooting PloneDavid Glick
Using real issues encountered in the wild, this session will help beginning integrators gain confidence in knowing what to do when Plone fails to behave as expected. Learn how to solve common problems like "My changes aren't taking effect" and "My Zope instance won't start," as well as how to use pdb to investigate more complex Python errors.
This talk is targeted at integrators who have some experience with Plone, but who are not confident in troubleshooting errors and other unexpected behavior. Knowledge of Python is not required, though at least a cursory familiarity with some programming language will make the talk more digestible.
The GNU Debugger, usually called just GDB it is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, C, C++, Objective-C, Free Pascal, Fortran, Java and partially others
GDB - a tough nut to crack: only a few bugs found by PVS-StudioPVS-Studio
GDB is a tool that is hard to live without. Of course, as Brooks says: "The quality in software development is achieved through proper design, not by endless testing". However, proper design doesn't protect from logical errors, typos, null pointers, and so on. That's why various debugging tools, like GDB, come to help. My aim is to show that static code analyzers are also very useful tools which help to detect errors at the early stages of development. It's much better if the bug is fixed in the code before the testing and debugging stage. To demonstrate the benefits of static code analysis, let's delve inside GDB and look for errors, using PVS-Studio.
Similar to Debugging Modern C++ Application with Gdb (20)
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
Debugging Modern C++ Application with Gdb
1.
2. GDB (GNU DEBUGGER)
senkumar@juniper.net
Debugging Modern C++ Application with
For a fish, the archer fish is known to shoot down bugs from low hanging plants by spitting water at them.
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
- Brian Kernighan
3. DISCLAIMER
The opinions expressed in this presentation and on the following
slides are solely those of the presenter. Neither the presenter
guarantee the accuracy or reliability of the information provided
herein.
May you do good and not evil. May you find forgiveness for yourself and forgive others. May you share freely, never taking more than you give!
8. WHAT IS?
Bug, Debug, Debugging, …
Coder: code
will produce
output X …
Computer:
code will
produce Z….
9. WHAT IS - BUG, DEBUG, DEBUGGING, …
Debugging is the process of finding and resolving defects
or problems within a computer program that prevent
correct operation of computer software or a system.
The terms "bug" and "debugging" are popularly
attributed to Admiral Grace Hopper in the 1940s.
On a Mark II computer at Harvard University, a moth stuck in a
relay and thereby impeding operation, whereupon she remarked
that they were "debugging" the system.
The term "bug", in the sense of "technical error", dates back at
least to 1878 andThomas Edison (see software bug for a full
discussion).
12. THE PRINCIPLES OF DEBUGGING
Debugging is an art rather than a science
There are definite principles that guide its practice.
The Essence of Debugging:The Principle of Confirmation
The Fundamental Principle of Confirmation
Fixing a buggy program is a process of confirming, one by one, that the many things
believed to be true about the code are actually true.
When one of the assumptions is not true, we have found a clue to the location (if not the
exact nature) of a bug.
13. THE PRINCIPLES
OF DEBUGGING
Smart Small
Use a top-down approach
Use a debugging tool to determine the
location of a segmentation fault
Determine the location of an infinite loop by
issuing an interrupt
Use binary search
14. WHY TO USE A TOOL TO
DEBUG?
What is the value of a DebuggingTool for the Principle of
Confirmation?
15. WHYTO USE ATOOLTO DEBUG -TO AVOID…
AddTracing
code
Recompile
Run
Analyze the
trace output
Fix issue
Remove
Tracing code
Whatisthevalueofa
DebuggingToolforthe
PrincipleofConfirmation?
16. WHAT TO EXPECT
OUT OF A DEBUG
TOOL?
What is the value of a DebuggingTool for the Principle of Confirmation?
19. Debuggers are programs which allow you to
execute your program in a controlled manner,
so you can look inside your program to find a
bug.
Tools that can examine the state of a running
program.
Debuggers allow for more fine-tuned control,
and don’t force you to repeatedly re-compile
your code every time you want to test
something new
Common debuggers: adb, dbx, gdb, kdb, wdb,
xdb, pdb, ...
DEBUGGERS
It’s not a tool to remove bugs!
20. WHAT IS GDB?
GDB is the GNU Project debugger
Richard Stallman was the original author of gdb
GDB can be used to debug programs written in C, C++.
gdb is a reasonably sophisticated text-based debugger.
Start your program, specifying anything that might affect its behavior.
Make your program stop on specified conditions.
Examine what has happened, when your program has stopped.
Change things in your program, so you can experiment with correcting the effects
of one bug and go on to learn about another.
21. WHYTO LEARN GDB?
Despite its age, gdb remains an amazingly
versatile and flexible tool
Mastering it can save you huge amounts of
time when trying to debug problems in your
code.
22. USAGE
Usage
gdb [prog] [core | procID]
GDB is invoked by running the program gdb.
Once the debugger is started, GDB reads command until you tell it to exit.
To exit gdb: quit
GDB can be started with variety of arguments and options.
gdb program – one argument, which is an executable file more than
one arguments can be provided
gdb program core – two arguments, one executable and one core
file
gdb program 1234 – specify process id as second argument
23. Help from the compiler
Dwarf debug info: type system and
calling conventions
Help from the CPU
watchpoint and instruction-level step-
by-step
Help from the OS
... the rest (access to the
memory/registers + scheduler)
BEHINDTHE SCENE
24. COMPILING FOR DEBUGGING
In order to debug a program effectively, you need to
generate debugging information when you compile
it.
Debugging information is stored in the object file; it
describes the data type of each variable or function
and the correspondence between source line
numbers and addresses in the executable code.
With gcc and g++, this is accomplished using the -g
option.
This option tells the compiler to insert more information
about data types, etc., so the debugger gets a better
understanding of it.
25. The .gdinit file is the initialization file for gdb.
Contain GDB commands to automatically
execute during GDB startup
~/.gdbinit - User initialization file.
It is executed unless user specifiedGDB options -
nx, -n or -nh.
./.gdbinit - Initialization file for current directory.
It may need to be enabled with GDB security
command set auto-load local-gdbinit.
.GDBINIT
26. STARTING GDB…
Starting GDB: gdb
Loading the symbol table:
file my_prog
my_prog is executable file name!
Exit GDB: quit
Executing shell commands: shell command args
Compiling within gdb
Make is a special case: make args
Start GDB and load the symbol
table in one step:
gdb my_prog
27. GDB COMMAND SHORT-HANDS
Command names may be truncated if the abbreviation is unambiguous: s (for
step), r (for run)
UNIX styleTAB completion for the command names.
Alternative way: complete chars.
Eg.: complete h results in: handle
hbreak
help
Getting help:
help (or h) – lists all classes of commands.
h command - displays a short description of the command
28. RUNNING A PROGRAM
When gdb starts, the program is not actually running.
It won't run until it is instructed.
run (or r) -- creates an inferior process that runs your program.
If there are no execution errors the program will finish and results will be displayed
In case of error, the GDB will show:
The line the program has stopped on and
A short description of what it believes has caused the error
Redirecting output: run > outfile direct the output to the file outfile.
"Inferior" is a general term to mean "something that you are using gdb to debug" -- generally a
process or perhaps a kernel running on an emulator or on some other piece of hardware connected
on a serial line.
29. SPECIFYING ARGUMENTS
As arguments to run: run arg1 arg2 …
With set args command: set args arg1 arg2 …
run without arguments uses the same arguments used by the previous run.
set args without arguments – removes all arguments.
show args command shows the arguments your program has been started
with.
30. DEBUGGING AN ALREADY-RUNNING PROCESS
From inside GDB: attach process-id
Tip: UNIX command ps can be used to obtain the process id
From outside GDB: gdb my_prog process-id
The first thing GDB does after arranging to debug the
specified process is to stop it.
detach – detaches the currently attached process from
the GDB control.
Detached process continues its own execution.
31. KILLINGTHE INFERIOR PROCESS
Kill - Kill the child process in which your program
is running under gdb.
Useful if you wish to recompile and relink your
program, since on many systems it is impossible to
modify an executable file while it is running in a
process.
In this case, when you next type run, gdb notices
that the file has changed, and reads the symbol
table again (while trying to preserve your current
breakpoint settings).
32. BREAKPOINT
A break point makes your program stop whenever a certain point in the
program is reached
Ways to set a break point
break function - Set a breakpoint at entry to function function
break offset - Sets a breakpoint some number of lines forward or back from the
position at which execution stopped.
break line-num - Sets a breakpoint at line line number in the current source file
break filename:function - Sets a breakpoint at entry to function function found in
file filename. Specifying a file name as well as a function name is superfluous except
when multiple files contain similarly named functions.
info break - Prints a table of all breakpoints set and not deleted
33. WATCHPOINT
A watch point is a special breakpoint that stops
your program when the value of an expression
changes
Ways to set a watch point
watch expr - Sets a watchpoint for an expression.
info watchpoints - Prints a table of all watch points
set and not deleted
34. ELIMINATE - BREAKPOINTS ANDWATCHPOINTS
Eliminate a breakpoint or watchpoint once it has done its job and you no longer
want your program to stop there.
Based on Location
clear - Delete any breakpoints at the next
instruction to be executed in the selected
stack frame.
clear function, clear filename:function -
Delete any breakpoints set at entry to
the function function.
clear linenum, clear filename:linenum -
Delete any breakpoints set at or within
the code of the specified line.
Based on number
delete [breakpoints] [range...] -
Delete the breakpoints or
watchpoints of the breakpoint
ranges specified as arguments.
If no argument is specified, delete all
breakpoints
35. EXAMININGVARIABLES
Global variables can be examined from every point in the source file.
Local variables – can be examined only in their scope or using:
var - file::variable or function::variable
The variable type: ptype var
Current value: print var
Automatic display:
display var - adds var to the automatic display list.
undisplay dnum - Removes var from the automatic display list.
Specifying the output format (x, o, d, u, t, a, f, and c) :
print /t var - prints the value of var in binary format
36. STEPPINGTHROUGHTHE PROGRAM
step [count] – program execution continue to
next source line going into function calls.
next [count] – program execution continue to
the next source line omitting function calls.
continue [ignore-count] – resume program execution
ignore-count allows you to specify a further number of times to
ignore a breakpoint at this location
until – continue until the next source line in the current stack
frame is reached.
useful to exit from loops
count - times
step into function; next statement
37.
38. ALTERING EXECUTION
Returning from a function
finish - forced return
return [ret_value] – pops the current stack frame
Continuing at different address: jump line_num|*address
Altering the value of a variable: set <var> = <value>
Proceeding to a specified point: until [line_num|*address |function_name]
call <function(args)> – Invokes the function
39. Stack
frames are
identified
by their
addresses,
which are
kept in the
frame
pointer
register.
Selecting a
frame:
frame
n|addr
up n
down n
Information
about the
current
frame:
frame -
brief
description
info args -
shows
function
arguments
info locals -
shows local
variables
THE STACK FRAME
40. CONVENIENCEVARIABLES
Automatically created convenience variables
$pc – program
counter
$sp – stack pointer $fp – frame pointer
$ps – processor
status
$_ - contains the
last examined
address
$__ - the value in
the last examined
address
$_exitcode - the
exit code of the
debugged program
Convenience variables are used to store values that you may want to refer later.
Any string preceded by $ is regarded as a convenience variable.
Eg.: $table = *table_ptr
41. The x command (for “examine”):
x/nfu addr – specify the number of units (n),
the display format (f) and the unit size (u) of
the memory you want to examine, starting
from the address addr. Unit size can be – b,
h (half), w and g (giant).
x addr – start printing from the address
addr, others default
EXAMINING MEMORY
42. REGISTERS
Registers names are different for each
machine.
Use info registers to see the names used on
your machine.
info all-registers - Print the names and
values of all registers, including floating-
point and vector registers (in the selected
stack frame).
GDB has four
“standard” registers
names that are
available on most
machines:
Program counter - $pc
Stack pointer - $sp
Frame pointer - $fp
Processor status - $ps
43. info proc – summarize
available information about
the current process.
info proc mappings –
address range accessible in
the program.
info proc times – starting
time, user CPU time and
system CPU time for your
program and its children.
info signals – information
about the system signals
and how GDB handles them.
ADDITIONAL PROCESS INFORMATION
44. THREADS
info threads - Lists all active threads
thread <Thread Number> - Switching between threads while debugging
(gdb) info threads
Id Target Id Frame
4 Thread 0x7ffff6fc3700 (LWP 2281) "sample" 0x00007ffff73c34fd in write () at
../sysdeps/unix/syscall-template.S:81
3 Thread 0x7ffff67c2700 (LWP 2282) "sample" __lll_lock_wait_private () at
../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
2 Thread 0x7ffff5fc1700 (LWP 2283) "sample" __lll_lock_wait_private () at
../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
* 1 Thread 0x7ffff7fd0740 (LWP 2277) "sample" __lll_lock_wait_private () at
../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
45. THREADS
thread apply all bt - Checking Stack trace of all the threads
The command “thread apply“ applies the specified command to specified
thread ID.
Specify “all” instead of thread ID to apply the command to all threads.
To display the stack trace of current thread only use command “bt” i.e.
(gdb) bt
#0 __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1 0x00007ffff733bb1a in __GI__IO_fwrite (buf=0x7ffff7692970 , size=1, count=11, fp=0xffffffffffffffff) at
iofwrite.c:41
#2 0x00007ffff7b63a66 in std::basic_ostream<char, std::char_traits >& std::__ostream_insert<char,
std::char_traits >(std::basic_ostream<char, std::char_traits >&, char const*, long) () from /usr/lib/x86_64-
linux-gnu/libstdc++.so.6
#3 0x00007ffff7b63e77 in std::basic_ostream<char, std::char_traits >& std::operator<< <std::char_traits
>(std::basic_ostream<char, std::char_traits >&, char const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x000000000040104f in main () at sample.cpp:23
46. POSTMORTEM DEBUGGING – CORE
A core file or core dump is a file that records the memory image of a running process
and its process status (register values etc.).
Its primary use is post-mortem debugging of a program that crashed while it ran outside a
debugger.
A program that crashes automatically produces a core file, unless this feature is disabled by
the user.
Occasionally, you may wish to produce a core file of the program you are debugging in
order to preserve a snapshot of its state.
gdb has a special command for that generate-core-file.
gcore [file]
Produce a core dump of the inferior process.The optional argument file specifies
the file name where to put the core dump. If not specified, the file name defaults to ‘core.pid’,
where pid is the inferior process ID.
47. STL CONTAINERS
Pretty-printers in Python (Yes gdb support automation with python)
pretty-printers in the libstdc++ svn repository
Check-out the latest Python libstdc++ printers to a place on your machine. In a
local directory, do:
svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
Add the following to your ~/.gdbinit.
python
import sys
sys.path.insert(0, '/home/user_name/gdb_printers/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
48. info pretty-printer – Shows the
loaded pretty printers
print *(iter._M_current) -To display
the item the iterator points at
STL CONTAINERS
50. SMART POINTERS
By default, if we print a std::shared_ptr variable
”foo_h", we could see the contents that the ”foo_h" is
pointing to:
(gdb) print foo_h
$1 = std::shared_ptr (count 1, weak 0) 0x7f2ba8002740
(gdb) print (*foo_h._M_ptr) - which would print
the contents
51. REMOTE DEBUGGING WITH GDBSERVER
On platforms where gdbserver is supported, it is possible to use this tool to
debug your application remotely.
Useful in situations where the program needs to be run on a target host that is
different from the host used for development
$ gdbserver localhost:4444 program
Process program created; pid = 5685
Listening on port 4444
$ gdbserver localhost:4444 –attach 5685
Process program created; pid = 5685
Listening on port 4444
Target
• $ gdb program
• (gdb) target remote targethost:4444
• Remote debugging using targethost:4444
• (gdb)
Host (Development)
56. USEFUL GDB MACROS - STL
gdb-stl-views is a set of GDB macros that can
display the contents of many STL containers.
source {full_path}stl-views-1.0.3.gdb – Load gdb macros
std::vector<T> -- via pvector command
std::list<T> -- via plist or plist_member command
std::map<T,T> -- via pmap or pmap_member command
std::multimap<T,T> -- via pmap or pmap_member command
std::set<T> -- via pset command
std::multiset<T> -- via pset command
std::deque<T> -- via pdequeue command
std::stack<T> -- via pstack command
std::queue<T> -- via pqueue command
std::priority_queue<T> -- via ppqueue command
std::bitset<n> -- via pbitset command
std::string -- via pstring command
std::widestring -- via pwstring command
Download - https://sourceware.org/gdb/wiki/STLSupport?action=AttachFile&do=get&target=stl-views-1.0.3.gdb
57. GDBTIPS ANDTRICKS
break +line-num - Break Into A Line Which Is RelativeToThe Current Line
break * memory address - Break upon matching memory address
backtrace or info stack - Print backtrace AfterThe breakpoint or at a crash
finish - Execute a functionToThe end after a breakpoint
frame - Print the line number in while debugging
call <function> - Calling functions while debugging
58. GDBTIPS ANDTRICKS
macro expand <macro(args)> - Expand the macro (Need –E option during
build)
Debugging a process that call fork system call, you want to continue with the
child or the parent
set follow-fork-mode child/parent
set detach-on-fork on
Debugging a multithreaded application - while a breakpoint hits, the debugger
will freeze all the threads.
set non-stop on – Let other threads run
59. GDBTIPS ANDTRICKS
info locals -View all local variables
list -- view source
rbreak -- break on function matching regular expression
set print object on for polymorphic elements
60. GDB AND REVERSE DEBUGGING
reverse-continue ('rc') - Continue program being debugged but run it in reverse
reverse-finish- Execute backward until just before the selected stack frame is called
reverse-next ('rn’) - Step program backward, proceeding through subroutine calls.
reverse-nexti ('rni') - Step backward one instruction, but proceed through called
subroutines.
reverse-step ('rs') - Step program backward until it reaches the beginning of a
previous source line
reverse-stepi - Step backward exactly one instruction
set exec-direction (forward/reverse) - Set direction of execution.
63. GDB QUICK REFEREN CE G D B Version 4
Essential Commands
gdb program [core] debug program [using coredump core]
b [file:]function
run [arglist]
bt
p expr
c
n
s
set breakpoint at function [in file]
start your program [with arglist]
backtrace: display program stack
display the value of an expression
continue running your program
next line, stepping over function calls
next line, stepping into function calls
Starting G DB
gdb
gdb program
gdb program core
gdb --help
start GDB, with no debugging ftles
begin debugging program
debug coredump core produced by
program
describe command line options
exit GDB; also q or EOF(eg C-d)
Stopping G DB
quit
INTERRUPT (eg C-c) terminate current command, or
send to running process
Getting Help
help
help class
help command
list classes of commands
one-line descriptions for commands in
class
describe command
Executing your Program
run arglist
run
run . . . <inf >outf
k i l l
start your program with arglist
start your program with current argument
list
start your program with input, output
redirected
kill running program
t t y dev
s et args arglist
s et args
show args
use dev as stdin and stdout for next run
specify arglist for next run
specify empty argument list
display argument list
show env
show env var
s et env var string
unset env var
show all environment variables
show value of environment variable var
set environment variable var
remove var from environment
Shell Commands
cd dir
pwd
make . . .
shell cmd
change working directory to dir
Print working directory
call “make”
execute arbitrary shell command string
[ ] surround optional arguments . . . show one or more arguments
§c1998 Free Software Foundation, Inc. Permissions on back
Breakpoints and Watchpoints
set breakpoint at line number [in file]
eg: break main.c:37
set breakpoint at func [in file]
set break at offset lines from current stop
break [file:]line
b [file:]line
break [file:]func
break +offset
break -offset
break *addr
break
break . . . i f expr
cond n [expr]
tbreak . . .
rbreak regex
watch expr
catch event
info break
info watch
set breakpoint at address addr
set breakpoint at next instruction
break conditionally on nonzero expr
new conditional expression on breakpoint
n; make unconditional if no expr
temporary break; disable when reached
break on all functions matching regex
set a watchpoint for expression expr
break at event, which may be catch,
throw, exec, fork, vfork, load, or
unload.
show deftned breakpoints
show deftned watchpoints
clear
clear [file:]fun
clear [file:]line
delete [n]
disable [n]
enable [n]
enable once [n]
enable del [n]
ignore n count
delete breakpoints at next instruction
delete breakpoints at entry to fun()
delete breakpoints on source line
delete breakpoints [or breakpoint n]
disable breakpoints [or breakpoint n]
enable breakpoints [or breakpoint n]
enable breakpoints [or breakpoint n];
disable again when reached
enable breakpoints [or breakpoint n];
delete when reached
ignore breakpoint n, count times
commands n
[silent]
command-list
execute GDB command-list every time
end
breakpoint n is reached. [silent
suppresses default display]
end of command-list
print trace of all frames in stack; or of n
frames—innermost if n>0, outermost if
n<0
select frame number n or frame at address
n; if no n, display current frame
select frame n frames up
select frame n frames down
describe selected frame, or frame at addr
arguments of selected frame
Program Stack
backtrace [n]
bt [n]
frame [n]
up n
down n
info frame [addr]
info args
info locals
info reg [rn]. ..
info all-r eg [rn]
local variables of selected frame register
values [for regs rn] in selected
frame; all-r eg includes floating point
Execution Control
continue running; if count specifted, ignore
this breakpoint next count times
execute until another line reached; repeat
count times if specifted
step by machine instructions rather than
source lines
execute next line, including any function
calls
next machine instruction rather than
source line
run until next instruction (or location)
run until selected stack frame returns
continue [count]
c [count]
step [count]
s [count]
stepi [count]
s i [count]
next [count]
n [count]
nexti [count]
ni [count]
u n til [location]
finish
return [expr] pop selected stack frame without
signal num
jump line
jump *address
s et var=expr
executing [setting return value]
resume execution with signal s (none if 0)
resume execution at specifted line number
or address
evaluate expr without displaying it; use
for altering program variables
Display
print [/f ] [expr]
p [/f ][expr]
x
d
u
o
t
a
c
f
c a ll [/f ] expr
x [/Nuf ] expr
N
u
f
disassem [addr]
show value of expr [or last value $]
according to format f:
hexadecimal
signed decimal
unsigned decimal
octal
binary
address, absolute and relative
character
floating point
like print but does not display void
examine memory at address expr; optional
format spec follows slash
count of how many units to display
unit size; one of
b individual bytes
h halfwords (two bytes)
wwords (four bytes)
g giant words (eight bytes)
printing format. Any print format, or
s null-terminated string
i machine instructions
display memory as machine instructions
Automatic Display
display [/f ] expr show value of expr each time program
stops [according to format f ]
display
undisplay n
disable disp n
enable disp n
info display
display all enabled expressions on list
remove number(s) n from list of
automatically displayed expressions
disable display for expression(s) number n
enable display for expression(s) number n
numbered list of display expressions
64. Expressions
expr
addr@len
file: : nm
{type}addr
$
$n
$$
$$n
$
$
$var
an expression in C, C + + , or Modula-2
(including function calls), or:
an array of len elements beginning at
addr
a variable or function nm deftned in file
read memory at addr as specifted type
most recent displayed value
nth displayed value
displayed value previous to $
nth displayed value back from $
last address examined with x
value at address $
convenience variable; assign any value
show values [n]
show conv
show last 10 values [or surrounding $n]
display all convenience variables
Symbol Table
info address s
info func [regex]
info var [regex]
whatis [expr]
ptype [expr]
ptype type
show where symbol s is stored
show names, types of deftned functions
(all, or matching regex)
show names, types of global variables (all,
or matching regex)
show data type of expr [or $] without
evaluating; ptype gives more detail
describe type, struct, union, or enum
GDB Scripts
source script read, execute GDB commands from ftle
script
define cmd
command-list
end
document cmd
help-text
end
create new GDB command cmd; execute
script deftned by command-list
end of command-list
create online documentation for new GDB
command cmd
end of help-text
Signals
handle signal act
print
noprint
stop
nostop
pass
nopass
info signals
specify GDB actions for signal:
announce signal
be silent for signal
halt execution on signal
do not halt execution
allow your program to handle signal
do not allow your program to see signal
show table of signals, GDB action for each
Debugging Targets
target type param connect to target machine, process, or ftle
help target
attach param
detach
display available targets
connect to another process
release target from GDB control
Controlling G DB
s et param value
show param
set one of GDB’s internal parameters
display current setting of parameter
Parameters understood by s et and show:
complaint limit
confirm on/off
editing on/off
height lpp
language lang
li s t s i z e n
prompt str
radix base
verbose on/off
width cpl
write on/off
number of messages on unusual symbols
enable or disable cautionary queries control
readline command-line editing number of
lines before pause in display Language for
GDB expressions (auto, c or
modula-2)
number of lines shown by l i s t
use str as GDB prompt
octal, decimal, or hex number
representation
control messages when loading symbols
number of characters before line folded
Allow or forbid patching binary, core ftles
(when reopened with exec or core)
groups with the following options:history . ..
h . ..
h exp off/on
h f i l e filename
h size size
h save off/on
print . ..
p . ..
disable/enable readline history expansion
ftle for recording GDB command history
number of commands kept in history list
control use of external ftle for command
history
groups with the following options:
p address on/off print memory addresses in stacks, values p
array off/on compact or attractive format for arrays p
demangl on/off source (demangled) or internal form for
C + + symbols
p asm-dem on/off demangle C + + symbols in machine-
instruction output
p elements limit number of array elements to display
p object on/off
p pretty off/on
p union on/off
p vtbl off/on
print C + + derived types for objects
struct display: compact or indented
display of union members
display of C + + virtual function tables
show commands
show commands n
show commands +
show last 10 commands
show 10 commands around number n
show next 10 commands
Working Files
f i l e [file]
core [file]
exec [file]
symbol [file]
load file
add-sym file addr
info f i le s
path dirs
show path
info share
use file for both symbols and executable;
with no arg, discard both
read file as coredump; or discard
use file as executable only; or discard
use symbol table from file; or discard
dynamically link file and add its symbols
read additional symbols from file,
dynamically loaded at addr
display working ftles and targets in use
add dirs to front of path searched for
executable and symbol ftles
display executable and symbol ftle path
list names of shared libraries currently
loaded
Source Files
d ir names
d ir
show d ir
add directory names to front of source
path
clear source path
show current source path
l i s t
l i s t -
l i s t lines
[file:]num
[file: ]function
+off
-off
*address
l i s t f,l
info line num
info source
info sources
forw regex
rev regex
show next ten lines of source
show previous ten lines
display source surrounding lines, specifted
as:
line number [in named ftle]
beginning of function [in named ftle]
off lines after last printed
off lines previous to last printed
line containing address
from line f to line l
show starting, ending addresses of
compiled code for source line num
show name of current source ftle
list all source ftles in use
search following source lines for regex
search preceding source lines for regex
G DB under GNU Emacs
M-x gdb
C-h m
M-s
M-n
M-i
C-c C-f
M-c
M-u
M-d
C-x &
C-x SPC
run GDB under Emacs
describe GDB mode
step one line (step)
next line (next)
step one instruction (stepi)
ftnish current stack frame (finish)
continue (cont)
up arg frames (up)
down arg frames (down)
copy number from point, insert at end
(in source ftle) set break at point
G DB License
show copying
show warranty
Display GNU General Public License
There is NO W ARRANTY for GDB.
Display full no-warranty statement.
Copyright §c 1991, ’92, ’93, ’98 Free Software Foundation, Inc.
Rol a nd H. Pesch
The author assumes no responsibility for any errors on this card.
This card ma y b e freely distribut ed under t he t er ms of t he G N U
General Public License.
Please contribute t o development of this card by annotating it.
Improvements can b e sent t o bug-gdb@gnu.org.
G D B itself is free software; you are welcome t o distribute copies of it
under t he t er ms of t he G N U General Public License. There is
absolutely no warranty for G D B.
66. ITS ALLYOURS!!
Thank you…
Enjoy the Journey as importantly as the Destination itself!!
SenthilKumar Selvaraj
senkumar@juniper.net
https://www.linkedin.com/in/tiruppursenthil
http://randomstufforganized.wordpress.com/