Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304835
b: refs/heads/master
c: 657bcaf
h: refs/heads/master
i:
  304833: b075ef4
  304831: 681c633
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Apr 16, 2012
1 parent d3662a5 commit 9f1eb11
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5145418b06fa907883ff1f62301d534a0d26ba18
refs/heads/master: 657bcaf5097e1aff53d724358deb24ce803f43a4
29 changes: 10 additions & 19 deletions trunk/tools/perf/ui/browsers/annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,22 +260,16 @@ static bool annotate_browser__callq(struct annotate_browser *browser,
void *arg, int delay_secs)
{
struct map_symbol *ms = browser->b.priv;
struct disasm_line *dl = browser->selection;
struct symbol *sym = ms->sym;
struct annotation *notes;
struct symbol *target;
char *s = strstr(browser->selection->line, "callq ");
u64 ip;

if (s == NULL)
if (strcmp(dl->name, "callq"))
return false;

s = strchr(s, ' ');
if (s++ == NULL) {
ui_helpline__puts("Invallid callq instruction.");
return true;
}

ip = strtoull(s, NULL, 16);
ip = strtoull(dl->operands, NULL, 16);
ip = ms->map->map_ip(ms->map, ip);
target = map__find_symbol(ms->map, ip, NULL);
if (target == NULL) {
Expand Down Expand Up @@ -321,22 +315,19 @@ struct disasm_line *annotate_browser__find_offset(struct annotate_browser *brows

static bool annotate_browser__jump(struct annotate_browser *browser)
{
const char *jumps[] = { "je ", "jne ", "ja ", "jmpq ", "js ", "jmp ", NULL };
struct disasm_line *dl;
const char *jumps[] = { "je", "jne", "ja", "jmpq", "js", "jmp", NULL };
struct disasm_line *dl = browser->selection;
s64 idx, offset;
char *s = NULL;
char *s;
int i = 0;

while (jumps[i]) {
s = strstr(browser->selection->line, jumps[i++]);
if (s)
break;
}
while (jumps[i] && strcmp(dl->name, jumps[i]))
++i;

if (s == NULL)
if (jumps[i] == NULL)
return false;

s = strchr(s, '+');
s = strchr(dl->operands, '+');
if (s++ == NULL) {
ui_helpline__puts("Invallid jump instruction.");
return true;
Expand Down

0 comments on commit 9f1eb11

Please sign in to comment.