This is the mail archive of the gdb@sources.redhat.com 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]

Re: Disassembling ARM and Thumb code


On Thu, May 05, 2005 at 08:35:02PM -0700, Shaun Jackman wrote:
> On 5/5/05, Daniel Jacobowitz <drow@false.org> wrote:
> > On Thu, May 05, 2005 at 05:05:56PM -0700, Shaun Jackman wrote:
> > > My ARM7TDMI processor is currently in Thumb mode, but the x/i command
> > > dissects the instruction as an ARM instruction. The symbol
> > > rdp_getargvsp is a Thumb symbol added using add-symbol-file [elf
> > > binary here]. What is the command to disassemble a given memory
> > > location as a Thumb instruction?
> > 
> > How is it marked as Thumb in the binary?
> 
> It's marked with a $t symbol at the same address.
> 
> $ nm busybox | grep 020004dd
> 020004dd t $t
> 020004dd t rdp_getargvsp
> 
> I haven't read this in documentation; only noticed it from empirical
> evidence. For example, here's a symbol compiled for ARM marked with a
> $a symbol at the same address.
> 
> $ nm hello | grep 000081f8
> 000081f8 t $a
> 000081f8 T main

GDB doesn't understand ARM mapping symbols.  It could, with some
work, but it doesn't yet.  However it should understand the odd symbol
address.  If that's not working, there's a bug somewhere.

> Hehe. I agree, that's probably not the best plan. However, for the
> unique case of 'x/i $pc' it does make a certain amount of sense to use
> the CPSR as a hint. I'm not sure if it's worth the special case
> though. An explicit switch to the x/i and disas commands to specify
> ARM or Thumb dissection is very much a good idea though.

Yes, probably; if you have a good idea for the syntax to use, then
maybe we can add it.  I don't much like the idea of target-specific
modifiers.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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