-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instructions needed for arm-eabi #140
Comments
The link mentions to use this as the gdb program. As a test, try manually running it with the MI argument from the command line.
If it accepts it, then it should be good to go. If it doesn't like it, then Seer won't work. The link also mentions how to connect to the device while in gdb.
For Seer, this translates to running Seer this way:
If you need to load in a symbol file (for the program's debug information), then add this:
Hope this helps. It really depends on the first point working, though. |
When I did a make install, it installed "seergdb", not "seer." Anyway, no luck. When I run the following command:
I get the following message:
|
OK. I had to manually set the path to /usr/local/bin/arm-none-eabi-gdb and it finally work. I now get another error when I try to step into a line of code: Cannot find bounds of current function. |
Hi,
Odd. Before you mentioned using an environment variable for the location of gdb. Can you tell me the variable you used? And its value? Also, what did you set in the gdb config dialog for the path to gdb? If you didn't use environment variables, then you would need to set the full path to gdb if /usr/local/bin/ isn't in your $path variable. Use this to see if /usr/local/bin is in your default path.
I suspect you're viewing the assembly tab? This message happens if the program being debugged is written in assembly, or if there's no debug information. I see you used the --sym flag. Does bin/main have debug information turned on? bin/main seems like an odd name for a symbol file. Usually the name ends with .elf. You can set Seer to examine N number of instructions when viewing the Assembly tab. Set Length in the Disassembly Mode field. |
Hi, I am not debugging my code in assembly. Here's what I see when I use the file command:
I didn't see a separate symbol file as I am normally accustomed to. I assume it's embedded in the executable. The only reason I included it as the --sym argument was to follow your example and because seergdb complains the executable name can't be provided for 'connect' mode. How does it determine what executable to debug? According to some suggestions on the Ada forum, it's recommended you run GDB from the same toolchain used to build your executable. Does GDB require a specialized build depending on every architecture, runtime, and OS in order for it to work? The toolchain path is in an environment variable set by Alire. Below is the full path and its contents: GNAT_ARM_ELF_ALIRE_PREFIX=/Users/Joe/.config/alire/cache/dependencies/gnat_arm_elf_12.2.1_f4bfd822/bin
When I try to set up my environment to use the toolchain path's arm-eabi-gdb, all hell breaks loose. It simply doesn't work because it doesn't support interpreter=mi option. When I run it from the command line, it shows the source for main, but throws an exception as soon as I try to execute through the code. I finally got seergdb to start up and show the source for the main function by pasting /usr/local/bin/arm-none-eabi-gdb into the configuration dialog, but I can't step into any subprograms. Interestingly, seergdb's configuration dialog doesn't save the value. As far as the name, I use main without the elf suffix since it's the convention I picked up from Ada sample programs. Should I add .ELF? Will it make a difference? I've enclosed an archive of the executable and a generated symbol file if you think it might be helpful. My immediate guess is that the arm-eabi-gdb is broken for some reason. |
Hi Joe, I think Seer working or failing with this hinges on running this command to see if the arm gdb accepts the "mi" option.
What does the above command output when you enter it at the command prompt? |
I'll see if I can install "arm-none-eabi-gdb" on my machine. What version are you using?
|
Below, I've included the output of the commands you requested. I'm trying to figure out the source of the problem. We can forget about arm-eabi-gdb for now since it doesn't support MI and crashes as soon as I step into a subprogram. arm-none-eabi-gdb, however, works with all the functionality except for stepping into subprograms. Could it be that it requires a special build to support Ada's conventions? At the lowest level, Ada's calling architecture is different from C/C++, so I wouldn't be surprised if it requires a special build of GDB for Ada support.
|
I have no idea how I managed to close this. Can it be reopen? |
Sure. No problem. |
Did you have any luck stepping through the code? Is there anything you need? Thanks. |
Hi,
Took me awhile to figure out what subprograms are. Basically, Ada speak for functions, or subroutines. :^) So I have a test Ada program that I used to check if Seer supports debugging Ada programs. I modified it to use subprograms https://github.com/epasveer/seer/tree/main/tests/helloada I added a README.build file to mimic the "can't step into subprograms".
Note, all this is on Linux and I'm no Ada expert. Especially with the gnatmake tool. helloada.adb is the main procedure. increment_by.adb is a simple subprogram. With the steps in the README.build file, you can see I'm compiling increment_by.adb with debug turned off (-O). The main procedure has debug enabled (-g). After binding/linking, debugging the program will show the code in the main procedure. But attempting to step into the increment_by subprogram doesn't happen (because it wasn't compiled with debug enabled). Running the file command on the executable does show debug information is present. However, if you can run file on the intermediate object files, you can confirm if the subprograms are being compiled with debug enabled.
Compiling the increment_by subprogram with debug will allow Seer to step into that subprogram. Anyway, something to verify with your subprograms. |
Hi. Just seeing if my suggestion to compile/link your program with debug info turned on has worked. Otherwise, I'll close the task. Thanks, |
I am trying to debug an Ada firmware using Black Magic Probe as an SWD Debugger with GDB Server. Unfortunately, I am unable to configure it to for seer. I'm fairly new to GDB and it's confusing, requiring a deep understanding of its internals. There are two parts to the configuration, the probe and toolchain.
The probe requires configuring GDB to use the probe using remote server. The instructions I'm using can be found on the BMP site.
The second part requires configuring arm-eabi-gdb which is supplied by Ada's toolchain and installed by Alire on a per project basis. I don't know the reason it's named that--it's usually arm-none-eabi-gdb. It's located in a directory containing ARM specific Ada toolchain. In the seer main configuration, it says it requires MI. I have no idea what it is and if arm-eabi-gdb even supports it.
The text was updated successfully, but these errors were encountered: