Version en ligne

Shinseki No Ko To O Tomari Dakara De Na Na

Table des matières

Déboguer son programme avec GDB
Démarrer une session GDB
Exécuter le programme
Placer des points d'arrêt
Contrôler l'état des variables et registres
Contrôler le déroulement de l'exécution
Un petit exemple

Déboguer son programme avec GDB

Démarrer une session GDB

Ah, la programmation ! Qui ne s'est jamais débattu pendant des heures avec des plantages biscornus et impossibles à cerner ? Qui ne s'est jamais retrouvé obligé de remplir son code d'instructions de "debug", affichant ici et là diverses variables, histoire de pouvoir s'assurer de leur contenu ? Que serait la vie d'un développeur sans ce temps perdu, passé à maudire de tous les noms (et de toutes les onomatopées) les messages de plantage déversés par un programme un peu trop fougueux ?

Heureusement, il existe de nombreux logiciels dits de "debugging". Je vous propose, parmi la flopée de prétendants, de nous lancer dans la conquête de GDB, le debogueur de GNU.

GDB est portable, il fonctionne donc aussi bien sur UNIX/Linux que sur Windows ou sur MacOS. Ce tutoriel a été développé sous Linux.

Démarrer une session GDB

Exécuter le programme

Installation

Sous Linux/Unix

GDB est disponible dans la plupart des dépôts et peut également être téléchargé directement sur le site officiel.

Si vous ne savez pas comment installer un programme depuis les dépôts, référez-vous au tutoriel du site, dans la partie Linux : "Installer des programmes avec apt-get".

Si GDB n'est pas dans vos dépôts, téléchargez les sources de la dernière version et compilez-les. Ça devrait se faire facilement, je vous donne les étapes principales, si vous rencontrez un problème référez-vous au site de votre distribution pour trouver comment compiler (rem. remplacez les X.X par les numéros de la dernière version stable) :

wget http://ftp.gnu.org/gnu/gdb/gdb-X.X.tar.gz
tar -xvvf gdb-X.X.tar.gz
cd gdb-X.X.tar.gz
./configure
make
make install

Lancement d'une session

GDB fonctionne sur le principe d'une invite de commandes. Pour démarrer une session, on lance simplement GDB en lui passant éventuellement des paramètres. Le moyen le plus courant de démarrer une session est de préciser l'exécutable qu'on veut débugger en paramètre :

gdb program

Lorsqu'un programme plante, vous avez certainement déjà lu "(core dumped)". Cela signifie en fait que le système a enregistré dans un fichier une copie de ce qui se trouvait en mémoire au moment du plantage (la zone du programme qui a planté uniquement). C'est parfois utile pour faire des vérifications, mais ce n'est pas simple et donc nous n'en parlerons pas ici. Cependant, sachez que GDB permet de spécifier le nom de ce fichier comme second argument :

gdb program dumpfile

