Skip to content

Commit

Permalink
Merge pull request #7 from Telecommunication-Telemedia-Assessment/deb…
Browse files Browse the repository at this point in the history
…ugging

debugging
  • Loading branch information
stg7 authored Jul 30, 2021
2 parents 689ca15 + ad10641 commit 0995775
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch testmain",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/VideoParser/videoparser_testmain",
// "args": ["${workspaceFolder}/test.mp4"],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
// "additionalSOLibSearchPath": "${workspaceFolder}/Outputs/lib/",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Additional libs for gdb",
"text": "set environment LD_LIBRARY_PATH=${workspaceFolder}/Outputs/lib:${workspaceFolder}/VideoParser:$LD_LIBRARY_PATH",
"ignoreFailures": false
}
]
}
]
}
20 changes: 20 additions & 0 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,23 @@ cd ../VideoParser && scons
```

Or, for a small test just run `build_and_test.sh`.

## Debugging

### C Code

There is a GDB-based debugging script under `testmain.sh`. Execute it with a file:

```bash
./testmain.sh /path/to/file.mp4
```

You are now in a GDB console and can inspect the code.

To debug with Visual Studio Code, a `launch.json` file is already provided, since setup is more complex. Simply uncomment the line with `args` and specify the path to the video file that should be launche.

The `TestMain.cpp` code partly reproduces what the Python module does.

### Python

Simply add `breakpoint()` wherever you need it.

0 comments on commit 0995775

Please sign in to comment.