Timeline for How to use GDB in 16-bit mode?
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 23, 2020 at 19:12 | history | edited | Peter Cordes |
edited tags
|
|
| Mar 2, 2018 at 7:26 | history | edited | Ciro Santilli OurBigBook.com | CC BY-SA 3.0 |
edited title
|
| Oct 3, 2015 at 17:22 | answer | added | Ciro Santilli OurBigBook.com | timeline score: 15 | |
| Mar 2, 2015 at 15:26 | vote | accept | sarthak | ||
| Mar 2, 2015 at 15:24 | comment | added | Jester |
ld86 does produce executable, but that is a 16 bit executable that you can't load into your native operating system (which you didn't specify, but I assume linux). For the OS, that does not qualify as an executable. That's why you need something that can run your 16 bit code and provide the expected BIOS services. This is what qemu, bochs or dosbox can do.
|
|
| Mar 2, 2015 at 15:21 | comment | added | sarthak | @Jester ok..I also tried linking using ld86 command. But it still shows the same error. Doesn't ld86 produces executable code? Is there no other way to convert the .o file into executable and use it in GDB? | |
| Mar 2, 2015 at 15:08 | comment | added | Jester |
Yes, now play spot the difference with the two command lines. Notice that the gcc one does not have -c and produces executable (also hinted by the missing .o extension) but your bcc does have the -c (which means compile to object) and also the output has the .o extension.
|
|
| Mar 2, 2015 at 15:07 | comment | added | sarthak |
@Jester But it is used in 32 bit mode with gcc. The command gcc -g program.c -o programname is used to generate an object code and is run using gdb programname
|
|
| Mar 2, 2015 at 14:22 | answer | added | Parham Alvani | timeline score: 7 | |
| Mar 2, 2015 at 14:15 | comment | added | Jester |
You can't run object files in gdb, no matter how many bits. You need to make an executable, as the error message says. For 16 bit code, you will also need a 16 bit environment, such as qemu.
|
|
| Mar 2, 2015 at 14:07 | history | asked | sarthak | CC BY-SA 3.0 |