Giter Club home page Giter Club logo

Comments (20)

WebFreak001 avatar WebFreak001 commented on May 31, 2024

remove the '-' at the start of the command. If commands are starting with '-' it thinks they are a MI command

from code-debug.

csholmq avatar csholmq commented on May 31, 2024

Still not working.

image

It connects to the GDB server. But nothing else works.

from code-debug.

WebFreak001 avatar WebFreak001 commented on May 31, 2024

Are you running gdbserver on localhost on port 4444?

from code-debug.

csholmq avatar csholmq commented on May 31, 2024

Yes. That's my GDB bridge which relays to my target over a CAN bus. So when I say it connects, I mean to my GDB bridge running locally on my computer. No monitor commands are patched through (it worked in 0.2.0)

from code-debug.

WebFreak001 avatar WebFreak001 commented on May 31, 2024

your configuration misses executable and cwd. For me gdbserver works with cwd and executable.

executable loads the symbols and cwd makes the source paths available

from code-debug.

csholmq avatar csholmq commented on May 31, 2024

Didn't make a difference. Now says that symbols have been read, but same error.

{
    "version": "0.3.1",
    "configurations": [
        {
            "name": "Debug GDB",
            "type": "gdb",
            "request": "attach",
            "target": ":4444",
            "remote": true,
            "autorun": ["monitor interface=0"],
            "executable": "${workspaceRoot}/Sw/A_XMC/out/use/A_Myriad_A_5_6.elf",
            "cwd": "${workspaceRoot}"
        }
    ]
}

from code-debug.

WebFreak001 avatar WebFreak001 commented on May 31, 2024

What os are you on?

Also im not sure if this is a code-debug issue. Does it work from the console?

from code-debug.

WebFreak001 avatar WebFreak001 commented on May 31, 2024

also i uploaded a new release. You dont need to prefix executable with workspaceRoot anymore.

from code-debug.

csholmq avatar csholmq commented on May 31, 2024

Updated and reconfigured. (I'm on Win7 btw)

{
    "version": "0.3.3",
    "configurations": [
        {
            "name": "Debug GDB",
            "type": "gdb",
            "request": "attach",
            "target": ":4444",
            "remote": true,
            "autorun": ["monitor interface=0"],
            "executable": "../use/A_Myriad_A_5_6.elf",
            "cwd": "${workspaceRoot}/Sw/A_XMC/out/obj"
        }
    ]
}

image

from code-debug.

WebFreak001 avatar WebFreak001 commented on May 31, 2024

it will now assume all source code is in [...]/out/obj

I think its a bug with GDB because cannot execute this command while the target is running can't possibly be caused by the extension. It happens with GDB in other places too: https://stackoverflow.com/questions/16900615/gdb-step-not-working-as-expected

Does it work if you debug it manually from the console?

from code-debug.

csholmq avatar csholmq commented on May 31, 2024

Yes, that was my intent. I have my .c/.h/.o in out/obj and my elf file in out/use.

I got it working now but I had to manually run target remote localhost:4444 which I didn't had to do before.

from code-debug.

WebFreak001 avatar WebFreak001 commented on May 31, 2024

hm, the extension actually calls the MI command of that. See mi2.ts:169

from code-debug.

csholmq avatar csholmq commented on May 31, 2024

Yes. But it works when my first autoruncommand is target remote localhost:4444

from code-debug.

csholmq avatar csholmq commented on May 31, 2024

Any way to debug which messages are being sent?

from code-debug.

WebFreak001 avatar WebFreak001 commented on May 31, 2024

I can let it print all input to the console

from code-debug.

csholmq avatar csholmq commented on May 31, 2024

Yeah. Maybe a debug boolean that lets you "debug the debugger" :) 👍

from code-debug.

WebFreak001 avatar WebFreak001 commented on May 31, 2024

ok there is now an option to print GDB calls

from code-debug.

csholmq avatar csholmq commented on May 31, 2024
{
    "version": "0.3.4",
    "configurations": [
        {
            "name": "Debug GDB",
            "type": "gdb",
            "request": "attach",
            "target": "localhost:4444",
            "remote": true,
            "cwd": "${workspaceRoot}/Sw/A_XMC/out/obj",
            // "executable": "../use/A_Myriad_A_5_6.elf",
            "printCalls": true,
            "autorun": [
                "target remote localhost:4444",
                "monitor interface=0",
                "monitor port=0",
                "monitor speed=500000",
                "monitor type=0",
                "monitor protocol=0",
                "monitor unit=2",
                "monitor unlockcode=xxx",
                "monitor connect"
                // "symbol-file",
                // "exec-file C:/dev/xxx/xxx_Myriad/Sw/A_XMC/out/use/A_Myriad_A_5_6.elf",
                "add-symbol-file C:/dev/xxx/xxx_Myriad/Sw/A_XMC/out/use/A_Myriad_A_5_6.elf 0x8020000"
                ]
        }
    ]
}

Note that most of the errors are due to the limited command support of my GDB bridge (failed stack-list-frames, etc).

For some reason, it seems to send everything twice...

monitor port=0
monitor speed=500000
monitor type=0
monitor protocol=0
monitor unit=2
monitor unlockcode=xxx
monitor connect
add-symbol-file C:/dev/xxx/xxx_Myriad/Sw/A_XMC/out/use/A_Myriad_A_5_6.elf 0x8020000
Can't send signals to this remote system.  SIGILL not sent.
target remote localhost:4444
A program is being debugged already.  Kill it? (y or n) [answered Y; input not from terminal]
Cannot execute this command while the target is running.
5-stack-list-frames 0 20
Remote debugging using localhost:4444
0x0000a408 in ?? ()
Not implemented stop reason (assuming exception): undefined
monitor interface=0
monitor port=0
6-stack-list-frames 0 20
monitor speed=500000
monitor type=0
monitor protocol=0
monitor unit=2
monitor unlockcode=xxx
monitor connect
add-symbol-file C:/dev/xxx/xxx_Myriad/Sw/A_XMC/out/use/A_Myriad_A_5_6.elf 0x8020000
add symbol table from file "C:/dev/xxx/xxx_Myriad/Sw/A_XMC/out/use/A_Myriad_A_5_6.elf" at
    .text_addr = 0x8020000
(y or n) [answered Y; input not from terminal]
Reading symbols from C:\dev\xxx\xxx_Myriad\Sw\A_XMC\out\use\A_Myriad_A_5_6.elf...
done.
Failed to run command `stack-list-frames 0 20`: Cannot access memory at address 0xa404
An error occured: Cannot access memory at address 0xa404
Failed to run command `stack-list-frames 0 20`: Cannot access memory at address 0xa404
An error occured: Cannot access memory at address 0xa404

from code-debug.

WebFreak001 avatar WebFreak001 commented on May 31, 2024

Im not sure how I can fix that without having such a GDB bridge myself as everything works with gdbserver. Considered forking this project and editing it? All you need to change would be in src/backend/mi2/mi2.ts in function connect: https://github.com/WebFreak001/code-debug/blob/master/src/backend/mi2/mi2.ts#L155-L177

from code-debug.

csholmq avatar csholmq commented on May 31, 2024

Perhaps this issue should be closed if I'm the only one experiencing this. I could fork and patch to suit my needs, but I wouldn't know if I broke normal debugging for everybody else.

Reopen if somebody else experiences this.

from code-debug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.