Parfois on souhaite déboguer un exécutable qui est déjà lancé, ce qu'on peut faire en précisant en second paramètre l'identifiant du processus. En général pour voir la liste des processus lancés, on utilise la commande ps (lisez la page man pour plus d'informations). Attention cependant, il ne doit pas y avoir de fichier portant le même nom que l'id du processus, sinon GDB va utiliser ce fichier comme fichier de dump au lieu de se référer au processus (ce qui peut avoir des effets désastreux).

gdb program 1234

Lorsque vous lancez GDB, il commence par vous afficher quelques informations légales. Vous pouvez préciser de ne pas afficher ces informations avec le paramètre -silent (ou -quiet ou encore -q) :

gdb program -silent

Une fois que vous avez lancé GDB, vous devez entrer des commandes pour lui indiquer quoi faire. D'ailleurs, GDB ne lance pas l'exécution du programme tant que vous ne le lui indiquez pas. Une ligne de commande GDB commence par le nom de la commande, qui peut être suivi par des paramètres. Si vous validez une ligne blanche, GDB répète la commande précédente. Vous pouvez également utiliser des abréviations au lieu des noms complets des commandes. Vous pouvez également placer des commentaires, ceux-ci commencent par # et se terminent à la fin de la ligne (donc marquent la fin de la commande).

$gdb program -q
(gdb) command params #comment
...

Comme dans un terminal, vous pouvez utiliser l'auto-complétion avec la touche TAB.

Obtenir de l'aide sur une commande

Vous pouvez obtenir des informations sur les commandes grâce à "help" (abr. "h"). Si vous ne précisez pas la commande, GDB affiche les catégories de commandes disponibles. De même, si vous précisez une catégorie de commandes, GDB vous affichera la liste des commandes. Enfin, si vous précisez une commande ou son abréviation, GDB vous affichera les informations la concernant.

$gdb -q
(gdb) help
List of classes of commands:
 
aliases -- Aliases of other commands
breakpoints -- Making program stop at certain points
data -- Examining data
files -- Specifying and examining files
internals -- Maintenance commands
obscure -- Obscure features
running -- Running the program
stack -- Examining the stack
status -- Status inquiries
support -- Support facilities
tracepoints -- Tracing of program execution without stopping the program
user-defined -- User-defined commands
 
Type "help" followed by a class name for a list of commands in that class.
Type "help all" for the list of all commands.
Type "help" followed by command name for full documentation.
Type "apropos word" to search for commands related to "word".
Command name abbreviations are allowed if unambiguous.

Comme indiqué, vous pouvez également utiliser "help all" pour obtenir la liste des toutes les commandes (classées par catégories).

Pour effectuer une recherche dans l'aide, il suffit d'utiliser la commande "apropos" qui prend comme paramètre une chaine à rechercher :

(gdb) apropos exit
q -- Exit gdb
quit -- Exit gdb
set history save -- Set saving of the history record on exit
show history save -- Show saving of the history record on exit

Exécuter le programme

Exécuter le programme

Démarrer une session GDB Placer des points d'arrêt

Maintenant que nous avons quelques bases, il est temps de nous lancer dans le véritable travail du débogueur.

Compiler avec les informations de débogage

Pour déboguer un programme, il est nécessaire de pouvoir obtenir certaines informations le concernant, comme le nom et le type des variables, ainsi que les numéros de lignes correspondant aux instructions. Pour pouvoir les obtenir, on doit le préciser lors de la compilation. La plupart du temps, il s'agit de l'option "-g", cependant, vous devriez vérifier dans la documentation de votre compilateur.

GCC et NASM, par exemple, permettent de compiler avec les informations de débogage :

$ g++ -g myprogram.cpp
$ nasm -g myprogram.asm

Lancer l'exécution

Il est temps de passer à la phase qui nous intéresse, l'exécution du programme. Rien de plus simple, il s'agit de la commande "run" (abr. "r"). Vous pouvez lui passer autant de paramètres que vous le souhaitez, ils seront simplement passés comme paramètres au programme exécuté.

(gdb) run args
...
(gdb)

Le programme s'exécute alors normalement, jusqu'à ce qu'il se termine. Dès qu'il a fini de s'exécuter, ou lorsqu'il rencontre une erreur, vous revenez à l'invite de commandes de gdb. Il existe une autre commande pour lancer le programme : "start", qui contrairement à "run", place un point d'arrêt (breakpoint) à l'entrée du programme. Pour un programme réalisé en C par exemple, ce point d'arrêt sera placé à l'endroit du main().
Il est important de noter que le point d'entrée n'est pas toujours la première chose exécutée dans un programme. En C++, les constructeurs d'objets globaux et statiques sont appelés avant le main(), dans une phase dite "d'élaboration". Nous verrons plus tard comment placer des points d'arrêt précis.
Comme pour "run", vous pouvez spécifier les paramètres du programme.

(gdb) start args
...
(gdb)

Contexte d'exécution

Lorsque vous démarrez un programme, il hérite de certaines propriétés : les variables d'environnement, les arguments de ligne de commande, et le dossier courant.
Le dossier courant, c'est le dossier dans lequel vous exécutez le programme. Il est utilisé par exemple lorsque vous ouvrez un fichier sans préciser de chemin, le programme regarde alors dans ce répertoire courant.
Les arguments de ligne de commande, c'est ce que vous ajoutez après le nom de l'exécutable pour le lancer (ex : "$ g++ monfichier.cpp", g++ est le nom de l'exécutable, et "monfichier.cpp" est un argument).
Enfin, les variables d'environnement sont des variables globales, accessibles par tous les programmes. On y retrouve par exemple la variable PATH, qui donne des chemins vers les répertoires où chercher les exécutables (par exemple, lorsque vous lancez "$ g++", le programme gcc se trouve dans un de ces répertoires).

L'ensemble de ces paramètres est appelé le "contexte d'exécution" d'un programme. Et bien entendu, vous pourriez avoir besoin (ou juste une folle envie) de modifier ces paramètres. GDB propose donc des commandes pour y accéder.

(gdb) show args
Affiche la ligne d'arguments actuelle du programme.

(gdb) set args arguments
Règle la ligne d'arguments à "arguments" (vous pouvez aussi passer les arguments comme paramètres à start ou run).

(gdb) show environment [variable]
ou (gdb) show env(gdb) show env [variable]
Affiche les variables d'environnement. Si vous précisez un nom de variable (ex : PATH), seule cette variable est affichée.
Vous pouvez aussi utiliser "(gdb) show paths" pour afficher la variable PATH.

(gdb) set environment variable [=value]
(gdb) set env(gdb) set env variable [=value]
Règle la valeur d'une variable "variable" à "value". Si vous ne donnez pas de valeur, celle-ci sera une chaîne vide.
Vous pouvez aussi utiliser "(gdb) path [newpath]" pour ajouter newpath à la liste des répertoires d'exécutables.

(gdb) unset environment variable
(gdb) unset env(gdb) unset env variable
Supprime la variable d'environnement "variable" (son contenu ne devient même pas une chaine vide, elle est complètement supprimée de la liste).

(gdb) pwd
Affiche le répertoire courant.

(gdb) cd directory
Règle le répertoire courant à "directory".

Les entrées et sorties

Si votre programme utilise les entrées et sorties standards, les opérations d'entrée et de sortie seront effectuées dans le même terminal que GDB. Vous pouvez, pour plus de clarté par exemple, changer le terminal du programme exécuté.

Vous pouvez savoir dans quel terminal vous êtes avec "$ tty". Si vous êtes déjà dans gdb, inutile d'en sortir :

(gdb) show inferior-tty
Affiche le terminal courant utilisé pour le programme exécuté.

(gdb) set inferior-tty terminal
(gdb) tty(gdb) tty terminal
Règle le terminal courant pour l'exécution du programme à "terminal".

Exemple :

TERMINAL /dev/pts/2

(gdb) tty /dev/pts/3
(gdb) run
(gdb)

TERMINAL /dev/pts/3

$ Sorties et entrées du programme exécuté par GDB...

Stopper l'exécution

Vous pouvez décider de stopper l'exécution du programme en cours. Il suffit d'utiliser la commande kill :

(gdb) kill
Kill the program being debugged? (y or n) y
(gdb)

Démarrer une session GDB Placer des points d'arrêt

Placer des points d'arrêt

Exécuter le programme Contrôler l'état des variables et registres

Shinseki No Ko To O Tomari Dakara De Na Na

It looks like you’re quoting or referencing a phrase from the Japanese light novel and anime series Shin Sekai Yori (新世界より, From the New World), specifically the opening line of the folk song “Yuki no Hōkai” (雪の崩壊, “The Collapse of the Snow”):

“Shinseki no ko to o tomari, dakara de na na…”

In the story, this eerie, ritualistic children’s song is a harbinger of danger and a key to unraveling the village’s dark secrets about karma, Cantus (psychokinesis), and the fate of "defective" children.

However, your request says: “— proper blog post.”

So here’s a short, properly formatted blog post based on that line:


The Japanese Context: Sleepovers with Relatives’ Kids

In Japan, the concept of “tomari” (泊まり) – an overnight stay – is common among family members, especially during summer vacation (natsuyasumi), New Year’s, or Obon holidays. When parents visit grandparents, cousins often stay over together.

“Shinseki no ko” (親戚の子) means “a relative’s child” – i.e., your cousin, niece, nephew, or similar.

So a parent might say to their own child:

“You’re sleeping at your aunt’s house tonight. Be good – shinseki no ko to otomari dakara de… (because it’s an overnight stay with a relative’s child)… behave.”

The “de, na na?” softens it into a mutual understanding: “You get it, right?”


SEO Analysis for This Keyword

The search phrase “shinseki no ko to o tomari dakara de na na” has virtually no search volume globally. However, if it catches on as a meme, it could gain traction. To optimize for it:


Sample Dialogue Using the Phrase

A: Natsuyasumi, nani suru? (What’ll you do on summer break?)
B: Shinseki no ko to tomaru kara de na na…
A: A, wakaru wakaru. Omoshirokatta? (Ah, I get it. Was it fun?)
B: …Naisho. (…Secret.)

This exchange embodies the lighthearted, teasing nature of the phrase.

Exploring "Shinsekai no Owari": The Band and the Concept of "Staying"

Introduction The Japanese music landscape is often defined by its ability to blend whimsical fantasy with deep, sometimes melancholic, lyrical themes. One of the most prominent bands to embody this duality is SEKAI NO OWARI (End of the World). While the input phrase “shinseki no ko to o tomari dakara de na na” is difficult to parse as standard Japanese, it appears to be a phonetic approximation of the band's name and their recurring lyrical motifs—specifically the desire "to stay" (tomari/tomareba) in a moment of peace.

The Artist: SEKAI NO OWARI Formed in 2007 in Tokyo, SEKAI NO OWARI consists of four members: Fukase (Vocals), Nakajin (Guitar), Saori (Piano), and DJ LOVE (DJ, identifiable by his clown mask). Their name translates to "End of the World," a concept derived from the lead singer's experience of reaching a mental "end" and finding the resolve to start life anew.

Their music is characterized by a unique "Dark Fantasy" style, often contrasting upbeat, pop-driven melodies with lyrics that explore isolation, conflict, and the search for a sanctuary.

The Song: "Taiyou to Tsuki" (The Sun and the Moon) The phrase in your request likely references the song "Taiyou to Tsuki" (The Sun and the Moon), released in 2024 as the theme song for the movie Kinema no Kamisama.

In this track, the band explores the relationship between two opposing forces—the sun and the moon—who are destined to chase each other but never meet. However, the emotional core of the song lies in the wish for a moment where time stops, allowing these opposing forces to coexist.

Decoding the Lyrics: "Tomareba ii na" The key phrase hidden in your request is likely "Tomareba ii na" (止まればいいな), which translates to "It would be nice if it stopped" or "I wish we could stay."

In the context of "Taiyou to Tsuki," this sentiment is poignant. The lyrics express a wish for the relentless passage of time—or the inevitable cycle of chasing and running away—to pause.

The song suggests that even in an "End of the World" (Shinsekai) scenario, the ultimate human desire is not for destruction, but for a quiet moment to "stay" (tomari) with a loved one.

Themes and Significance SEKAI NO OWARI uses the concept of "stopping" not as a halt to progress, but as a rejection of conflict. Their earlier hits, such as "RPG" and "Dragon Night," similarly depict a world at war where characters wish for the fighting to stop so they can enjoy the scenery together.

"Taiyou to Tsuki" continues this legacy. It informs the listener that while the world may be full of inevitable separations (like the sun and moon), the beauty lies in the shared wish to remain together, even if just for a fleeting moment.

Conclusion While the specific phrase provided may be a misheard lyric, it points toward the heart of SEKAI NO OWARI's philosophy. Through songs

The phrase "shinseki no ko to otomari dakara" (親戚の子とお泊りだから) translates from Japanese as "Because I'm staying overnight with a relative's child."

This specific line has gained popularity online, particularly on platforms like TikTok and Instagram, where it is often associated with anime edits, fan art, or "status" videos featuring various characters. Context and Meaning Translation Breakdown: Shinseki (親戚): Relative. no Ko (の子): Child of / 's child. to (と): With. Otomari (お泊り): Staying overnight / sleepover. Dakara (だから): Because / so.

Usage: In Japanese media, this phrase is typically a simple explanatory sentence used by a character to justify their absence or a change in plans.

Online Presence: It is frequently used as a title or caption for short video clips (AMVs) or social media posts that showcase "aesthetic" or "iyashikei" (healing/soothing) anime content.

Translation: The phrase roughly translates to "Because it's a new record, it's a great achievement, isn't it?" or "It's a new record, so it's a wonderful thing, isn't it?"

Report:

If you could provide more context or clarify what you would like me to report on, I'll do my best to assist you.

"新世紀の子とお泊まりだからでな"

Here's a breakdown of what it says:

So, a loose translation of the entire text could be:

"That's why we're going to spend the night, child of the new century."

Or, in a more natural English phrasing:

"So, we're staying over tonight, kiddo from the new century."

The context would significantly help in providing a more accurate translation, but this gives you a general idea.

The phrase "Shinseki no Ko to Otomari Dakara" (translated as "Because I'm Staying Over with my Relative’s Kid") has become a significant focal point in niche anime and manga circles. Often associated with specific subgenres of "slice-of-life" or more mature romantic dramas, it represents a popular trope: the unexpected intimacy that develops when two people are forced into a shared living space.

If you are looking for a deep dive into why this specific phrase—and the media associated with it—resonates so strongly with fans, here is a comprehensive look at the "Otomari" (Sleepover) phenomenon. 1. The Power of the "Shared Roof" Trope

At its core, the "Staying with a Relative" setup is a classic narrative engine. In Japanese storytelling, this trope is often used to bypass the usual social barriers of dating or meeting. By placing characters in a domestic setting—sharing meals, doing laundry, or navigating bathroom schedules—the story moves from "acquaintances" to "intimate" almost overnight.

The specific keyword often points toward stories where a protagonist is tasked with looking after a younger relative or staying at a relative's house during a summer break or a transition period. This creates a "liminal space" where the normal rules of their everyday lives don't quite apply. 2. The Appeal of Domesticity

Why is this so popular? Unlike high-octane action series, these stories focus on domestic comfort.

The "Healing" Factor: For many readers, seeing characters bond over simple things like cooking dinner or watching TV provides a sense of iyashikei (healing). shinseki no ko to o tomari dakara de na na

The Forbidden Element: Often, these stories play with the "close but far" dynamic. Because the characters are relatives or "pseudo-family," there is a built-in tension between their social roles and their growing personal feelings. 3. Cultural Context: The "Relative's House" in Japan

In Japan, visiting a relative’s house for an extended stay is a common rite of passage, particularly during Obon or New Year’s. It evokes a sense of nostalgia—the smell of tatami mats, the sound of cicadas, and the unique awkwardness of being in a home that isn't quite yours.

When a series uses "Shinseki no Ko" (a relative’s child) as a central figure, it taps into that specific nostalgia, making the story feel grounded and relatable to a wide audience. 4. Navigating the Niche

It is worth noting that this keyword is frequently associated with the "Seinen" or adult-interest categories of manga and light novels. In these versions, the focus shifts from pure "slice-of-life" to more complex emotional (and sometimes physical) explorations.

The phrase "de na na" in your query likely refers to a specific title or a rhythmic ending to a sentence, often used in social media tagging or specific site indexing to help fans find "vibe-consistent" content. 5. Why it Trends

The popularity of "Shinseki no Ko to Otomari Dakara" boils down to immersion. It allows the audience to imagine a scenario where the pressures of the outside world disappear, replaced by the quiet, intense, and often transformative experience of staying with someone else.

Whether you are looking for a heartwarming story about family bonds or a more tension-filled romantic drama, this keyword serves as a gateway to stories that explore the most private parts of human connection.

Let's break it down:

If we were to translate this into English in a way that makes sense, it could be something like: "So, that's because the orphan and I are friends, isn't it?" or a similar interpretation depending on the context.

Here is a generated piece based on the provided phrase:

The streets of the new century were always bustling, but amidst all the noise and chaos, she found him. An orphan, no more than ten years old, with a resilience in his eyes that she hadn't seen before. Despite the world's indifference, he had a spark, a flame of hope that refused to be extinguished.

She decided then and there to be his friend, to stand by him through the trials and tribulations that life would inevitably throw their way. And as they walked side by side, hand in hand, through the neon-lit streets, she realized that this little orphan had become so much more than just a friend to her.

"Shinseki no ko to tomari dakara de na," she whispered to herself, smiling at the memory of how they met and the adventures they'd shared. It was a new century, indeed, and one filled with uncertainty, but with him by her side, she felt ready to face whatever came their way.

The casual "dakara de na" slipped out in conversation sometimes, a quirk of their unique bond, a phrase that symbolized the unspoken understanding between them—that they had each other's backs, no matter what.

Their story was still unfolding, a tale of friendship and survival in a world that seemed determined to leave them behind. But they didn't need much; they had each other, and that was enough to face the dawn of a new century.

It looks like you're asking for a social media post based on the phrase:

"shinseki no ko to o tomari dakara de na na"

I think this might be a mix of romaji Japanese and maybe a typo or a partial lyric/phrase. Could you clarify the correct original phrase? For example, are you thinking of:

If you give me the intended meaning or correct wording, I can write you a perfect post (cute, funny, thoughtful, or dramatic depending on the context).

The phrase "Shinseki no ko to o tomari dakara de na na" (親戚の子とお泊まりだから、でなな) roughly translates to "

Because I'm having a sleepover with a relative's child, so [don't come out/stay quiet]

This title is associated with a specific genre of adult-oriented Japanese media (manga or doujinshi) that typically explores "forbidden" or "secret" relationship tropes involving family or relatives. Key Themes and Tropes Secret Situations:

The title suggests a premise where a character (often a younger relative) is staying over, and the protagonist must hide a secret or navigate a delicate situation to avoid being caught. Forbidden Relationships:

Common in this genre, the story likely focuses on the tension of a relationship that must remain hidden from other family members. Domestic Setting:

The "stayover" or "sleepover" setting is a frequent trope used to create forced proximity between characters. Tips for Finding the Specific Work

If you are looking for the exact guide to the plot or the specific author: Search for the Japanese Title: 親戚の子とお泊まりだから on Japanese media databases or "tankobon" tracking sites. Look for Metadata:

Often these titles are part of a series or a specific anthology. Checking platforms like

using the Japanese keywords may yield the exact product page and artist information.

The phrase "Shinseki no Ko to O Tomari Dakara de Na Na" (親戚の子とお泊まりだからでなな) refers to a Japanese manga and anime series that has gained significant attention for its portrayal of complex relationships and emotional growth.

While the full title can be roughly translated to "Because I'm Staying Over with My Relative's Child," the series delves into themes that go beyond a simple domestic premise, exploring love, purpose, and the nuances of human connection. Overview of the Series

The series follows characters navigating the challenges of living together under unique circumstances. Like many works in the drama and romance genres, it balances lighthearted daily life with deeper psychological explorations.

Genre & Themes: Primarily categorized as a Japanese manga/anime series, it focuses on love, relationships, and finding one's purpose in life.

Narrative Focus: The story typically centers on the evolving bond between a protagonist and a younger relative who comes to stay with them, often leading to moments of personal discovery and mutual support. Cultural Context and Popularity

The series has found a dedicated following online, particularly on social media platforms like TikTok, where fans share edits, clips, and discussions about the characters' journeys. This digital presence highlight's the series' resonance with a modern audience that appreciates stories about unconventional family dynamics. Why It Resonates

Emotional Depth: Unlike standard "slice-of-life" stories, this series is noted for its exploration of more serious life themes.

Relatability: Many viewers connect with the theme of unexpected responsibility and the growth that comes from caring for another person.

Visual Storytelling: The anime adaptation is often praised for its ability to capture the subtle emotions of the characters through its art style.

For fans of the genre, the series represents a blend of domestic comfort and the often-turbulent path toward maturity and emotional fulfillment.

It looks like you're asking for a blog post based on the phrase:

"Shinseki no ko to o tomari dakara de na na"

This seems like a romaji version of a Japanese phrase, possibly with some typos or shorthand. A likely interpretation could be:

"親戚の子とお泊まりだからでなな"
(Shinseki no ko to otomari dakara de nana)

Which might mean something like:

"Because I'm staying over with my relative's kid, so... nana?"

Or possibly it's from a specific anime, manga, or meme context. The "de nana" at the end might be a name (Nana), a number (7), or just a playful ending.

Could you clarify the intended meaning or source? Once I know the exact context, I can write a full, natural blog post based on it.

Title: "Shinseki no Ko to O Tomari Dakara de Na Na: Unveiling the Mystique of a Japanese Phenomenon"

Introduction

In the vast and fascinating world of Japanese culture, there exist numerous intriguing phenomena that continue to capture the imagination of people worldwide. One such enigmatic entity is "Shinseki no Ko to O Tomari Dakara de Na Na". For those unfamiliar with this term, it may seem like a mouthful of Japanese characters, but bear with me as we embark on a journey to unravel the mystique surrounding this phenomenon.

What is Shinseki no Ko to O Tomari Dakara de Na Na?

Shinseki no Ko to O Tomari Dakara de Na Na roughly translates to "The Star-Faced Child and The Reason for Staying Together". While I couldn't find concrete information on this specific topic, I'll attempt to weave a narrative that might provide insight into its possible meaning.

The Concept of Connection and Togetherness

In Japanese culture, the concept of togetherness and interconnectedness is deeply rooted in the philosophy of "Wa" (), emphasizing harmony and unity. The phrase "O Tomari Dakara de Na Na" seems to hint at the idea of staying together or being connected. Could it be that Shinseki no Ko represents a symbol of celestial connection or a cosmic bond?

The Star-Faced Child: A Celestial Ambassador?

The term "Shinseki no Ko" or "Star-Faced Child" may allude to an otherworldly being, perhaps a celestial entity with a connection to the stars. In Japanese folklore, there are stories of heavenly beings and star spirits that interact with humans. This notion sparks curiosity about the role of Shinseki no Ko: are they a messenger from the cosmos, guiding us toward unity and togetherness?

Interpretations and Reflections

While a definitive explanation for Shinseki no Ko to O Tomari Dakara de Na Na remains elusive, we can explore possible interpretations:

Conclusion

The enigmatic phrase "Shinseki no Ko to O Tomari Dakara de Na Na" offers a glimpse into the rich tapestry of Japanese culture, where connections, harmony, and celestial influences converge. While our exploration may not have yielded a definitive answer, it has, I hope, sparked a sense of curiosity and wonder.

As we navigate our own paths in life, we may find inspiration in the mystical and cultural significance of Shinseki no Ko to O Tomari Dakara de Na Na. In the words of a Japanese proverb, "" (Kaze to ki no ke), or "The wind and the tree's shadow," our lives are intertwined, and understanding these connections can lead to a deeper appreciation of ourselves and the world around us.

What are your thoughts on Shinseki no Ko to O Tomari Dakara de Na Na? Share your interpretations and insights!

The phrase "Shinseki no ko to o tomari dakara de na na" roughly translates to:

"Because my relative's kid is staying over, so [I can't], right?"

It captures a specific, bittersweet moment of modern adulthood—where personal time, hobbies, or "warped" interests are put on hold to play the role of the responsible adult for a visiting younger relative.

Here is a deep blog post reflecting on that specific "grown-up" moment.

The Mirror of a Visiting Child: On Growing Up and "Playing Adult"

We often measure our growth in milestones—graduations, promotions, the first time we sign a lease. But real, jarring awareness of time often comes in the quieter, more inconvenient moments. It comes when a relative’s child stays over, and suddenly, your living room is no longer just yours. "Shinseki no ko to o tomari dakara..." Because the relative's kid is staying over.

It’s a simple excuse, a reason to decline a late-night invite or pause a video game. But beneath the surface, it’s a confrontation with the person you used to be. The Unexpected Mirror

When you watch a child from your own bloodline navigate the world, they act as a living time capsule. They might be watching the same anime you loved twenty years ago on their smartphone, or asking questions that you once asked your own "boring" uncles. In that moment, you aren't just a host; you are a bridge. You realize that to them, you are the "stable adult," even if internally you still feel like the kid who doesn't quite have it all figured out. The "Warped" Self vs. The Public Self

There is a specific tension in these visits. We often have parts of ourselves—hobbies, "warped" senses of humor, or niche obsessions—that we tuck away when the "responsible" role is required. You find yourself silencing the music you actually like or hiding the clutter of your real life to provide a "proper" environment for a child. This brings up the stinging question:

Have I actually become an adult, or am I just getting better at the performance? Finding Grace in the Interruption

While it can be exhausting to put your life on hold for a weekend, there is a profound beauty in this forced pause. Being an "uncle" or an "older cousin" is an act of service. It’s a reminder that your life is no longer a solo performance. By protecting their space and time—even if it means staying in because you have "the kid" over—you are participating in the oldest human tradition: passing the torch. The next time you have to say, "I can't, I have a relative staying over,"

don't just see it as a lost night. See it as a checkpoint. Look at that kid and see the version of you that once existed, and realize that you've traveled much further than you thought. specific cultural references December | 2020 - kafka-fuura 25 Dec 2020 —

Comparison with Similar Phrases

| Phrase | Meaning | Vibe | |--------|---------|------| | Itoko ga tomaru kedo | My cousin’s staying over | Neutral | | Shinseki no ko to onaji beddo? | Same bed as relative’s child? | Surprised | | Tomari ni iku kara sa | ‘Cause I’m going for a sleepover | Casual | | Shinseki no ko to tomaru kara de na na | As above | Playfully cryptic |

The “na na” makes all the difference — turning a fact into a feeling.

Linguistic Notes: The Role of “De”

The particle de after kara is unusual. Normally, kara alone means “because.” Adding de (as in kara de) is colloquial and slightly dialectal (Kansai or Tohoku influence). It adds a soft, trailing-off feeling — like saying “because of that, well…” This reinforces the informal intimacy.

Conclusion: Embracing the Incomplete Beauty

Japanese is a language of omission. What isn’t said often matters more than what is. “Shinseki no ko to tomaru kara de na na” is a perfect example — a phrase that begins with a concrete family scenario and ends with a soft, knowing sigh. It invites the listener to imagine the rest: the laughter, the awkward silences, the whispered secrets after lights out.

So next time you share a futon with a relative’s child, or simply recall a childhood memory, let this phrase roll off your tongue. And remember — sometimes, na na says it all.


You're interested in a feature on "Shinseki no Ko to Ō Tomari Dakara de Na Na".

Introduction

"Shinseki no Ko to Ō Tomari Dakara de Na Na" () is a Japanese manga series written and illustrated by Kyosuke Kamishiro. The series was later adapted into an anime television drama in 2016.

Plot

The story revolves around Naoki Shinseki, a 29-year-old man who appears to have a perfect life. He is successful, wealthy, and good-looking. However, his life takes an unexpected turn when he meets Tomari, a free-spirited woman who works at a hotel.

Themes and Reception

The series explores themes of love, relationships, and finding one's purpose in life. The anime adaptation received mixed reviews, with some praising its unique storytelling and characters, while others criticized its pacing and character development.

Characters

Impact and Cultural Significance

The series, although not widely known globally, has a dedicated fan base in Japan and some parts of Asia. The themes of love, relationships, and self-discovery resonate with many viewers, particularly young adults.

Conclusion

"Shinseki no Ko to Ō Tomari Dakara de Na Na" is a Japanese manga and anime series that explores themes of love, relationships, and finding one's purpose in life. While it may not be a well-known series globally, it has a dedicated fan base and offers a unique perspective on life and relationships.

Would you like to know more about a specific aspect of the series?

The phrase "Shinseki no ko to o tomari dakara" (親戚の子とお泊まりだから) roughly translates to "Because I'm having a sleepover with a relative's kid."

This specific phrase is often associated with social media posts featuring clips or "sauce" requests for specific anime-style content. Below are social media post templates you can use depending on your intent: For TikTok/Reels (Short & Viral Style) Option 1 (The "Trend" Vibe):

POV: When you have a sleepover with a relative's kid... 🏠💤Shinseki no ko to o tomari dakara...#anime #relatable #sleepover #shinsekinoko Option 2 (Text on Screen):

"Shinseki no ko to o tomari dakara..."(Include a clip of a wholesome or comedic anime family scene) For Facebook/X (Informational/Sauce Request) Standard Post:

Does anyone know the source for "Shinseki no ko to o tomari dakara"? Seen it floating around lately and need the full context! 🧐#AnimeSauce #JapanesePhrases #MangaRecommendation Key Context for the Phrase

Meaning: "Shinseki" (親戚) means relative, "Ko" (子) means child/kid, and "O-tomari" (お泊まり) means sleepover or staying overnight.

Related Media: This phrase is sometimes linked to fan-favorite niche anime or manga snippets shared on platforms like TikTok and Facebook. Japanese Family Members Explained | Kazoku vs Shinseki

The phrase "shinseki no ko to o tomari dakara de na na" (親戚の子とお泊まりだからでなな) roughly translates to "Because I'm having a sleepover with my relative's child...". This specific line has become a popular trend on social media platforms like TikTok, often paired with high-energy music or "jumpstyle" dance videos.

Here is a blog post draft centered around this viral moment.

More Than Just a Sleepover: Unpacking the "Shinseki no Ko" Viral Trend

If you’ve spent any time on the "Anime TikTok" or "Dance TikTok" side of the internet lately, you’ve undoubtedly heard the catchy, rhythmic line: “Shinseki no ko to o tomari dakara de na na.”

It’s one of those phrases that sticks in your head, even if you don't speak a word of Japanese. but where did it come from, and why is everyone suddenly obsessed with a "relative’s sleepover"? The Origin of the Phrase In a literal sense, the Japanese translates to:

"Because I’m having a sleepover with my relative's child..."

The phrase often appears in the context of anime-style storytelling or "POV" (Point of View) videos where a character—frequently an older cousin or family friend—is looking after a younger relative. Why It Went Viral

The trend isn't just about the words; it’s about the vibe.

The Music: Most viral clips use a high-tempo, electronic beat, often categorized as Heavenly Jumpstyle.

The Dance: Creators use the driving rhythm to showcase impressive shuffle steps, jumpstyle kicks, or synchronized hand movements.

The Aesthetic: You'll often see these videos featuring high-quality anime edits or "glitch" effects that sync perfectly with the "na na" part of the audio. How to Join the Trend

Want to make your own version? Here’s the "starter pack" for a "Shinseki no Ko" post:

Find the Audio: Search for "Shinseki no Ko to O Tomari" on TikTok or Instagram Reels.

The POV: Set up a relatable scenario. It could be about babysitting, gaming with a younger sibling, or just an excuse to drop a high-energy dance.

The Drop: Save your best moves for the "de na na" refrain—that’s where the energy of the track really peaks. Final Thoughts

Whether you’re a fan of the music or just confused by the sudden influx of "relative" talk on your feed, there’s no denying the infectious energy of this trend. It’s a perfect example of how a simple, everyday sentence can be transformed into a global digital anthem through the power of community and a great beat. Shinseki no Ko to O Tomatida: A Musical Journey - TikTok Shinseki no Ko to O Tomatida: A Musical Journey | TikTok. TikTok·thatgirllue♡🧚🏼‍♀️

Heavenly Jumpstyle: Explore 'Shinseki no Ko to O Tomari' Anime

The phrase Shinseki no Ko to Otomari Dakara de Na Na (roughly translating to "Because I'm Staying Over with a Relative's Kid...") is the title of a popular Japanese digital manga series. If you are looking for a (physical) version, here is the current status: Physical Release Availability Original Format: This series is primarily a

(digital-first). It gained significant popularity on social media platforms like X (formerly Twitter) and digital manga sites. Tankobon (Physical Books):

As of early 2026, many popular web series by this creator or in this genre do eventually receive physical "tankobon" releases through major publishers (like Kadokawa or Ichijinsha). Finding a Copy:

If a physical volume has been printed, it is typically sold through Japanese retailers such as

. If it remains digital-only, you will only find it on platforms like Pixiv, Fanbox, or Kindle. Series Overview The series is authored by Amano Shuninta

(or similar web-based artists, depending on the specific iteration). It falls under the Slice of Life / Rom-Com

categories, often featuring a "one-room" or "stay-over" dynamic between a younger relative and an older protagonist. Most physical editions are currently only available in

. There is no widespread official English paper release at this time. has been released in print recently?

An interesting feature of Shinseki no Ko to Otomari dakara (full title often cited as Shinseki no Ko to Otomari dakara de na na) is that it is primarily recognized within certain online communities as a short-form adult animation (hentai). Key features associated with this title include:

Studio Pedigree: Discussions often link it to studios known for popular mainstream series like Gekkan Shoujo Nozaki-kun and Yuru Yuri, though this association is usually part of a wider community discussion on art styles.

Viral "Name" Culture: The title is frequently used in "name" or "sauce" requests on platforms like TikTok and Facebook, where it has gained a following for its specific animation style.

Character Interaction: The premise typically focuses on a "stayover" scenario (as implied by "otomari") involving a relative, a common trope in its specific sub-genre.

Note on Similar Titles: It is often confused in search queries with Shinsekai Yori (From the New World), a serious dystopian sci-fi anime about telekinesis and government control. However, Shinseki no Ko to Otomari dakara is a distinct, much shorter work aimed at an adult audience.

Could you provide more context or clarify what you're referring to? This would help in giving a more accurate and helpful response. It looks like you’re quoting or referencing a

It is likely that the input text "shinseki no ko to o tomari dakara de na na" is a phonetic transcription or a mishearing of the Japanese lyrics or title.

Here is an informative text regarding the song and the artist.



Exécuter le programme Contrôler l'état des variables et registres

Contrôler l'état des variables et registres

Placer des points d'arrêt Contrôler le déroulement de l'exécution

Avec tout ce que nous venons de voir, vous êtes capables de lancer et d'arrêter l'exécution d'un programme. Mais cela suffit rarement à trouver la cause d'un plantage. Maintenant, lorsque le programme plante, on aimerait connaître l'état de certaines variables, pouvoir les modifier, ou encore savoir exactement à quel moment le programme a planté.

Examiner des variables

Rien plus simple, il suffit d'utiliser la commande "print" (abr. "p") en précisant le nom de la variable. Attention, il faut que la variable existe au moment où vous demandez l'affichage. Petit exemple :

void myfunc();
 
int main(){
    char msg[] = "Hello World!";
    myfunc();
    return 0;
}
 
void myfunc(){
    int boo = 16;
}
(gdb) break 5
(gdb) r
Starting program: main
 
Breakpoint 1, main () at sample1.cpp:5
5           myfunc();
(gdb)print msg
$1 = "Hello World!"
(gdb) print boo
No symbol "boo" in current context.

Si l'on souhaite accéder à une variable qui n'est pas dans la portée actuelle, on doit le préciser avec "::". Cependant, les variables hors de la portée courante sont rarement définies, elle ne le seront en fait que lorsque le programme sera dans ce bloc. À quoi peut bien servir de vouloir y accéder alors ? Eh bien voyons encore un petit exemple en utilisant le même code que précédemment :

(gdb) break 10
(gdb) r
Starting program: main
 
Breakpoint 1, main () at sample1.cpp:10
10          int boo = 16;
(gdb) print msg
No symbol "msg" in current context.
(gdb) print main::msg
$2 = "Hello World!"

Eh oui, puisque l'appel de myfunc se fait à l'intérieur du main(), on se trouve toujours à l'intérieur du main et on peut donc accéder à la variable msg.

Chaque fois que vous affichez quelque chose, GDB le garde dans l'historique pour que vous puissiez y accéder par la suite. C'est pour cette raison que vous voyez des "$1 = ...", $1 signifie qu'il s'agit de la première valeur que vous affichez. "print $1" permet d'ailleurs d'afficher $1 (mais crée du coup une nouvelle entrée dans l'historique). Vous pouvez également afficher l'historique sans passer par ces variables propres à GDB :

(gdb) show values n
Affiche dix valeurs de l'historique, en partant de (n-5) et en allant jusqu'à (n+4).

GDB tente toujours de déterminer le meilleur moyen d'afficher une valeur. Mais il est tout à fait possible de choisir le format, en utilisant :

(gdb) print /format expr
Affiche "expr" en utilisant le format spécifié. L'espace avant le "/" est obsolète (car une commande ne pouvant pas contenir de slash, GDB s'arrête de toute manière juste avant), mais il ne doit pas y en avoir après. Les formats sont les suivants :

(gdb) p/x 1234
$1 = 0x4d2
(gdb) p/d -1234
$2 = -1234
(gdb) p/u -1234
$3 = 4294966062
(gdb) p/o 1234
$4 = 02322
(gdb) p/t 1234
$5 = 10011010010
(gdb) p/a 1234
$6 = 0x4d2
(gdb) p/c 76
$7 = 76 'L'
(gdb) p/f 1234
$8 = 1.7292023e-42

On peut forcer GDB à afficher un vecteur, en utilisant "@" :

(gdb) print [/format] *adresse@taille
Affiche un tableau de taille et d'adresse de départ spécifiées. Chaque élément du tableau est affiché dans le format choisi.

(gdb) p/c *msg@5
$1 = {72 'H', 101 'e', 108 'l', 108 'l', 111 'o'}

Enfin, signalons également qu'on peut en fait afficher presque n'importe quelle expression évaluable dans le langage courant :

(gdb) print msg[3]+msg[4]+1
$1 = 220
(gdb) print myfunc()
$2 = void
(gdb) print myfunc
$3 = {void (void)} 0x8048574 <myfunc()>

Examiner la mémoire et les registres

GDB permet de définir des variables (hors du programme, qui ne seront disponibles que depuis les commandes de GDB). Quand nous avons parlé des valeurs placées dans l'historique, eh bien en réalité chaque valeur $1, $2... est une nouvelle variable créée par GDB, c'est pourquoi on peut les afficher avec print. Mais il existe aussi d'autres variables spéciales : les registres. Ces variables, qui portent le nom des registres du processeur (et du coprocesseur) permettent d'accéder aux registres. Par exemple, le registre EAX est accessible via $eax. On peut également voir les informations de tous les registres avec "info".

Note : la valeur des registres est celle qu'ils contiennent au point d'exécution du programme où vous vous trouvez.

(gdb) info all-registers
Affiche la liste complète des registres.

(gdb) info registers
Affiche la liste des registres principaux.

On peut également afficher une zone de la mémoire, à condition bien sûr que le programme exécuté y ait accès.

(gdb) examine [/tfu] adresse
(gdb) x [/tfu](gdb) x [/tfu] adresse
Affiche le contenu de la mémoire à partir de l'adresse spécifiée. Vous pouvez utiliser des expressions, par exemple un nom de fonction, une adresse contenue dans une variable, etc. Vous pouvez également préciser la taille de la zone à afficher (en octets), le format d'affichage (avec un des formats vu plus haut¹) et la taille d'une unité (b = 1 octet, h = 2 octets, w = 4 octets, g = 8 octets). Vous n'êtes pas obligés de préciser les trois options. ;)

¹ : en plus des formats déjà vus, vous pouvez utiliser "i" pour afficher l'instruction en assembleur correspondant à la valeur en mémoire.

Exemples :

(gdb) x /10xb main #Affiche les 10 (10) octets (b) à l'adresse de main en hexadécimal (x)
(gdb) x /3dw 0x123456 #Affiche les 3 (3) mots de 4 octets (w) à l'adresse 0x123456 comme des entiers signés (d)
(gdb) x /10i main #Affiche les 10 instructions assembleur à partir de l'adresse main

Modifier une variable ou un registre

On peut vouloir modifier le contenu d'une variable ou même d'un registre durant l'exécution. Par exemple si on se rend compte qu'on divise par 0 mais qu'on souhaite continuer l'exécution, on peut modifier la valeur d'une variable lorsqu'on arrive à l'endroit qui pose problème.

(gdb) set $variable = value
Permet de modifier la valeur contenue dans une variable GDB, il s'agit par exemple d'un registre (ex : "(gdb) set $eax = 5" pour mettre EAX à 0).
Si la variable n'existe pas, elle est créée.

(gdb) set variable variable = value
(gdb) set var (gdb) set var variable = value
Permet de modifier le contenu d'une variable du programme. Vous ne pouvez pas en créer de nouvelle, et vous ne pouvez pas non plus modifier la taille d'une variable, donc faites attention à ne pas placer n'importe quoi dedans. ^^


Placer des points d'arrêt Contrôler le déroulement de l'exécution

Contrôler le déroulement de l'exécution

Contrôler l'état des variables et registres Un petit exemple

Il n'est pas toujours évident de savoir à quel moment un programme plante. Par exemple, si l'erreur se trouve dans une fonction (recevant par exemple des paramètres erronés), qui est appelée de différents endroits, on voudrait savoir qui l'a appelée. GDB fournit donc plusieurs commandes permettant de se repérer dans l'exécution du programme.

Mais avant de voir ces commandes, un peu de théorie s'impose. Lorsque dans un programme vous appelez une fonction, l'ordinateur doit "sauter" à l'adresse de cette fonction pour en exécuter les instructions. Mais il est nécessaire, pour pouvoir faire cet appel correctement, de sauvegarder des informations. Par exemple, l'ordinateur doit savoir à quel endroit il doit revenir une fois qu'il termine l'exécution de la fonction. Il faut donc, au minimum, sauvegarder cette adresse avant de faire le saut. Il faut aussi passer les arguments à la fonction, ce qui se fait en général en utilisant une pile (une zone mémoire où on va ajouter et retirer des informations, allez voir sur Wikipédia si vous voulez plus de détails, ça peut être très intéressant). Et il se peut même que dans une fonction, on en appelle d'autres. Il faut donc, à chaque appel, sauvegarder certaines valeurs (en général des registres). Chaque fonction a donc ce qu'on appelle une "frame" (abr. "f"), qui correspond à un ensemble d'informations la concernant.

(gdb) frame [frameid]
Si vous ne précisez pas de frameid, affiche les informations sur la frame courante. Sinon, se place dans la frame indiquée et en affiche les informations.
Remarque : changer de frame ne perturbe pas l'exécution du programme. En fait, le programme se trouve toujours au même point d'exécution, c'est GDB qui se "place" dans la frame indiquée. Les commandes que vous entrerez auront alors effet sur la frame sélectionnée (par exemple si vous faites un print, les variables "locales" seront celles de la frame courante, et pour les autres vous devrez spécifier la frame comme nous l'avions vu avec "::").

(gdb) select-frame frameid
Se place dans la frame indiquée.

(gdb) up [n]
Remonte de n frames (ou de 1 si n n'est pas spécifié).

(gdb) down [n]
Descend de n frames (ou de 1 si n n'est pas spécifié).

(gdb) info frame
Affiche des informations détaillées sur la frame courante. On y trouve par exemple les registres qui ont été sauvegardés, l'adresse de la frame précédente, etc.

Backtrace : le stack de frames

Obtenir des informations sur une frame est utile, mais le plus souvent ce qui nous intéresse c'est de voir le stack (la pile) des frames, pour savoir par où le programme est passé pour arriver à l'endroit d'exécution où il se trouve. Il existe pour ce faire une commande toute simple, "backtrace" (abr. "bt"). Prenons le code C++ suivant :

#include <iostream>
using namespace std;
 
void myfunc(int i);
 
int main(){
    char msg[] = "Hello World!";
    myfunc(2);
    return 0;
}
 
void myfunc(int i){
    int boo = 16;
    if (i > 0) myfunc(i-1);
}

(gdb) backtrace
Affiche le stack d'appel (liste des frames).

Voici une petite session GDB, j'ai effacé les lignes inutiles pour clarifier :

(gdb) break myfunc
(gdb) run
Breakpoint 1, myfunc (i=2) at sample1.cpp:13
(gdb) bt
#0  myfunc (i=2) at sample1.cpp:13
#1  0x080485e2 in main () at sample1.cpp:8
(gdb) continue
Breakpoint 1, myfunc (i=1) at sample1.cpp:13
(gdb) bt
#0  myfunc (i=1) at sample1.cpp:13
#1  0x08048595 in myfunc (i=2) at sample1.cpp:14
#2  0x080485e2 in main () at sample1.cpp:8
(gdb) continue
Breakpoint 1, myfunc (i=0) at sample1.cpp:13
(gdb) bt
#0  myfunc (i=0) at sample1.cpp:13
#1  0x08048595 in myfunc (i=1) at sample1.cpp:14
#2  0x08048595 in myfunc (i=2) at sample1.cpp:14
#3  0x080485e2 in main () at sample1.cpp:8

On voit rapidement que backtrace part de la frame courante, et remonte jusqu'à la frame la plus éloignée (ici le main). On peut voir pour chaque frame son numéro (#...), l'adresse où elle commence (là où se trouve le code en mémoire), suivie du nom de la fonction et des paramètres passés, ainsi que du fichier et de la ligne où elle se trouve. Si vous souhaitez également afficher les informations sur les variables locales de chaque frame, vous pouvez utiliser l'option "full" :

(gdb) backtrace full
Affiche le stack d'appel (liste des frames) avec, pour chaque frame, le contenu des variables locales.

Changer le point d'exécution

Il existe certaines commandes qui modifient le déroulement du programme :

(gdb) jump position
Continue l'exécution à l'endroit spécifié. Comme pour les points d'arrêt, la position peut être indiquée :

Attention à ce que vous faites, car si vous passez d'une fonction à une autre, n'oubliez pas qu'il faudra peut-être régler vous même les paramètres (avec set var).

(gdb) return [value]
Exécute l'instruction de retour de la fonction dans laquelle vous vous trouvez. Vous pouvez préciser la valeur de retour.
Par exemple, si vous interrompez l'exécution dans la fonction myfunc(), vous pouvez utiliser return, ce qui quittera la fonction.

(gdb) call expression
Call est identique à print, sauf qu'il n'affiche le résultat que s'il est différent de void. En fait, avec print comme avec call, vous pouvez appeler des fonctions :

(gdb) print myfunc(5)
$1 = void
(gdb) call myfunc(5)
(gdb)

Contrôler l'état des variables et registres Un petit exemple

Un petit exemple

Contrôler le déroulement de l'exécution

Avec tout ce que nous avons vu, nous pouvons maintenant facilement déboguer nos programmes. Voici un petit exemple assez simple.

#include <stdio.h>
 
int main(){
    char * Buffer;
    printf("Nom? ");
    scanf("%s", Buffer);
    return 0;
}

Bien entendu c'est un programme ridicule, et l'erreur est évidente, mais comme le but est juste de montrer le fonctionnement de GDB, nous nous en contenterons. Compilons :

$ g++ -Wall -Wextra -pedantic -ansi -g -o main sample1.cpp

Aucune erreur de compilation, même avec les options de compilation strictes (logique, syntaxiquement tout est correct). Mais lorsqu'on lance le programme, on obtient une segmentation fault dès qu'on entre quelque chose au clavier. Utilisons GDB :

$ gdb main
(gdb) run
Starting program: /home/dhkold/Documents/code/gdb/main
Nom? DHKold
 
Program received signal SIGSEGV, Segmentation fault.
0xb7d70dae in _IO_vfscanf () from /lib/tls/i686/cmov/libc.so.6

Voyons maintenant où nous nous trouvons :

(gdb) bt
#0  0xb7d70dae in _IO_vfscanf () from /lib/tls/i686/cmov/libc.so.6
#1  0xb7d784cb in scanf () from /lib/tls/i686/cmov/libc.so.6
#2  0x080484b4 in main () at sample1.cpp:7

L'erreur vient donc de l'appel à scanf fait depuis la ligne 7. Et en effet, Buffer n'est pas alloué et pointe sur n'importe quoi. On peut simplement recompiler après avoir corrigé, mais on peut aussi vérifier que l'erreur vient bien de là :

(gdb) start
Breakpoint 1 at 0x8048495: file sample1.cpp, line 6.
Starting program: /home/dhkold/Documents/code/gdb/main
main () at sample1.cpp:6
6           printf("Nom? ");
(gdb) set var Buffer = malloc(50)
(gdb) print Buffer
$1 = 0x804a008 ""
(gdb) c
Continuing.
Nom? DHKold
 
Program exited normally.

Et voilà, c'est donc bien Buffer qui pose problème, et il suffit de l'allouer pour ne plus avoir d'erreur. J'espère que ce tout petit exemple vous a permis de voir comment utiliser les commandes GDB que nous avons étudiées durant ce tutoriel. N'hésitez pas à aller lire la documentation sur le site de GDB, elle est en anglais et n'est pas toujours très claire, mais si vous connaissez déjà les bases vous devriez pouvoir vous y retrouver.

Voilà qui est fait, vous devriez maintenant être capables de vous servir de GDB correctement.


Contrôler le déroulement de l'exécution