This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Dealing with version-specific syntax


What I am trying to do: Get the disassembly for a specific address
range.  And I try to do it with gdb.  The problem here ist that as far
as I can tell, up to gdb-7.0 the way to do this is

disassemble 0x404E22 0x404E40

Starting from gdb-7.1, this syntax is invalid, and instead we have to
use

disassemble 0x404E22,0x404E40

Unfortunately, this syntax does something else in gdb-7.0 and earlier
(it disassembles whole functions).

Is there a good way inside gdb for deciding which syntax to use?
Ideally, I would test if the space-separated syntax works, and use it
if it does, and otherwise use the comma-syntax.  Or I might test for
the gdb version and use the syntax depending on that.

If there is no easy way, we will probably take the approach of testing
the gdb version outside of gdb.

- anton


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]